/** * Get the url pointing to the wiki's index file. In short: The main page * for this wiki, eg. http://sub.domain.com/wiki/index.php * @return string homeURL */ static function getHomeURL() { global $wgScriptExtension; $linkHome = WebFunctions::getWikiURL() . '/index' . $wgScriptExtension; return $linkHome; }
<?php include_once "../model/TrainerModel.php"; include_once "../model/ProjectModel.php"; include_once "../model/TeamModel.php"; include_once "../model/WebFunctions.php"; require_once "../model/AuthenticateSession.php"; // TODO repair pagination $projectPerPage = 4; $content = ""; $trainer_id = $_GET['trainer_id']; $trainer_name = TrainerModel::getTrainer($trainer_id); $totalNumberOfProjects = count(ProjectModel::getTrainerProjects($trainer_id)); $totalNumberOfPages = ceil($totalNumberOfProjects / $projectPerPage); $currentPage = isset($_GET['current_page']) ? (int) $_GET['current_page'] : 1; $startPage = ($currentPage - 1) * $projectPerPage; // set content $listOfProjects = ProjectModel::getTrainerProjectsLimit($trainer_id, $startPage, $projectPerPage); $content = ""; if (count($listOfProjects) == 0) { $content .= " <div class=\"row text-center\">\r\n <div class=\"col-lg-12\">\r\n <p>No projects created</p>\r\n </div>\r\n </div>"; } else { foreach ($listOfProjects as $proj) { $content .= "<div class=\"col-md-3 portfolio-item\">\r\n <a href=\"project-id-" . $proj['project_id'] . "\">\r\n <img class=\"img-responsive\" src=\"images/project.png\" alt=\"\">\r\n </a>\r\n <p style='text-align: center'>\"" . $proj['title'] . "</p>\r\n </div>"; } } $pagination = WebFunctions::pagination($currentPage, $totalNumberOfPages); include_once "../view/profile-trainer.php";
* 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'])));