r89384 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89383‎ | r89384 | r89385 >
Date:03:01, 3 June 2011
Author:demon
Status:deferred
Tags:
Comment:
Swap OpenID and OpenID.setup.php. Extension entry points should always be in the form of FooBar/FooBar.php
Modified paths:
  • /trunk/extensions/OpenID/OpenID.php (replaced) (history)
  • /trunk/extensions/OpenID/OpenID.setup.php (replaced) (history)

Diff [purge]

Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -1,329 +1,3 @@
22 <?php
3 -/**
4 - * OpenID.setup.php -- Make MediaWiki an OpenID consumer and server
5 - * Copyright 2006,2007 Internet Brands (http://www.internetbrands.com/)
6 - * Copyright 2007,2008 Evan Prodromou <evan@prodromou.name>
7 - *
8 - * This program is free software; you can redistribute it and/or modify
9 - * it under the terms of the GNU General Public License as published by
10 - * the Free Software Foundation; either version 2 of the License, or
11 - * (at your option) any later version.
12 - *
13 - * This program is distributed in the hope that it will be useful,
14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 - * GNU General Public License for more details.
17 - *
18 - * You should have received a copy of the GNU General Public License
19 - * along with this program; if not, write to the Free Software
20 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 - *
22 - * @file
23 - * @author Evan Prodromou <evan@prodromou.name>
24 - * @ingroup Extensions
25 - */
26 -
27 -if ( !defined( 'MEDIAWIKI' ) ) {
28 - exit( 1 );
29 -}
30 -
31 -define( 'MEDIAWIKI_OPENID_VERSION', '0.931-beta' );
32 -
33 -$path = dirname( __FILE__ );
34 -set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );
35 -
36 -# CONFIGURATION VARIABLES
37 -
38 -/**
39 - * Whether to hide the "Login with OpenID link" link; set to true if you already
40 - * have this link in your skin.
41 - */
42 -$wgHideOpenIDLoginLink = false;
43 -
44 -/**
45 - * Location of the OpenID login logo. You can copy this to your server if you
46 - * want.
47 - */
48 -$wgOpenIDLoginLogoUrl = $wgScriptPath . '/extensions/OpenID/skin/icons/openid-inputicon.png';
49 -
50 -/**
51 - * Whether to show the OpenID identity URL on a user's home page. Possible
52 - * values are 'always', 'never' (default), or 'user'.
53 - * 'user' lets the user decide in their preferences.
54 - */
55 -$wgOpenIDShowUrlOnUserPage = 'never';
56 -
57 -/**
58 - * These are trust roots that we don't bother asking users whether the trust
59 - * root is allowed to trust; typically for closely-linked partner sites.
60 - */
61 -$wgOpenIDServerForceAllowTrust = array();
62 -
63 -/**
64 - * Implicitly trust the e-mail address sent from the OpenID server, and don't
65 - * ask the user to verify it. This can lead to people with a nasty OpenID
66 - * provider setting up accounts and spamming
67 - */
68 -$wgOpenIDTrustEmailAddress = false;
69 -
70 -/**
71 - * Where to store transitory data.
72 - * Supported types are 'file', 'memcached', 'db'.
73 - */
74 -$wgOpenIDServerStoreType = 'file';
75 -
76 -/**
77 - * If the store type is set to 'file', this is is the name of a directory to
78 - * store the data in.
79 - */
80 -$wgOpenIDServerStorePath = "/tmp/$wgDBname/openidserver/";
81 -
82 -/**
83 - * Defines the trust root for this server
84 - * If null, we make a guess
85 - */
86 -$wgTrustRoot = null;
87 -
88 -/**
89 - * When using deny and allow arrays, defines how the security works.
90 - * If true, works like "Order Allow,Deny" in Apache; deny by default,
91 - * allow items that match allow that don't match deny to pass.
92 - * If false, works like "Order Deny,Allow" in Apache; allow by default,
93 - * deny items in deny that aren't in allow.
94 - */
95 -$wgOpenIDConsumerDenyByDefault = false;
96 -
97 -/**
98 - * Which partners to allow; regexps here. See above.
99 - */
100 -$wgOpenIDConsumerAllow = array();
101 -
102 -/**
103 - * Which partners to deny; regexps here. See above.
104 - */
105 -$wgOpenIDConsumerDeny = array();
106 -
107 -/**
108 - * Force this server to only allow authentication against one server;
109 - * hides the selection form entirely.
110 - */
111 -$wgOpenIDConsumerForce = null;
112 -
113 -/**
114 - * when creating a new account or associating an existing account with OpenID:
115 - *
116 - * the following settings allow the Wiki sysop a fine-grained tuning of
117 - * how new wiki user account names are derived from data associated with or
118 - * otherwise available from the validated OpenID identity, and/or whether or not
119 - * the free choice of the corresponding wiki user account name is allowed.
120 - */
121 -
122 -/**
123 - * whether associating an existing account with OpenID is allowed:
124 - * show a wiki account username text input and password field
125 - */
126 -$wgOpenIDAllowExistingAccountSelection = true;
127 -
128 -/**
129 - * when creating a new account with OpenID:
130 - * show users a text input field to enter an arbitrary username
131 - */
132 -$wgOpenIDAllowNewAccountname = true;
133 -
134 -/**
135 - * when creating a new account or associating an existing account with OpenID:
136 - * Use the username part left of "@" in an OpenID e-mail address as username
137 - * for account creation, or log in - if no nickname is supplied in the OpenID
138 - * SREG data set. In other words: if available, nickname takes precedence
139 - * over username from e-mail.
140 - *
141 - * Example:
142 - *
143 - * When your OpenID is http://me.yahoo.com/my.name and your e-mail address is
144 - * my.name@yahoo.com, then "my.name" will be used for account creation.
145 - *
146 - * This works well with $wgOpenIDConsumerForce where all users have a unique
147 - * e-mail address at the same domain.
148 - *
149 - * The e-mail address associated with the OpenID identity becomes
150 - * the (unconfirmed) users' wiki account e-mail address.
151 - */
152 -$wgOpenIDUseEmailAsNickname = false;
153 -
154 -/**
155 - * when creating a new account or associating an existing account with OpenID:
156 - * propose and allow new account names from OpenID SREG data such as
157 - * fullname or nickname (if such data is available)
158 - */
159 -$wgOpenIDProposeUsernameFromSREG = true;
160 -
161 -/**
162 - * when creating a new account or associating an existing account with OpenID:
163 - * propose an auto-generated fixed unique username "OpenIDUser#" (#=1, 2, ..)
164 - */
165 -$wgOpenIDAllowAutomaticUsername = true;
166 -
167 -/**
168 - * Where to store transitory data.
169 - * Supported types are 'file', 'memcached', 'db'.
170 - */
171 -$wgOpenIDConsumerStoreType = 'file';
172 -
173 -/**
174 - * If the store type is set to 'file', this is is the name of a
175 - * directory to store the data in.
176 - */
177 -$wgOpenIDConsumerStorePath = "/tmp/$wgDBname/openidconsumer/";
178 -
179 -/**
180 - * Expiration time for the OpenID cookie. Lets the user re-authenticate
181 - * automatically if their session is expired. Only really useful if
182 - * it's much greater than $wgCookieExpiration. Default: about one year.
183 - */
184 -$wgOpenIDCookieExpiration = 365 * 24 * 60 * 60;
185 -
186 -/**
187 - * Only allow login with OpenID. Careful -- this means everybody!
188 - */
189 -$wgOpenIDOnly = false;
190 -
191 -/**
192 - * If true, user accounts on this wiki *cannot* be used as OpenIDs on other
193 - * sites.
194 - */
195 -$wgOpenIDClientOnly = false;
196 -
197 -/**
198 - * Allow to use User pages as OpenIDs even if user is using OpenID already
199 - *
200 - * If true, users can use their user page URLs of this site A as OpenID
201 - * on another site B even if user is using OpenID on A already.
202 - *
203 - * Some users might want to do that for vanity purposes or whatever.
204 - *
205 - * https://bugzilla.wikimedia.org/show_bug.cgi?id=18635
206 - * If false, prevent serving OpenID accounts (TODO list item; done)
207 - *
208 - */
209 -$wgOpenIDAllowServingOpenIDUserAccounts = true;
210 -
211 -/**
212 - * When merging accounts with the UserMerge and Delete extension,
213 - * should OpenIDs associated to the "from" account automatically be associated
214 - * to the "to" account ?
215 - */
216 -$wgOpenIDMergeOnAccountMerge = false;
217 -
218 -/**
219 - * If true, will show provider icons instead of the text.
220 - */
221 -$wgOpenIDShowProviderIcons = false;
222 -
223 -# New options
224 -$wgDefaultUserOptions['openid-hide'] = 0;
225 -$wgDefaultUserOptions['openid-update-on-login-nickname'] = false;
226 -$wgDefaultUserOptions['openid-update-on-login-email'] = false;
227 -$wgDefaultUserOptions['openid-update-on-login-fullname'] = false;
228 -$wgDefaultUserOptions['openid-update-on-login-language'] = false;
229 -$wgDefaultUserOptions['openid-update-on-login-timezone'] = false;
230 -
231 -# END CONFIGURATION VARIABLES
232 -
233 -$wgExtensionCredits['other'][] = array(
234 - 'name' => 'OpenID',
235 - 'version' => MEDIAWIKI_OPENID_VERSION,
236 - 'path' => __FILE__,
237 - 'author' => array( 'Evan Prodromou', 'Sergey Chernyshev', 'Alexandre Emsenhuber', 'Thomas Gries' ),
238 - 'url' => 'http://www.mediawiki.org/wiki/Extension:OpenID',
239 - 'descriptionmsg' => 'openid-desc',
240 -);
241 -
242 -function OpenIDGetServerPath() {
243 - $rel = 'Auth/OpenID/Server.php';
244 -
245 - foreach ( explode( PATH_SEPARATOR, get_include_path() ) as $pe ) {
246 - $full = $pe . DIRECTORY_SEPARATOR . $rel;
247 - if ( file_exists( $full ) ) {
248 - return $full;
249 - }
250 - }
251 - return $rel;
252 -}
253 -
254 -$dir = $path . '/';
255 -
256 -$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
257 -$wgExtensionAliasesFiles['OpenID'] = $dir . 'OpenID.alias.php';
258 -
259 -$wgAutoloadClasses['OpenIDHooks'] = $dir . 'OpenID.hooks.php';
260 -
261 -# Autoload common parent with utility methods
262 -$wgAutoloadClasses['SpecialOpenID'] = $dir . 'SpecialOpenID.body.php';
263 -
264 -$wgAutoloadClasses['SpecialOpenIDLogin'] = $dir . 'SpecialOpenIDLogin.body.php';
265 -$wgAutoloadClasses['SpecialOpenIDConvert'] = $dir . 'SpecialOpenIDConvert.body.php';
266 -$wgAutoloadClasses['SpecialOpenIDServer'] = $dir . 'SpecialOpenIDServer.body.php';
267 -$wgAutoloadClasses['SpecialOpenIDXRDS'] = $dir . 'SpecialOpenIDXRDS.body.php';
268 -$wgAutoloadClasses['SpecialOpenIDDashboard'] = $dir . 'SpecialOpenIDDashboard.body.php';
269 -
270 -# UI class
271 -$wgAutoloadClasses['OpenIDProvider'] = $dir . 'OpenIDProvider.body.php';
272 -
273 -# Gets stored in the session, needs to be reified before our setup
274 -$wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath();
275 -
276 -$wgAutoloadClasses['MediaWikiOpenIDDatabaseConnection'] = $dir . 'DatabaseConnection.php';
277 -$wgAutoloadClasses['MediaWikiOpenIDMemcachedStore'] = $dir . 'MemcachedStore.php';
278 -
279 -$wgHooks['PersonalUrls'][] = 'OpenIDHooks::onPersonalUrls';
280 -$wgHooks['BeforePageDisplay'][] = 'OpenIDHooks::onBeforePageDisplay';
281 -$wgHooks['ArticleViewHeader'][] = 'OpenIDHooks::onArticleViewHeader';
282 -$wgHooks['SpecialPage_initList'][] = 'OpenIDHooks::onSpecialPage_initList';
283 -$wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::onLoadExtensionSchemaUpdates';
284 -
285 -$wgHooks['DeleteAccount'][] = 'OpenIDHooks::onDeleteAccount';
286 -$wgHooks['MergeAccountFromTo'][] = 'OpenIDHooks::onMergeAccountFromTo';
287 -
288 -# 1.16+
289 -$wgHooks['GetPreferences'][] = 'OpenIDHooks::onGetPreferences';
290 -
291 -# FIXME, function does not exist
292 -# $wgHooks['UserLoginForm'][] = 'OpenIDHooks::onUserLoginForm';
293 -
294 -# new user rights
295 -$wgAvailableRights[] = 'openid-dashboard-access';
296 -$wgAvailableRights[] = 'openid-dashboard-admin';
297 -
298 -# allow users to read access the dashboard
299 -$wgGroupPermissions['user']['openid-dashboard-access'] = true;
300 -
301 -# allow users to add or convert OpenIDs to their accounts
302 -$wgGroupPermissions['user']['openid-converter-access'] = true;
303 -
304 -# allow sysops to adminster the OpenID settings (under construction)
305 -$wgGroupPermissions['sysop']['openid-dashboard-admin'] = true;
306 -
307 -$myResourceTemplate = array(
308 - 'localBasePath' => $path . '/skin',
309 - 'remoteExtPath' => 'OpenID/skin',
310 - 'group' => 'ext.openid',
311 -);
312 -
313 -$wgResourceModules['ext.openid'] = $myResourceTemplate + array(
314 - 'scripts' => 'openid.js',
315 - 'dependencies' => array(
316 - 'jquery.cookie'
317 - )
318 -);
319 -$wgResourceModules['ext.openid.plain'] = $myResourceTemplate + array(
320 - 'styles' => 'openid-plain.css',
321 - 'dependencies' => array(
322 - 'ext.openid'
323 - )
324 -);
325 -$wgResourceModules['ext.openid.icons'] = $myResourceTemplate + array(
326 - 'styles' => 'openid.css',
327 - 'dependencies' => array(
328 - 'ext.openid'
329 - )
330 -);
 3+# backwards compatibility; new sites should require OpenID.php
 4+require_once( dirname( __FILE__ ) . '/OpenID.php' );
