private static function getVersionParts() { if (is_null(self::$chachedMwVersionParts)) { global $wgVersion; // wfDebugLog('MultiAuthPlugin', __METHOD__ . ': ' . "Detected MW " . $wgVersion); $parts = explode('.', $wgVersion); $major = intval($parts[0]); $minor = intval($parts[1]); $patch = intval($parts[2]); wfDebugLog('MultiAuthPlugin', __METHOD__ . ': ' . "Detected MW version: major {$major}, minor {$minor}, patch {$patch}"); self::$chachedMwVersionParts = array('major' => $major, 'minor' => $minor, 'patch' => $patch); } return self::$chachedMwVersionParts; }
function multiAuthLoginSetup() { global $wgExtensionMessagesFiles; global $wgExtensionCredits; global $wgExtensionAliasesFiles; global $wgMultiAuthPlugin; // localization $wgExtensionMessagesFiles['MultiAuthSpecialLogin'] = dirname(__FILE__) . '/SpecialLogin.i18n.php'; if (function_exists('wfLoadExtensionMessages')) { wfLoadExtensionMessages('MultiAuthSpecialLogin'); } // pre 1.18.0 // if (MwFunctions::testVersionGEq(1,18)) // MwFunctions::updateMessageCache(); // Hack for post 1.18.0 // aliases if (!MwFunctions::testVersionGEq(1, 18)) { $wgExtensionAliasesFiles['MultiAuthSpecialLogin'] = dirname(__FILE__) . '/SpecialLogin.alias.php'; } $wgExtensionCredits['specialpage']['MultiAuthSpecialLogin'] = array('path' => __FILE__, 'version' => $wgMultiAuthPlugin->getVersion(), 'url' => $wgMultiAuthPlugin->getURL()); }
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. If not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA, or see the FSF site: http://www.fsf.org. */ // Check to make sure we're actually in MediaWiki. if (!defined('MEDIAWIKI')) { die('This file is part of MediaWiki. It is not a valid entry point.'); } /* ******************************************** * INCLUDES * ******************************************** */ require_once "includes/WebFunctions.php"; require_once "includes/MwFunctions.php"; if (!MwFunctions::isAsyncLoadRequest()) { // DON'T DO ANYTHING IF THIS IS A REQUEST TO LOAD.PHP /* ******************************************** * PLUGIN SETUP * ******************************************** */ require_once "MultiAuthPlugin.setup.php"; // DEBUG // MAKE SURE THIS IS COMMENTED OUT IN PRODUCTION !!! //$wgDebugLogFile = "debug.log"; // activate MW's logging mechanism //print_r($GLOBALS); //$wgShowExceptionDetails = true; //error_reporting (E_ALL); ini_set("display_errors", 1); //echo "<!--"; print_r($_SERVER); print_r($_COOKIE); print_r($_REQUEST); (isset($_SESSION)?print_r($_SESSION):''); echo "--> <b>DEBUGGING ENABLED</b>"; // MAKE SURE THIS IS COMMENTED OUT IN PRODUCTION !!! }
function deferredMultiAuthSetup() { /******************************************** * HOOKS SETUP * ********************************************/ global $wgHooks; global $wgMultiAuthPlugin; /* * Hook for adding/modifying the URLs contained in the personal URL bar */ $wgHooks['PersonalUrls'][] = array(&$wgMultiAuthPlugin, 'addLinkHook'); /* * User authentication hook * * This is not really perfect but the best place mediwiki provides to hook * in the user instantiation/authentication process. */ $wgHooks['UserLoadFromSession'][] = array(&$wgMultiAuthPlugin, 'userLoadFromSessionHook'); /* * Hook to place own data in the session managed by mediawiki. * This is called every time $wgUser->setCookies() is called. */ $wgHooks['UserSetCookies'][] = array(&$wgMultiAuthPlugin, 'userSetCookiesHook'); /* * Hook to manage logout of a user properly (e.g. clear own session data) * This is called every time $wgUser->logout() is called. */ $wgHooks['UserLogout'][] = array(&$wgMultiAuthPlugin, 'userLogoutHook'); /* * Hook to modify aliases of special pages. * This is used to replace the regular login page with the MultiAuth login * page. */ $wgHooks['LanguageGetSpecialPageAliases'][] = array(&$wgMultiAuthPlugin, 'filterSpecialPageAliasesHook'); /* * Hook to modify URLs returned by calls to the getLocalURL method. * INFO: This is here for testing purposes. */ //$wgHooks['GetLocalURL'][] = array(&$wgMultiAuthPlugin, 'getLocalURLHook'); /******************************************** * LOCALISATION SETUP * ********************************************/ global $wgExtensionMessagesFiles; $wgExtensionMessagesFiles['MultiAuthPlugin'] = dirname(__FILE__) . '/MultiAuthPlugin.i18n.php'; if (function_exists('wfLoadExtensionMessages')) { wfLoadExtensionMessages('MultiAuthPlugin'); } // pre 1.18.0 if (MwFunctions::testVersionGEq(1, 18)) { MwFunctions::updateMessageCache(); } // Hack for post 1.18.0 /******************************************** * CREDITS * ********************************************/ global $wgExtensionCredits; $wgExtensionCredits['other'][] = array('path' => __FILE__, 'name' => wfMsg('multiauth-credits_name'), 'version' => $wgMultiAuthPlugin->getVersion(), 'author' => wfMsg('multiauth-credits_author'), 'url' => $wgMultiAuthPlugin->getURL(), 'description' => wfMsg('multiauth-credits_description')); // Hack to reduce the updateMessageCache() calls to 1 // TODO cleanly implement localisation! $wgExtensionCredits['specialpage']['MultiAuthSpecialLogin'] = array_merge($wgExtensionCredits['specialpage']['MultiAuthSpecialLogin'], array('name' => wfMsg('multiauthspeciallogin-credits_name'), 'author' => wfMsg('multiauthspeciallogin-credits_author'), 'description' => wfMsg('multiauthspeciallogin-credits_description'))); $wgExtensionCredits['specialpage']['MultiAuthSpecialLogout'] = array_merge($wgExtensionCredits['specialpage']['MultiAuthSpecialLogout'], array('name' => wfMsg('multiauthspeciallogout-credits_name'), 'author' => wfMsg('multiauthspeciallogout-credits_author'), 'description' => wfMsg('multiauthspeciallogout-credits_description'))); return true; }
* distribution for a full listing of individual contributors. * * This is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. If not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA, or see the FSF site: http://www.fsf.org. */ // Check to make sure we're actually in MediaWiki. if (!defined('MEDIAWIKI')) { die('This file is part of MediaWiki. It is not a valid entry point.'); } /** * Internationalisation file for MultiAuthSpecial */ $messages = array(); $messages['de'] = array('multiauthspeciallogin' => 'MultiAuth Anmeldeseite', 'multiauthspeciallogin-credits_name' => 'MultiAuth Anmeldeseite', 'multiauthspeciallogin-credits_author' => 'Regionales Rechenzentrum Erlangen (RRZE), Florian Löffler', 'multiauthspeciallogin-credits_description' => 'Login Spezialseite als Teil der Multi Authentifizierungserweiterung', 'multiauthspeciallogin-msg_loginSuccess' => 'Erfolgreich eingeloggt!', 'multiauthspeciallogin-msg_notAuthorized' => 'Erfolgreiche externe Authentifizierung.<br/>Sie besitzen jedoch leider keine Zugriffsberechtigung für dieses Wiki!'); $messages['en'] = array('multiauthspeciallogin' => 'MultiAuth login page', 'multiauthspeciallogin-credits_name' => 'MultiAuth login page', 'multiauthspeciallogin-credits_author' => 'Regional Computing Centre Erlangen (RRZE), Florian Löffler', 'multiauthspeciallogin-credits_description' => 'Login special page as part of the Multi Authentication Plugin', 'multiauthspeciallogin-msg_loginSuccess' => 'Successfully logged in!', 'multiauthspeciallogin-msg_notAuthorized' => 'Successful external authentication.<br/>Unfortunately you do not have the necessary rights to access this wiki.'); if (MwFunctions::testVersionGEq(1, 18)) { include dirname(__FILE__) . '/SpecialLogin.alias.php'; } // Hack for post 1.18.0