/** * Display a login form */ public function loginFormAction() { $https = fz_config_get('app', 'https'); if ($this->getAuthHandler()->isSecured()) { fz_redirect_to('/', $https == 'always'); } if ($https == 'always' || $https == 'login_only') { fz_force_https(); } if (isset($_SESSION['token']) && $_POST['token'] == $_SESSION['token']) { set_or_default('username', $_POST['username'], ''); } else { set('username', ''); } $token = md5(uniqid(rand(), true)); $_SESSION['token'] = $token; set('token', $token); return html('auth/loginForm.php'); }
function welcome() { set_or_default('name', params('name'), "everybody"); return html("html_welcome"); }