Index: trunk/extensions/OpenID/OpenID.php
@@ -1,3 +1,329 @@
22 <?php
3 -# backwards compatibility; new sites should require OpenID.setup.php
4 -require_once( dirname( __FILE__ ) . '/OpenID.setup.php' );
 3+/**
 4+ * OpenID.setup.php -- Make MediaWiki an OpenID consumer and server
 5+ * Copyright 2006,2007 Internet Brands (http://www.internetbrands.com/)
 6+ * Copyright 2007,2008 Evan Prodromou <evan@prodromou.name>
 7+ *
 8+ * This program is free software; you can redistribute it and/or modify
 9+ * it under the terms of the GNU General Public License as published by
 10+ * the Free Software Foundation; either version 2 of the License, or
 11+ * (at your option) any later version.
 12+ *
 13+ * This program is distributed in the hope that it will be useful,
 14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 16+ * GNU General Public License for more details.
 17+ *
 18+ * You should have received a copy of the GNU General Public License
 19+ * along with this program; if not, write to the Free Software
 20+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 21+ *
 22+ * @file
 23+ * @author Evan Prodromou <evan@prodromou.name>
 24+ * @ingroup Extensions
 25+ */
 26+
 27+if ( !defined( 'MEDIAWIKI' ) ) {
 28+ exit( 1 );
 29+}
 30+
 31+define( 'MEDIAWIKI_OPENID_VERSION', '0.931-beta' );
 32+
 33+$path = dirname( __FILE__ );
 34+set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );
 35+
 36+# CONFIGURATION VARIABLES
 37+
 38+/**
 39+ * Whether to hide the "Login with OpenID link" link; set to true if you already
 40+ * have this link in your skin.
 41+ */
 42+$wgHideOpenIDLoginLink = false;
 43+
 44+/**
 45+ * Location of the OpenID login logo. You can copy this to your server if you
 46+ * want.
 47+ */
 48+$wgOpenIDLoginLogoUrl = $wgScriptPath . '/extensions/OpenID/skin/icons/openid-inputicon.png';
 49+
 50+/**
 51+ * Whether to show the OpenID identity URL on a user's home page. Possible
 52+ * values are 'always', 'never' (default), or 'user'.
 53+ * 'user' lets the user decide in their preferences.
 54+ */
 55+$wgOpenIDShowUrlOnUserPage = 'never';
 56+
 57+/**
 58+ * These are trust roots that we don't bother asking users whether the trust
 59+ * root is allowed to trust; typically for closely-linked partner sites.
 60+ */
 61+$wgOpenIDServerForceAllowTrust = array();
 62+
 63+/**
 64+ * Implicitly trust the e-mail address sent from the OpenID server, and don't
 65+ * ask the user to verify it. This can lead to people with a nasty OpenID
 66+ * provider setting up accounts and spamming
 67+ */
 68+$wgOpenIDTrustEmailAddress = false;
 69+
 70+/**
 71+ * Where to store transitory data.
 72+ * Supported types are 'file', 'memcached', 'db'.
 73+ */
 74+$wgOpenIDServerStoreType = 'file';
 75+
 76+/**
 77+ * If the store type is set to 'file', this is is the name of a directory to
 78+ * store the data in.
 79+ */
 80+$wgOpenIDServerStorePath = "/tmp/$wgDBname/openidserver/";
 81+
 82+/**
 83+ * Defines the trust root for this server
 84+ * If null, we make a guess
 85+ */
 86+$wgTrustRoot = null;
 87+
 88+/**
 89+ * When using deny and allow arrays, defines how the security works.
 90+ * If true, works like "Order Allow,Deny" in Apache; deny by default,
 91+ * allow items that match allow that don't match deny to pass.
 92+ * If false, works like "Order Deny,Allow" in Apache; allow by default,
 93+ * deny items in deny that aren't in allow.
 94+ */
 95+$wgOpenIDConsumerDenyByDefault = false;
 96+
 97+/**
 98+ * Which partners to allow; regexps here. See above.
 99+ */
 100+$wgOpenIDConsumerAllow = array();
 101+
 102+/**
 103+ * Which partners to deny; regexps here. See above.
 104+ */
 105+$wgOpenIDConsumerDeny = array();
 106+
 107+/**
 108+ * Force this server to only allow authentication against one server;
 109+ * hides the selection form entirely.
 110+ */
 111+$wgOpenIDConsumerForce = null;
 112+
 113+/**
 114+ * when creating a new account or associating an existing account with OpenID:
 115+ *
 116+ * the following settings allow the Wiki sysop a fine-grained tuning of
 117+ * how new wiki user account names are derived from data associated with or
 118+ * otherwise available from the validated OpenID identity, and/or whether or not
 119+ * the free choice of the corresponding wiki user account name is allowed.
 120+ */
 121+
 122+/**
 123+ * whether associating an existing account with OpenID is allowed:
 124+ * show a wiki account username text input and password field
 125+ */
 126+$wgOpenIDAllowExistingAccountSelection = true;
 127+
 128+/**
 129+ * when creating a new account with OpenID:
 130+ * show users a text input field to enter an arbitrary username
 131+ */
 132+$wgOpenIDAllowNewAccountname = true;
 133+
 134+/**
 135+ * when creating a new account or associating an existing account with OpenID:
 136+ * Use the username part left of "@" in an OpenID e-mail address as username
 137+ * for account creation, or log in - if no nickname is supplied in the OpenID
 138+ * SREG data set. In other words: if available, nickname takes precedence
 139+ * over username from e-mail.
 140+ *
 141+ * Example:
 142+ *
 143+ * When your OpenID is http://me.yahoo.com/my.name and your e-mail address is
 144+ * my.name@yahoo.com, then "my.name" will be used for account creation.
 145+ *
 146+ * This works well with $wgOpenIDConsumerForce where all users have a unique
 147+ * e-mail address at the same domain.
 148+ *
 149+ * The e-mail address associated with the OpenID identity becomes
 150+ * the (unconfirmed) users' wiki account e-mail address.
 151+ */
 152+$wgOpenIDUseEmailAsNickname = false;
 153+
 154+/**
 155+ * when creating a new account or associating an existing account with OpenID:
 156+ * propose and allow new account names from OpenID SREG data such as
 157+ * fullname or nickname (if such data is available)
 158+ */
 159+$wgOpenIDProposeUsernameFromSREG = true;
 160+
 161+/**
 162+ * when creating a new account or associating an existing account with OpenID:
 163+ * propose an auto-generated fixed unique username "OpenIDUser#" (#=1, 2, ..)
 164+ */
 165+$wgOpenIDAllowAutomaticUsername = true;
 166+
 167+/**
 168+ * Where to store transitory data.
 169+ * Supported types are 'file', 'memcached', 'db'.
 170+ */
 171+$wgOpenIDConsumerStoreType = 'file';
 172+
 173+/**
 174+ * If the store type is set to 'file', this is is the name of a
 175+ * directory to store the data in.
 176+ */
 177+$wgOpenIDConsumerStorePath = "/tmp/$wgDBname/openidconsumer/";
 178+
 179+/**
 180+ * Expiration time for the OpenID cookie. Lets the user re-authenticate
 181+ * automatically if their session is expired. Only really useful if
 182+ * it's much greater than $wgCookieExpiration. Default: about one year.
 183+ */
 184+$wgOpenIDCookieExpiration = 365 * 24 * 60 * 60;
 185+
 186+/**
 187+ * Only allow login with OpenID. Careful -- this means everybody!
 188+ */
 189+$wgOpenIDOnly = false;
 190+
 191+/**
 192+ * If true, user accounts on this wiki *cannot* be used as OpenIDs on other
 193+ * sites.
 194+ */
 195+$wgOpenIDClientOnly = false;
 196+
 197+/**
 198+ * Allow to use User pages as OpenIDs even if user is using OpenID already
 199+ *
 200+ * If true, users can use their user page URLs of this site A as OpenID
 201+ * on another site B even if user is using OpenID on A already.
 202+ *
 203+ * Some users might want to do that for vanity purposes or whatever.
 204+ *
 205+ * https://bugzilla.wikimedia.org/show_bug.cgi?id=18635
 206+ * If false, prevent serving OpenID accounts (TODO list item; done)
 207+ *
 208+ */
 209+$wgOpenIDAllowServingOpenIDUserAccounts = true;
 210+
 211+/**
 212+ * When merging accounts with the UserMerge and Delete extension,
 213+ * should OpenIDs associated to the "from" account automatically be associated
 214+ * to the "to" account ?
 215+ */
 216+$wgOpenIDMergeOnAccountMerge = false;
 217+
 218+/**
 219+ * If true, will show provider icons instead of the text.
 220+ */
 221+$wgOpenIDShowProviderIcons = false;
 222+
 223+# New options
 224+$wgDefaultUserOptions['openid-hide'] = 0;
 225+$wgDefaultUserOptions['openid-update-on-login-nickname'] = false;
 226+$wgDefaultUserOptions['openid-update-on-login-email'] = false;
 227+$wgDefaultUserOptions['openid-update-on-login-fullname'] = false;
 228+$wgDefaultUserOptions['openid-update-on-login-language'] = false;
 229+$wgDefaultUserOptions['openid-update-on-login-timezone'] = false;
 230+
 231+# END CONFIGURATION VARIABLES
 232+
 233+$wgExtensionCredits['other'][] = array(
 234+ 'name' => 'OpenID',
 235+ 'version' => MEDIAWIKI_OPENID_VERSION,
 236+ 'path' => __FILE__,
 237+ 'author' => array( 'Evan Prodromou', 'Sergey Chernyshev', 'Alexandre Emsenhuber', 'Thomas Gries' ),
 238+ 'url' => 'http://www.mediawiki.org/wiki/Extension:OpenID',
 239+ 'descriptionmsg' => 'openid-desc',
 240+);
 241+
 242+function OpenIDGetServerPath() {
 243+ $rel = 'Auth/OpenID/Server.php';
 244+
 245+ foreach ( explode( PATH_SEPARATOR, get_include_path() ) as $pe ) {
 246+ $full = $pe . DIRECTORY_SEPARATOR . $rel;
 247+ if ( file_exists( $full ) ) {
 248+ return $full;
 249+ }
 250+ }
 251+ return $rel;
 252+}
 253+
 254+$dir = $path . '/';
 255+
 256+$wgExtensionMessagesFiles['OpenID'] = $dir . 'OpenID.i18n.php';
 257+$wgExtensionAliasesFiles['OpenID'] = $dir . 'OpenID.alias.php';
 258+
 259+$wgAutoloadClasses['OpenIDHooks'] = $dir . 'OpenID.hooks.php';
 260+
 261+# Autoload common parent with utility methods
 262+$wgAutoloadClasses['SpecialOpenID'] = $dir . 'SpecialOpenID.body.php';
 263+
 264+$wgAutoloadClasses['SpecialOpenIDLogin'] = $dir . 'SpecialOpenIDLogin.body.php';
 265+$wgAutoloadClasses['SpecialOpenIDConvert'] = $dir . 'SpecialOpenIDConvert.body.php';
 266+$wgAutoloadClasses['SpecialOpenIDServer'] = $dir . 'SpecialOpenIDServer.body.php';
 267+$wgAutoloadClasses['SpecialOpenIDXRDS'] = $dir . 'SpecialOpenIDXRDS.body.php';
 268+$wgAutoloadClasses['SpecialOpenIDDashboard'] = $dir . 'SpecialOpenIDDashboard.body.php';
 269+
 270+# UI class
 271+$wgAutoloadClasses['OpenIDProvider'] = $dir . 'OpenIDProvider.body.php';
 272+
 273+# Gets stored in the session, needs to be reified before our setup
 274+$wgAutoloadClasses['Auth_OpenID_CheckIDRequest'] = OpenIDGetServerPath();
 275+
 276+$wgAutoloadClasses['MediaWikiOpenIDDatabaseConnection'] = $dir . 'DatabaseConnection.php';
 277+$wgAutoloadClasses['MediaWikiOpenIDMemcachedStore'] = $dir . 'MemcachedStore.php';
 278+
 279+$wgHooks['PersonalUrls'][] = 'OpenIDHooks::onPersonalUrls';
 280+$wgHooks['BeforePageDisplay'][] = 'OpenIDHooks::onBeforePageDisplay';
 281+$wgHooks['ArticleViewHeader'][] = 'OpenIDHooks::onArticleViewHeader';
 282+$wgHooks['SpecialPage_initList'][] = 'OpenIDHooks::onSpecialPage_initList';
 283+$wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::onLoadExtensionSchemaUpdates';
 284+
 285+$wgHooks['DeleteAccount'][] = 'OpenIDHooks::onDeleteAccount';
 286+$wgHooks['MergeAccountFromTo'][] = 'OpenIDHooks::onMergeAccountFromTo';
 287+
 288+# 1.16+
 289+$wgHooks['GetPreferences'][] = 'OpenIDHooks::onGetPreferences';
 290+
 291+# FIXME, function does not exist
 292+# $wgHooks['UserLoginForm'][] = 'OpenIDHooks::onUserLoginForm';
 293+
 294+# new user rights
 295+$wgAvailableRights[] = 'openid-dashboard-access';
 296+$wgAvailableRights[] = 'openid-dashboard-admin';
 297+
 298+# allow users to read access the dashboard
 299+$wgGroupPermissions['user']['openid-dashboard-access'] = true;
 300+
 301+# allow users to add or convert OpenIDs to their accounts
 302+$wgGroupPermissions['user']['openid-converter-access'] = true;
 303+
 304+# allow sysops to adminster the OpenID settings (under construction)
 305+$wgGroupPermissions['sysop']['openid-dashboard-admin'] = true;
 306+
 307+$myResourceTemplate = array(
 308+ 'localBasePath' => $path . '/skin',
 309+ 'remoteExtPath' => 'OpenID/skin',
 310+ 'group' => 'ext.openid',
 311+);
 312+
 313+$wgResourceModules['ext.openid'] = $myResourceTemplate + array(
 314+ 'scripts' => 'openid.js',
 315+ 'dependencies' => array(
 316+ 'jquery.cookie'
 317+ )
 318+);
 319+$wgResourceModules['ext.openid.plain'] = $myResourceTemplate + array(
 320+ 'styles' => 'openid-plain.css',
 321+ 'dependencies' => array(
 322+ 'ext.openid'
 323+ )
 324+);
 325+$wgResourceModules['ext.openid.icons'] = $myResourceTemplate + array(
 326+ 'styles' => 'openid.css',
 327+ 'dependencies' => array(
 328+ 'ext.openid'
 329+ )
 330+);

Follow-up revisions

RevisionCommit summaryAuthorDate
r89385Followup r89384: filename changedemon03:02, 3 June 2011

Status & tagging log