Index: trunk/phase3/includes/SpecialUserlogin.php |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | global $wgUser, $wgOut; |
166 | 166 | global $wgEnableSorbs, $wgProxyWhitelist; |
167 | 167 | global $wgMemc, $wgAccountCreationThrottle, $wgDBname; |
168 | | - global $wgAuth, $wgMinimalPasswordLength; |
| 168 | + global $wgAuth, $wgMinimalPasswordLength, $wgReservedUsernames; |
169 | 169 | |
170 | 170 | // If the user passes an invalid domain, something is fishy |
171 | 171 | if( !$wgAuth->validDomain( $this->mDomain ) ) { |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | |
207 | 207 | $name = trim( $this->mName ); |
208 | 208 | $u = User::newFromName( $name ); |
209 | | - if ( is_null( $u ) || $u->getName() == 'MediaWiki default' ) { |
| 209 | + if ( is_null( $u ) || in_array( $u->getName(), $wgReservedUsernames ) ) { |
210 | 210 | $this->mainLoginForm( wfMsg( 'noname' ) ); |
211 | 211 | return false; |
212 | 212 | } |
— | — | @@ -284,15 +284,14 @@ |
285 | 285 | * @access private |
286 | 286 | */ |
287 | 287 | function processLogin() { |
288 | | - global $wgUser; |
289 | | - global $wgAuth; |
| 288 | + global $wgUser, $wgAuth, $wgReservedUsernames; |
290 | 289 | |
291 | 290 | if ( '' == $this->mName ) { |
292 | 291 | $this->mainLoginForm( wfMsg( 'noname' ) ); |
293 | 292 | return; |
294 | 293 | } |
295 | 294 | $u = User::newFromName( $this->mName ); |
296 | | - if( is_null( $u ) || $u->getName() == 'MediaWiki default' ) { |
| 295 | + if( is_null( $u ) || in_array( $u->getName(), $wgReservedUsernames ) ) { |
297 | 296 | $this->mainLoginForm( wfMsg( 'noname' ) ); |
298 | 297 | return; |
299 | 298 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1936,4 +1936,10 @@ |
1937 | 1937 | */ |
1938 | 1938 | $wgAllowDisplayTitle = false ; |
1939 | 1939 | |
| 1940 | +/** |
| 1941 | + * Array of usernames which may not be registered or logged in from |
| 1942 | + * Maintenance scripts can still use these |
| 1943 | + */ |
| 1944 | +$wgReservedUsernames = array( 'MediaWiki default', 'Conversion script' ); |
| 1945 | + |
1940 | 1946 | ?> |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -71,6 +71,7 @@ |
72 | 72 | * installer: show realpath when asking to chmod g+w ./config |
73 | 73 | * installer: hide errors returned when trying to dl() mysql.so / pgsql.so |
74 | 74 | * installer: cleanly outputbuffer when dieing out |
| 75 | +* Add $wgReservedUsernames configuration directive to block account creation/use |
75 | 76 | |
76 | 77 | == Compatibility == |
77 | 78 | |