refactor the 'where does the register link point?' logic
This commit is contained in:
@@ -89,11 +89,11 @@ class Home extends \Zotlabs\Web\Controller {
|
||||
|
||||
$sitename = get_config('system','sitename');
|
||||
if($sitename)
|
||||
$o .= '<h1 class="home-welcome">' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>';
|
||||
$o .= '<h1 class="home-welcome">' . sprintf( t('Welcome to %s') ,$sitename) . '</h1>';
|
||||
|
||||
$loginbox = get_config('system','login_on_homepage');
|
||||
if(intval($loginbox) || $loginbox === false)
|
||||
$o .= login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
|
||||
$o .= login(true);
|
||||
|
||||
return $o;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Login extends \Zotlabs\Web\Controller {
|
||||
if(remote_channel() && $_SESSION['atoken'])
|
||||
goaway(z_root());
|
||||
|
||||
return login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? false : true);
|
||||
return login(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -187,8 +187,8 @@ class Register extends \Zotlabs\Web\Controller {
|
||||
$registration_is = '';
|
||||
$other_sites = '';
|
||||
|
||||
if(get_config('system','register_policy') == REGISTER_CLOSED) {
|
||||
if(get_config('system','directory_mode') == DIRECTORY_MODE_STANDALONE) {
|
||||
if(intval(get_config('system','register_policy')) === REGISTER_CLOSED) {
|
||||
if(intval(get_config('system','directory_mode')) === DIRECTORY_MODE_STANDALONE) {
|
||||
notice( t('Registration on this hub is disabled.') . EOL);
|
||||
return;
|
||||
}
|
||||
@@ -197,7 +197,7 @@ class Register extends \Zotlabs\Web\Controller {
|
||||
return $mod->get();
|
||||
}
|
||||
|
||||
if(get_config('system','register_policy') == REGISTER_APPROVE) {
|
||||
if(intval(get_config('system','register_policy')) == REGISTER_APPROVE) {
|
||||
$registration_is = t('Registration on this hub is by approval only.');
|
||||
$other_sites = t('<a href="pubsites">Register at another affiliated hub.</a>');
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ class Regmod extends \Zotlabs\Web\Controller {
|
||||
|
||||
if(! local_channel()) {
|
||||
info( t('Please login.') . EOL);
|
||||
$o .= '<br /><br />' . login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
|
||||
return $o;
|
||||
return login();
|
||||
}
|
||||
|
||||
if(! is_site_admin()) {
|
||||
|
||||
Reference in New Issue
Block a user