Commit 22fbd829 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Fix 'menus/password check seem to follow after the login by one page'

bug - the smarty() function checks for whether the user is logged in,
and we're not sure that they are or are not until after the form has
been created. Made the login form use the div renderer.
parent aa2d268c
...@@ -35,13 +35,19 @@ if (!get_config('installed')) { ...@@ -35,13 +35,19 @@ if (!get_config('installed')) {
redirect(get_config('wwwroot') . 'admin/index.php'); redirect(get_config('wwwroot') . 'admin/index.php');
} }
$smarty = smarty(); // Check for whether the user is logged in, before processing the page. After
// this, we can guarantee whether the user is logged in or not for this page.
if (!$SESSION->is_logged_in()) { if (!$SESSION->is_logged_in()) {
require_once('form.php'); require_once('form.php');
$smarty->assign('login_form', form(auth_get_login_form())); $form = auth_get_login_form();
$form['renderer'] = 'div';
$login_form = form($form);
} }
$smarty = smarty();
if (!$SESSION->is_logged_in()) {
$smarty->assign('login_form', $login_form);
$smarty->display('index.tpl'); $smarty->display('index.tpl');
?> ?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment