r88275 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88274‎ | r88275 | r88276 >
Date:22:34, 16 May 2011
Author:wikinaut
Status:deferred
Tags:
Comment:
when first logging in with OpenID, determines whether 'select an existing account' is offered
Modified paths:
  • /trunk/extensions/OpenID/OpenID.setup.php (modified) (history)
  • /trunk/extensions/OpenID/README.OpenID-mediawiki-extension (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDLogin.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension
@@ -279,10 +279,14 @@
280280 defaults to true; when first-time logging in with OpenID, propose and
281281 allow new account names from OpenID SREG data such as fullname or nickname
282282
283 -* $wgOpenIDAllowManualUsername
 283+* $wgOpenIDAllowNewAccountname
284284 defaults to true; when first-time logging in with OpenID, show option
285 - to enter and to allow a manually chosen username
 285+ to enter and to allow a manually chosen username for a new wiki account
286286
 287+* $wgOpenIDAllowExistingAccountSelection
 288+ defaults to true; whether associating an existing account with OpenID is
 289+ allowed
 290+
287291 * $wgOpenIDAllowAutomaticUsername
288292 defaults to true; when first-time logging in with OpenID, show option
289293 to choose and to allow an automatically generated username
@@ -349,6 +353,7 @@
350354 on other sites.
351355
352356 Remark:
 357+
353358 User page urls can (currently) only act as OpenID if the user page really
354359 exists i.e. has content. The mere existence of a user account is (currently)
355360 not sufficient.
Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php
@@ -166,8 +166,8 @@
167167 * @param $messagekey String or null: message name to display at the top
168168 */
169169 function chooseNameForm( $openid, $sreg, $ax, $messagekey = null ) {
170 - global $wgOut, $wgOpenIDOnly, $wgAllowRealName, $wgUser;
171 - global $wgOpenIDProposeUsernameFromSREG, $wgOpenIDAllowAutomaticUsername, $wgOpenIDAllowManualUsername;
 170+ global $wgOut, $wgOpenIDAllowExistingAccountSelection, $wgAllowRealName, $wgUser;
 171+ global $wgOpenIDProposeUsernameFromSREG, $wgOpenIDAllowAutomaticUsername, $wgOpenIDAllowNewAccountname;
172172
173173 if ( $messagekey ) {
174174 $wgOut->addWikiMsg( $messagekey );
@@ -182,7 +182,7 @@
183183 );
184184 $def = false;
185185
186 - if ( !$wgOpenIDOnly ) {
 186+ if ( $wgOpenIDAllowExistingAccountSelection ) {
187187 # Let them attach it to an existing user
188188
189189 # Grab the UserName in the cookie if it exists
@@ -237,7 +237,7 @@
238238 Xml::closeElement( 'tr' ) . "\n"
239239 );
240240 $def = true;
241 - } // !$wgOpenIDOnly
 241+ } // $wgOpenIDAllowExistingAccountSelection
242242
243243 # These are only available if all visitors are allowed to create accounts
244244 if ( $wgUser->isAllowed( 'createaccount' ) && !$wgUser->isBlockedFromCreateAccount() ) {
@@ -311,7 +311,7 @@
312312 );
313313 }
314314
315 - if ($wgOpenIDAllowManualUsername) {
 315+ if ($wgOpenIDAllowNewAccountname) {
316316 $wgOut->addHTML(
317317
318318 Xml::openElement( 'tr' ) .
@@ -663,7 +663,7 @@
664664 # ----------------------------
665665
666666 function getUserName( $openid, $sreg, $ax, $choice, $nameValue ) {
667 - global $wgOpenIDAllowAutomaticUsername, $wgOpenIDAllowManualUsername, $wgOpenIDProposeUsernameFromSREG;
 667+ global $wgOpenIDAllowAutomaticUsername, $wgOpenIDAllowNewAccountname, $wgOpenIDProposeUsernameFromSREG;
668668
669669 switch ( $choice ) {
670670 case 'nick':
@@ -689,7 +689,7 @@
690690 if ($wgOpenIDAllowAutomaticUsername) return $this->automaticName( $sreg );
691691 break;
692692 case 'manual':
693 - if ($wgOpenIDAllowManualUsername) return $nameValue;
 693+ if ($wgOpenIDAllowNewAccountname) return $nameValue;
694694 default:
695695 return null;
696696 }
Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -115,13 +115,18 @@
116116 */
117117
118118 /**
119 - * when creating a new account or associating an existing account with OpenID:
120 - * show users a text input field to enter an arbitrary username and a select
121 - * box for it.
 119+ * whether associating an existing account with OpenID is allowed:
 120+ * show a wiki account username text input and password field
122121 */
123 -$wgOpenIDAllowManualUsername = true;
 122+$wgOpenIDAllowExistingAccountSelection = true;
124123
125124 /**
 125+ * when creating a new account with OpenID:
 126+ * show users a text input field to enter an arbitrary username
 127+ */
 128+$wgOpenIDAllowNewAccountname = true;
 129+
 130+/**
126131 * when creating a new account or associating an existing account with OpenID:
127132 * Use the username part left of "@" in an OpenID e-mail address as username
128133 * for account creation, or log in - if no nickname is supplied in the OpenID
@@ -144,14 +149,13 @@
145150 /**
146151 * when creating a new account or associating an existing account with OpenID:
147152 * propose and allow new account names from OpenID SREG data such as
148 - * fullname or nickname
 153+ * fullname or nickname (if such data is available)
149154 */
150155 $wgOpenIDProposeUsernameFromSREG = true;
151156
152157 /**
153158 * when creating a new account or associating an existing account with OpenID:
154159 * propose an auto-generated fixed unique username "OpenIDUser#" (#=1, 2, ..)
155 - * and show a select box for it.
156160 */
157161 $wgOpenIDAllowAutomaticUsername = true;
158162

Status & tagging log