diff --git a/index.php b/index.php index d8fa3bb8ff..cf1be1a4b4 100644 --- a/index.php +++ b/index.php @@ -151,9 +151,8 @@ if (api_is_anonymous()) { } } -if ($showLoginForm) { - $controller->set_login_form(); -} + +$controller->set_login_form($showLoginForm); //@todo move this inside the IndexManager if (!api_is_anonymous()) { diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 89e6385855..409633292a 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -21,7 +21,7 @@ class IndexManager { } } - function set_login_form() { + function set_login_form($setLoginForm = true) { global $loginFailed; $login_form = ''; @@ -30,23 +30,27 @@ class IndexManager { // Only display if the user isn't logged in. $this->tpl->assign('login_language_form', api_display_language_form(true)); - $this->tpl->assign('login_form', self::display_login_form()); - if ($loginFailed) { - $this->tpl->assign('login_failed', self::handle_login_failed()); - } + if ($setLoginForm) { - if (api_get_setting('allow_lostpassword') == 'true' || api_get_setting('allow_registration') == 'true') { - $login_form .= '
'; - } - $this->tpl->assign('login_options', $login_form); + $this->tpl->assign('login_form', self::display_login_form()); + + if ($loginFailed) { + $this->tpl->assign('login_failed', self::handle_login_failed()); + } + + if (api_get_setting('allow_lostpassword') == 'true' || api_get_setting('allow_registration') == 'true') { + $login_form .= ''; + } + $this->tpl->assign('login_options', $login_form); + } } } diff --git a/plugin/before_login/index.php b/plugin/before_login/index.php index a301258a8d..be773317f1 100644 --- a/plugin/before_login/index.php +++ b/plugin/before_login/index.php @@ -35,13 +35,12 @@ if (api_is_anonymous()) { $form = new FormValidator('form'); $renderer =& $form->defaultRenderer(); - $renderer->setHeaderTemplate(''); $renderer->setFormTemplate(''); $renderer->setElementTemplate('