From: Roan Kattouw Date: Sat, 2 Jan 2010 20:22:06 +0000 (+0000) Subject: (bug 20115) Special:Userlogin says "Log in / create account" even if the user can... X-Git-Tag: 1.31.0-rc.0~38437 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=474e33812337eb879176a1bd2c6c3c47bb72670d;p=lhc%2Fweb%2Fwiklou.git (bug 20115) Special:Userlogin says "Log in / create account" even if the user can't create an account. Modified patch by Karun Dambietz --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4acd727f24..fed260e67b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -674,6 +674,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 21986) Special page names were are now capitalized by content language * If two log type have the same description, they're now both displayed in the type selector on Special:Log +* (bug 20115) Special:Userlogin title says "Log in / create account" even if the + user can't create an account == API changes in 1.16 == diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 1ba44d476d..b167f915e4 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -947,7 +947,15 @@ class LoginForm { wfRunHooks( 'UserLoginForm', array( &$template ) ); } - $wgOut->setPageTitle( wfMsg( 'userlogin' ) ); + //Changes the title depending on permissions for creating account + if ($wgUser->isAllowed( 'createaccount' )) + { + $wgOut->setPageTitle( wfMsg( 'userlogin' ) ); + } else + { + $wgOut->setPageTitle( wfMsg( 'userloginnocreate' ) ); + } + $wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setArticleRelated( false ); $wgOut->disallowUserJs(); // just in case... diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3e4a54183a..dac250875a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1044,6 +1044,7 @@ Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].', 'login' => 'Log in', 'nav-login-createaccount' => 'Log in / create account', 'loginprompt' => 'You must have cookies enabled to log in to {{SITENAME}}.', +'userloginnocreate' => 'Log in', 'userlogin' => 'Log in / create account', 'logout' => 'Log out', 'userlogout' => 'Log out', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index a9136e56df..159977cd2c 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -412,6 +412,7 @@ $wgMessageStructure = array( 'nav-login-createaccount', 'loginprompt', 'userlogin', + 'userloginnocreate', 'logout', 'userlogout', 'notloggedin',