-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSimpleSamlAuth.php
72 lines (63 loc) · 2.56 KB
/
SimpleSamlAuth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* SimpleSamlAuth - LGPL 3.0 licensed
* Copyright (C) 2015 Jørn Åne
*
* SAML authentication MediaWiki extension using SimpleSAMLphp.
*
* @file
* @ingroup Extensions
* @defgroup SimpleSamlAuth
*
* @link https://www.mediawiki.org/wiki/Extension:SimpleSamlAuth Documentation
* @link https://www.mediawiki.org/wiki/Extension_talk:SimpleSamlAuth Support
* @link https://github.com/jornane/mwSimpleSamlAuth Source Code
*
* @license http://www.gnu.org/licenses/lgpl.html LGPL (GNU Lesser General Public License)
* @copyright (C) 2015, Jørn Åne
* @author Jørn Åne
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die( "This is a MediaWiki extension, and must be run from within MediaWiki.\n" );
}
$GLOBALS['wgExtensionMessagesFiles']['SimpleSamlAuth'] =
__DIR__ . DIRECTORY_SEPARATOR . 'SimpleSamlAuth.i18n.php';
$GLOBALS['wgAutoloadClasses']['SimpleSamlAuth'] =
__DIR__ . DIRECTORY_SEPARATOR . 'SimpleSamlAuth.class.php';
$GLOBALS['wgExtensionCredits']['other'][] = array(
'path' => __FILE__,
'name' => 'SimpleSamlAuth',
'version' => 'GIT-master',
'author' => 'Jørn Åne',
'url' => 'https://www.mediawiki.org/wiki/Extension:SimpleSamlAuth',
'license-name' => 'LGPL-3.0+',
'descriptionmsg' => 'simplesamlauth-desc'
);
$GLOBALS['wgHooks']['UserLoadFromSession'][] = 'SimpleSamlAuth::hookLoadSession';
$GLOBALS['wgHooks']['GetPreferences'][] = 'SimpleSamlAuth::hookGetPreferences';
$GLOBALS['wgHooks']['SpecialPage_initList'][] = 'SimpleSamlAuth::hookSpecialPage_initList';
$GLOBALS['wgHooks']['UserLoginForm'][] = 'SimpleSamlAuth::hookLoginForm';
$GLOBALS['wgHooks']['UserLogoutComplete'][] = 'SimpleSamlAuth::hookUserLogout';
$GLOBALS['wgHooks']['PersonalUrls'][] = 'SimpleSamlAuth::hookPersonalUrls';
$GLOBALS['wgHooks']['MediaWikiPerformAction'][] = 'SimpleSamlAuth::hookMediaWikiPerformAction';
$GLOBALS['wgHooks']['ArticleFromTitle'][] = 'SimpleSamlAuth::hookArticleFromTitle';
define( 'SAML_OPTIONAL', 0 );
define( 'SAML_LOGIN_ONLY', 1 );
define( 'SAML_REQUIRED', 2 );
$GLOBALS['wgSamlRequirement'] = SAML_OPTIONAL;
$GLOBALS['wgSamlCreateUser'] = false;
$GLOBALS['wgSamlConfirmMail'] = false;
$GLOBALS['wgSamlAuthSource'] = 'default-sp';
$GLOBALS['wgSamlSspRoot'] = rtrim( __DIR__, DIRECTORY_SEPARATOR )
. DIRECTORY_SEPARATOR
. 'simplesamlphp'
. DIRECTORY_SEPARATOR;
$GLOBALS['wgSamlPostLogoutRedirect'] = null;
$GLOBALS['wgSamlGroupMap'] = array(
'sysop' => array(
'groups' => array( 'admin' ),
),
);
$GLOBALS['wgSamlUsernameAttr'] = 'uid';
$GLOBALS['wgSamlRealnameAttr'] = 'cn';
$GLOBALS['wgSamlMailAttr'] = 'mail';