setBoomerangURL($_SERVER['HTTP_REFERER'], 'login'); } $app->sslOn(); $frm['username'] = getFormdata('username'); $frm['password'] = getFormdata('password'); if (getFormdata('username', false)) { // Form has been submitted, check if the user login information is correct. if ($auth->login($frm['username'], $frm['password'])) { $app->raiseMsg(_("You are now logged in."), MSG_SUCCESS, __FILE__, __LINE__); $app->dieBoomerangURL('login'); $app->logMsg(sprintf('%s %s successfully logged-in.', $auth->get('auth_name'), $frm['username']), LOG_INFO, __FILE__, __LINE__); } else { $app->raiseMsg(_("Login failed, please try again."), MSG_NOTICE, __FILE__, __LINE__); $app->logMsg(sprintf('%s %s failed login using (MD5ed) password: %s', ucfirst($auth->get('auth_name')), $frm['username'], md5($frm['password'])), LOG_NOTICE, __FILE__, __LINE__); } } // Titles and navigation header. $nav->addPage(_("Login")); // Templates. include 'header.ihtml'; include 'codebase/services/templates/login_form.ihtml'; include 'footer.ihtml'; ?>