From 6001a3a0d0aac5212694c623173f8b5362d230f6 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 22 Feb 2006 21:37:18 +0000 Subject: [PATCH] (bug 4319) Don't show a "create account" link on the login form when account creation is disabled. --- RELEASE-NOTES | 2 ++ includes/SpecialUserlogin.php | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 582a9d80d5..097a9df3f5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -360,6 +360,8 @@ Special Pages: * (bug 5018) Anchors for each message in Special:Allmessages * Introduce $wgWantedPagesThreshold per bug 5011; Special:Wantedpages will not list pages with less than this number of links. Defaults to 1. +* (bug 4319) Don't show a "create account" link on the login form when + account creation is disabled. Misc.: * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index a9b4d5cd1a..de67fda9db 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -484,9 +484,12 @@ class LoginForm { $link .= wfMsgHtml( $linkmsg . 'link' ); $link .= ''; - $template->set( 'link', wfMsgHtml( $linkmsg, $link ) ); + # Don't show a "create account" link if the user can't + if( $this->mType == 'signup' || ( $this->mType == 'login' && $wgUser->isAllowedToCreateAccount() ) ) { + $template->set( 'link', wfMsgHtml( $linkmsg, $link ) ); + } + $template->set( 'header', '' ); - $template->set( 'name', $this->mName ); $template->set( 'password', $this->mPassword ); $template->set( 'retype', $this->mRetype ); -- 2.20.1