* Copyright 2001-2010 Strangecode, LLC * * This file is part of The Strangecode Codebase. * * The Strangecode Codebase is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your option) * any later version. * * The Strangecode Codebase is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * The Strangecode Codebase. If not, see . */ /** * login.php */ // We may want to use the add/edit interface from another script, so this // allows us to remember which page we came from so we can go back there. if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) { $app->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('User %s successfully logged-in.', $frm['username']), LOG_INFO, __FILE__, __LINE__); } else { $app->raiseMsg(_("Login failed, please try again."), MSG_NOTICE, __FILE__, __LINE__); $app->logMsg(sprintf('User %s failed login (encrypted password: %s)', $frm['username'], $auth->encryptPassword($frm['password'])), LOG_NOTICE, __FILE__, __LINE__); } } // Titles and navigation header. $nav->add(_("Login")); // Templates. include 'header.ihtml'; include 'codebase/services/templates/login_form.ihtml'; include 'footer.ihtml'; ?>