r13647 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13646‎ | r13647 | r13648 >
Date:22:07, 14 April 2006
Author:robchurch
Status:old
Tags:
Comment:
Add $wgReservedUsernames configuration directive to block account creation/use
Modified paths:
  • /branches/REL1_6/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_6/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/REL1_6/phase3/includes/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: branches/REL1_6/phase3/RELEASE-NOTES
@@ -18,6 +18,7 @@
1919 * (bug 5184) CSS misapplied to elements in Special:Allmessages due to conflicting
2020 anchor identifiers
2121 * (bug 5519) Allow sidebar cache to be disabled; disable it by default.
 22+* Add $wgReservedUsernames configuration directive to block account creation/use
2223
2324
2425 == MediaWiki 1.6.3 ==
@@ -30,7 +31,6 @@
3132 where some versions of MySQL 4.0.x wouldn't work
3233 * Added note about $wgUrlProtocols format change
3334
34 -
3535 == MediaWiki 1.6.2 ==
3636
3737 April 8, 2006
@@ -43,7 +43,6 @@
4444 * Additional path fixes in the updater
4545 * (bug 5344) Fix regression that broke slashes in extension tag parameters
4646
47 -
4847 == MediaWiki 1.6.1 ==
4948
5049 April 5, 2006
@@ -56,7 +55,6 @@
5756 * PHP warning when allow_call_time_pass_reference is off
5857 * Update to Finnish localization
5958
60 -
6159 == MediaWiki 1.6.0 ==
6260
6361 April 5, 2006
Index: branches/REL1_6/phase3/includes/SpecialUserlogin.php
@@ -164,7 +164,7 @@
165165 global $wgUser, $wgOut;
166166 global $wgEnableSorbs, $wgProxyWhitelist;
167167 global $wgMemc, $wgAccountCreationThrottle, $wgDBname;
168 - global $wgAuth, $wgMinimalPasswordLength;
 168+ global $wgAuth, $wgMinimalPasswordLength, $wgReservedUsernames;
169169
170170 // If the user passes an invalid domain, something is fishy
171171 if( !$wgAuth->validDomain( $this->mDomain ) ) {
@@ -205,7 +205,7 @@
206206
207207 $name = trim( $this->mName );
208208 $u = User::newFromName( $name );
209 - if ( is_null( $u ) || $u->getName() == 'MediaWiki default' ) {
 209+ if ( is_null( $u ) || in_array( $u->getName(), $wgReservedUsernames ) ) {
210210 $this->mainLoginForm( wfMsg( 'noname' ) );
211211 return false;
212212 }
@@ -284,15 +284,14 @@
285285 * @access private
286286 */
287287 function processLogin() {
288 - global $wgUser;
289 - global $wgAuth;
 288+ global $wgUser, $wgAuth, $wgReservedUsernames;
290289
291290 if ( '' == $this->mName ) {
292291 $this->mainLoginForm( wfMsg( 'noname' ) );
293292 return;
294293 }
295294 $u = User::newFromName( $this->mName );
296 - if( is_null( $u ) || $u->getName() == 'MediaWiki default' ) {
 295+ if( is_null( $u ) || in_array( $u->getName(), $wgReservedUsernames ) ) {
297296 $this->mainLoginForm( wfMsg( 'noname' ) );
298297 return;
299298 }
Index: branches/REL1_6/phase3/includes/DefaultSettings.php
@@ -1932,4 +1932,10 @@
19331933 $wgAjaxExportList = array( 'wfSajaxSearch' );
19341934
19351935
 1936+/**
 1937+ * Array of usernames which may not be registered or logged in from
 1938+ * Maintenance scripts can still use these
 1939+ */
 1940+$wgReservedUsernames = array( 'MediaWiki default', 'Conversion script' );
 1941+
19361942 ?>

Status & tagging log