(bug 6189) Show an error to an unprivilleged user trying to create account
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 20 Jun 2006 13:19:16 +0000 (13:19 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 20 Jun 2006 13:19:16 +0000 (13:19 +0000)
RELEASE-NOTES
includes/SpecialUserlogin.php
includes/templates/Userlogin.php

index 62a9693..49d023c 100644 (file)
@@ -525,6 +525,7 @@ Some default configuration options have changed:
 * (bug 6304) Show timestamp for current revision in diff pages
 * Vertically align current version with old version header in diff display
 * (bug 6174) Remove redundant "emailforlost" message 
+* (bug 6189) Show an error to an unprivilleged user trying to create account
 
 
 == Compatibility ==
index 03a4185..6a549e2 100644 (file)
@@ -472,6 +472,11 @@ class LoginForm {
                global $wgCookiePrefix;
                global $wgAuth;
 
+               if ( $this->mType == 'signup' && !$wgUser->isAllowedToCreateAccount() ) {
+                       $this->userNotPrivilegedMessage();
+                       return;
+               }
+
                if ( '' == $this->mName ) {
                        if ( $wgUser->isLoggedIn() ) {
                                $this->mName = $wgUser->getName();
@@ -524,7 +529,6 @@ class LoginForm {
                $template->set( 'action', $titleObj->getLocalUrl( $q ) );
                $template->set( 'message', $msg );
                $template->set( 'messagetype', $msgtype );
-               $template->set( 'create', $wgUser->isAllowedToCreateAccount() );
                $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
                $template->set( 'userealname', $wgAllowRealName );
                $template->set( 'useemail', $wgEnableEmail );
index dd22985..742dc71 100644 (file)
@@ -101,7 +101,6 @@ class UsercreateTemplate extends QuickTemplate {
 <?php } ?>
 <div id="userlogin">
 
-<?php if( $this->data['create'] ) { ?>
 <form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
        <h2><?php $this->msg('createaccount') ?></h2>
        <p id="userloginlink"><?php $this->html('link') ?></p>
@@ -182,7 +181,6 @@ class UsercreateTemplate extends QuickTemplate {
                                <?php } ?>
                        </td>
                </tr>
-       <?php } ?>
        </table>
        <?php