autoUpdate(OAUTH_VERSION, 'install'); load_language('plugin.lang', OAUTH_PATH); $conf['oauth'] = unserialize($conf['oauth']); // check config if (defined('IN_ADMIN')) { if (empty($hybridauth_conf) and strpos(@$_GET['page'],'plugin-'.OAUTH_ID)===false) { $page['warnings'][] = ''.l10n('OAuth: You need to configure the credentials').''; } if (!function_exists('curl_init')) { $page['warnings'][] = l10n('OAuth: PHP Curl extension is needed'); } } // in case of registration aborded // DON'T WORK, because potentially executed by sub-scripts like Secureimage for Crypto Captcha // if ( script_basename() != 'register' and ($data=pwg_get_session_var('oauth_new_user')) !== null ) // { // pwg_unset_session_var('oauth_new_user'); // require_once(OAUTH_PATH . 'include/hybridauth/Hybrid/Auth.php'); // try { // $hybridauth = new Hybrid_Auth($hybridauth_conf); // $adapter = $hybridauth->getAdapter($data[0]); // $adapter->logout(); // } // catch (Exception $e) { // } // } } function oauth_admin_plugin_menu_links($menu) { $menu[] = array( 'NAME' => l10n('OAuth'), 'URL' => OAUTH_ADMIN, ); return $menu; }