/** * Get the url pointing to the wiki. That means including * subdirectories, eg. http://sub.domain.com/wiki * @return string wikiURL */ static function getWikiURL() { global $wgScriptPath; $t_scriptPath = trim($wgScriptPath, '/ '); $linkHome = WebFunctions::getBaseURL() . '/' . $t_scriptPath; $linkHome = trim($linkHome, '/ '); return $linkHome; }
* 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. */ global $authData; // make auth data available for the methodSetupFile /* * GENERAL NOTES * ============= * * * * SIMPLE SAML PHP * --------------- * When using SimpleSamlPHP for authentication -- aside from other configuration -- * you have to make sure to change the SimpleSamlPHP's session.phpsession.cookiename * parameter in config/config.php to match the cookiename of your MW installation. * Otherwise you will get problems with lost state information in SimpleSamlPHP. * * The necessary changes are around line 204 in the config/config.php file: * * 'session.phpsession.cookiename' => 'test_mw_1_18_0_session', <-- this needs to be changed * 'session.phpsession.savepath' => null, * 'session.phpsession.httponly' => FALSE, * */ /* ******************************************** * METHODS * ******************************************** */ $config['methods'] = array('shibboleth-default' => array('auth' => array('lib' => 'shibboleth'), 'login' => array('text' => 'Login (SSO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login?target={RETURN_URL}'), 'logout' => array('text' => 'Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail']), 'requirements' => array('email' => '*')), 'simplesamlphp-default' => array('auth' => array('lib' => 'simplesamlphp', 'idpentityid' => 'localhost-idp'), 'login' => array('text' => 'Login (SSO)'), 'logout' => array('text' => 'Logout (SLO)'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail']), 'requirements' => array('email' => '*')), 'sample-shibboleth-default' => array('config' => array('lib' => 'shibboleth'), 'login' => array('text' => 'SAMPLE - Login via Shibboleth SP default target', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-shibboleth-restricted' => array('config' => array('lib' => 'shibboleth'), 'login' => array('text' => 'SAMPLE - Login via Shibboleth SP default target with requirements', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail']), 'requirements' => array('email' => '*', 'entitlement' => 'rrze_wiki')), 'sample-shibboleth-someApp' => array('config' => array('lib' => 'shibboleth'), 'login' => array('text' => 'SAMPLE - Login via Shibboleth SP someApp target', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login/someApp?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-shibboleth-someApp-strict' => array('config' => array('lib' => 'shibboleth', 'mode' => 'strict', 'strictLogoutTarget' => 'https://www.sso.uni-erlangen.de/logout.html'), 'login' => array('text' => 'SAMPLE - Login via Shibboleth SP someApp target', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login/someApp?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-simplesamlphp-default' => array('config' => array('lib' => 'simplesamlphp'), 'login' => array('text' => 'Login (SSO)'), 'logout' => array('text' => 'Logout (SLO)'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-simplesamlphp-someIdP' => array('config' => array('lib' => 'simplesamlphp', 'idpentityid' => 'someIdP'), 'login' => array('text' => 'Login (SSO)'), 'logout' => array('text' => 'Logout (SLO)'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail']), 'requirements' => array('email' => '*')));
<?php /* * This file is part of the MediaWiki MultiAuth extension. * Copyright 2009, RRZE, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * 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. */ global $authData; // make auth data available for the methodSetupFile /* ******************************************** * METHODS * ******************************************** */ $config['methods'] = array('local' => array('login' => array('text' => 'Login (local)', 'href' => SpecialPage::getTitleFor('Userlogin')->escapeFullURL()), 'logout' => array('text' => 'Logout (local)', 'href' => SpecialPage::getTitleFor('Userlogout')->escapeFullURL()), 'attributes' => array()), 'shibboleth-default' => array('login' => array('text' => 'Login (SSO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login?target={RETURN_URL}'), 'logout' => array('text' => 'Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail']), 'requirements' => array('email' => '*')), 'sample-shibboleth-default' => array('login' => array('text' => 'SAMPLE - Login via Shibboleth SP default target', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-shibboleth-restricted' => array('login' => array('text' => 'SAMPLE - Login via Shibboleth SP default target with requirements', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail']), 'requirements' => array('email' => '*', 'entitlement' => 'rrze_wiki')), 'sample-shibboleth-someApp' => array('login' => array('text' => 'SAMPLE - Login via Shibboleth SP someApp target', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Login/someApp?target={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/Shibboleth.sso/Logout?return={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-simplesamlphp-default' => array('login' => array('text' => 'SAMPLE - Login via SimpleSamlPHP SP default target', 'href' => WebFunctions::getBaseURL() . '/simplesaml/saml2/sp/initSSO.php?RelayState={RETURN_URL}'), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/simplesaml/saml2/sp/initSLO.php?RelayState={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])), 'sample-simplesamlphp-someIdP' => array('login' => array('text' => 'SAMPLE - Login via SimpleSamlPHP SP someIdP target', 'href' => WebFunctions::getBaseURL() . '/simplesaml/saml2/sp/initSSO.php?RelayState={RETURN_URL}&idpentityid=' . wfUrlencode('someIdP')), 'logout' => array('text' => 'SAMPLE - Logout (SLO)', 'href' => WebFunctions::getBaseURL() . '/simplesaml/saml2/sp/initSLO.php?RelayState={RETURN_URL}'), 'attributes' => array('username' => ucfirst($authData['uid']), 'fullname' => $authData['cn'], 'email' => $authData['mail'])));