~ubuntu-branches/ubuntu/precise/mediawiki-extensions/precise

« back to all changes in this revision

Viewing changes to dist/mediawiki-extensions-openid/usr/share/mediawiki-extensions/openid/OpenID.setup.php

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis
  • Date: 2010-05-04 15:13:35 UTC
  • mfrom: (0.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100504151335-54qeucg3ec108q28
Tags: 2.2
* Added Replaces:/Conflicts: to allow a proper upgrade.
Closes: #580066
* Fixed package descriptions.
Closes: #579667
* Patched mediawiki-extensions-fckeditor to make it work with
  php 5.3. The fix may not be perfect but at least it work.
  Not closing the bug (#579822) for now..

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * OpenID.setup.php -- Make MediaWiki an OpenID consumer and server
 
4
 * Copyright 2006,2007 Internet Brands (http://www.internetbrands.com/)
 
5
 * Copyright 2007,2008 Evan Prodromou <evan@prodromou.name>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 *
 
21
 * @author Evan Prodromou <evan@prodromou.name>
 
22
 * @addtogroup Extensions
 
23
 */
 
24
 
 
25
if (!defined('MEDIAWIKI')) {
 
26
        exit( 1 );
 
27
}
 
28
 
 
29
define('MEDIAWIKI_OPENID_VERSION', '0.8.4dev');
 
30
 
 
31
# CONFIGURATION VARIABLES
 
32
 
 
33
# Whether to hide the "Login with OpenID link" link; set to true if you already have this link in your skin.
 
34
 
 
35
$wgHideOpenIDLoginLink = false;
 
36
 
 
37
# Location of the OpenID login logo. You can copy this to your server if you want.
 
38
 
 
39
$wgOpenIDLoginLogoUrl = 'http://www.openid.net/login-bg.gif';
 
40
 
 
41
# Whether to show the OpenID identity URL on a user's home page. Possible values are 'always', 'never', or 'user'
 
42
# 'user' lets the user decide.
 
43
 
 
44
$wgOpenIDShowUrlOnUserPage = 'user';
 
45
 
 
46
# These are trust roots that we don't bother asking users
 
47
# whether the trust root is allowed to trust; typically
 
48
# for closely-linked partner sites.
 
49
 
 
50
$wgOpenIDServerForceAllowTrust = array();
 
51
 
 
52
# Where to store transitory data. Only supported type is 'file'.
 
53
 
 
54
$wgOpenIDServerStoreType = 'file';
 
55
 
 
56
# If the store type is set to 'file', this is is the name of a
 
57
# directory to store the data in.
 
58
 
 
59
$wgOpenIDServerStorePath = "/tmp/$wgDBname/openidserver/";
 
60
 
 
61
# Defines the trust root for this server
 
62
# If null, we make a guess
 
63
 
 
64
$wgTrustRoot = null;
 
65
 
 
66
# When using deny and allow arrays, defines how the security works.
 
67
# If true, works like "Order Allow,Deny" in Apache; deny by default,
 
68
# allow items that match allow that don't match deny to pass.
 
69
# If false, works like "Order Deny,Allow" in Apache; allow by default,
 
70
# deny items in deny that aren't in allow.
 
71
 
 
72
$wgOpenIDConsumerDenyByDefault = false;
 
73
 
 
74
# Which partners to allow; regexps here. See above.
 
75
 
 
76
$wgOpenIDConsumerAllow = array();
 
77
 
 
78
# Which partners to deny; regexps here. See above.
 
79
 
 
80
$wgOpenIDConsumerDeny = array();
 
81
 
 
82
# Where to store transitory data. Only supported type is 'file'.
 
83
 
 
84
$wgOpenIDConsumerStoreType = 'file';
 
85
 
 
86
# If the store type is set to 'file', this is is the name of a
 
87
# directory to store the data in.
 
88
 
 
89
$wgOpenIDConsumerStorePath = "/tmp/$wgDBname/openidconsumer/";
 
90
 
 
91
# Expiration time for the OpenID cookie. Lets the user re-authenticate
 
92
# automatically if their session is expired. Only really useful if
 
93
# it's much greater than $wgCookieExpiration. Default: about one year.
 
94
 
 
95
$wgOpenIDCookieExpiration = 365 * 24 * 60 * 60;
 
96
 
 
97
# Only allow login with OpenID. Careful -- this means everybody!
 
98
 
 
99
$wgOpenIDOnly = false;
 
100
 
 
101
# If true, user accounts on this wiki *cannot* be used as
 
102
# OpenIDs on other sites.
 
103
 
 
104
$wgOpenIDClientOnly = false;
 
105
 
 
106
# END CONFIGURATION VARIABLES
 
107
 
 
108
$wgExtensionCredits['other'][] = array(
 
109
        'name' => 'OpenID',
 
110
        'version' => MEDIAWIKI_OPENID_VERSION,
 
111
        'author' => 'Evan Prodromou',
 
112
        'url' => 'http://www.mediawiki.org/wiki/Extension:OpenID',
 
113
        'description' => 'Lets users login to the wiki with an [http://openid.net/ OpenID] and login to other OpenID-aware Web sites with their wiki user account',
 
114
        'descriptiomsg' => 'openid-desc',
 
115
);
 
116
 
 
117
function OpenIDGetServerPath() {
 
118
        $rel = 'Auth/OpenID/Server.php';
 
119
 
 
120
        foreach ( explode( PATH_SEPARATOR, get_include_path() ) as $pe ) {
 
121
                $full = $pe . DIRECTORY_SEPARATOR . $rel;
 
122
                if ( file_exists( $full ) ) {
 
123
                        return $full;
 
124
                }
 
125
        }
 
126
        return $rel;
 
127
}
 
128
 
 
129
$dir = dirname( __FILE__ ) . '/';
 
130
$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
 
131
$wgExtensionAliasesFiles['OpenID'] = $dir . 'OpenID.alias.php';
 
132
 
 
133
$wgAutoloadClasses['OpenIDHooks'] = $dir . 'OpenID.hooks.php';
 
134
 
 
135
# Autoload common parent with utility methods
 
136
$wgAutoloadClasses['SpecialOpenID'] = $dir . 'SpecialOpenID.body.php';
 
137
 
 
138
$wgAutoloadClasses['SpecialOpenIDLogin'] = $dir . 'SpecialOpenIDLogin.body.php';
 
139
$wgAutoloadClasses['SpecialOpenIDFinish'] = $dir . 'SpecialOpenIDFinish.body.php';
 
140
$wgAutoloadClasses['SpecialOpenIDConvert'] = $dir . 'SpecialOpenIDConvert.body.php';
 
141
$wgAutoloadClasses['SpecialOpenIDServer'] = $dir . 'SpecialOpenIDServer.body.php';
 
142
$wgAutoloadClasses['SpecialOpenIDXRDS'] = $dir . 'SpecialOpenIDXRDS.body.php';
 
143
 
 
144
# Gets stored in the session, needs to be reified before our setup
 
145
$wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath();
 
146
 
 
147
$wgHooks['PersonalUrls'][] = 'OpenIDHooks::onPersonalUrls';
 
148
$wgHooks['ArticleViewHeader'][] = 'OpenIDHooks::onArticleViewHeader';
 
149
$wgHooks['SpecialPage_initList'][] = 'OpenIDHooks::onSpecialPage_initList';
 
150
$wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::onLoadExtensionSchemaUpdates';
 
151
$wgHooks['RenderPreferencesForm'][] = 'OpenIDHooks::onRenderPreferencesForm';
 
152
$wgHooks['InitPreferencesForm'][] = 'OpenIDHooks::onInitPreferencesForm';
 
153
$wgHooks['ResetPreferences'][] = 'OpenIDHooks::onResetPreferences';
 
154
$wgHooks['SavePreferences'][] = 'OpenIDHooks::onSavePreferences';