From: Brion Vibber Date: Mon, 19 Apr 2010 16:45:50 +0000 (+0200) Subject: Fix ticket #2289: registration links were showing in top nav bar, login page message... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e547a2f54c2a2184d55c57c7712d4d50621f5fc2;p=quix0rs-gnu-social.git Fix ticket #2289: registration links were showing in top nav bar, login page message when site set to invite-only or closed registration, when the 'register' action can't be used. --- diff --git a/actions/login.php b/actions/login.php index 8ea3c800b7..dc6352368a 100644 --- a/actions/login.php +++ b/actions/login.php @@ -267,9 +267,13 @@ class LoginAction extends Action 'user name and password ' . 'before changing your settings.'); } else { - return _('Login with your username and password. ' . - 'Don\'t have a username yet? ' . - '[Register](%%action.register%%) a new account.'); + $prompt = _('Login with your username and password.'); + if (!common_config('site', 'closed') && !common_config('site', 'inviteonly')) { + $prompt .= ' '; + $prompt .= _('Don\'t have a username yet? ' . + '[Register](%%action.register%%) a new account.'); + } + return $prompt; } } diff --git a/lib/action.php b/lib/action.php index 0fc3a0dc43..c4d9fd5cbf 100644 --- a/lib/action.php +++ b/lib/action.php @@ -464,7 +464,7 @@ class Action extends HTMLOutputter // lawsuit _m('MENU', 'Logout'), $tooltip, false, 'nav_logout'); } else { - if (!common_config('site', 'closed')) { + if (!common_config('site', 'closed') && !common_config('site', 'inviteonly')) { // TRANS: Tooltip for main menu option "Register" $tooltip = _m('TOOLTIP', 'Create an account'); // TRANS: Main menu option when not logged in to register a new account