diff --git a/VERSION b/VERSION index 0c62199f16ac1e2d7f7ae75b420c1231325dff4e..0d91a54c7d439e84e3dd17d3594f1b2b6737f430 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.1 +0.3.0 diff --git a/pirati.php b/pirati.php index 3b218a84d31625344409a21e3e0bf31d33e01dd0..01029446681968e94e876ecaf8b5368c26e1f704 100644 --- a/pirati.php +++ b/pirati.php @@ -40,10 +40,10 @@ class pirati extends \phpbb\auth\provider\oauth\service\base public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) { - $this->config = $config; + $this->config = $config; $this->request = $request; - global $phpbb_container; + global $phpbb_container; $language = $phpbb_container->get('language'); $language->add_lang(array('common', 'acp/common'), 'pirates/pirid'); @@ -76,6 +76,16 @@ class pirati extends \phpbb\auth\provider\oauth\service\base ); } + + function octopussy_callback() + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, "https://chobotnice.pirati.cz/import-person/" . $result['sub'] . "/"); + curl_exec($ch); + curl_close($ch); + } + + /** * {@inheritdoc} */ @@ -110,11 +120,7 @@ class pirati extends \phpbb\auth\provider\oauth\service\base throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_RETURN_ERROR'); } - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "https://chobotnice.pirati.cz/import-person/" . $result['sub'] . "/"); - curl_exec($ch); - curl_close($ch); - + octopussy_callback(); return $result['sub']; } @@ -143,6 +149,7 @@ class pirati extends \phpbb\auth\provider\oauth\service\base throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_RETURN_ERROR'); } + octopussy_callback(); return $result['sub']; }