From c8ccaded97f9177788e3291b8977be2cb24ff844 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Tue, 20 Jun 2006 13:19:16 +0000 Subject: [PATCH] (bug 6189) Show an error to an unprivilleged user trying to create account --- RELEASE-NOTES | 1 + includes/SpecialUserlogin.php | 6 +++++- includes/templates/Userlogin.php | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 62a969365b..49d023c858 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 03a4185385..6a549e2d4e 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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 ); diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index dd22985334..742dc71ae7 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -101,7 +101,6 @@ class UsercreateTemplate extends QuickTemplate {
-data['create'] ) { ?>

msg('createaccount') ?>

@@ -182,7 +181,6 @@ class UsercreateTemplate extends QuickTemplate { -