From c8fc3ad7cd47a1545da030109ba743105417c047 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 14 May 2018 19:19:25 -0700 Subject: refactor the 'where does the register link point?' logic --- Zotlabs/Module/Home.php | 4 ++-- Zotlabs/Module/Login.php | 2 +- Zotlabs/Module/Register.php | 6 +++--- Zotlabs/Module/Regmod.php | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php index 79449c3b2..4b3e596a9 100644 --- a/Zotlabs/Module/Home.php +++ b/Zotlabs/Module/Home.php @@ -89,11 +89,11 @@ class Home extends \Zotlabs\Web\Controller { $sitename = get_config('system','sitename'); if($sitename) - $o .= '

' . sprintf( t("Welcome to %s") ,$sitename) . '

'; + $o .= '

' . sprintf( t('Welcome to %s') ,$sitename) . '

'; $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; diff --git a/Zotlabs/Module/Login.php b/Zotlabs/Module/Login.php index ae35b922f..6430939b4 100644 --- a/Zotlabs/Module/Login.php +++ b/Zotlabs/Module/Login.php @@ -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); } } diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 4ab1ccd81..3dded19c7 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -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('Register at another affiliated hub.'); } diff --git a/Zotlabs/Module/Regmod.php b/Zotlabs/Module/Regmod.php index 70635d707..6fe89ca90 100644 --- a/Zotlabs/Module/Regmod.php +++ b/Zotlabs/Module/Regmod.php @@ -13,8 +13,7 @@ class Regmod extends \Zotlabs\Web\Controller { if(! local_channel()) { info( t('Please login.') . EOL); - $o .= '

' . login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); - return $o; + return login(); } if(! is_site_admin()) { -- cgit v1.2.3