* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @link http://www.easyscp.net * @author EasySCP Team */ require_once '../include/easyscp-lib.php'; $cfg = EasySCP_Registry::get('Config'); if (isset($_GET['logout'])) { unset_user_login_data(); } do_session_timeout(); init_login(); if (isset($_POST['uname']) && !empty($_POST['uname']) && isset($_POST['upass']) && !empty($_POST['upass'])) { check_input(trim($_POST['uname'])); check_input(trim($_POST['upass'])); $uname = encode_idna($_POST['uname']); if (register_user($uname, $_POST['upass'])) { redirect_to_level_page(); } user_goto('index.php'); } if (check_user_login() && !redirect_to_level_page()) { unset_user_login_data(); } shall_user_wait(); $theme_color = isset($_SESSION['user_theme']) ? $_SESSION['user_theme'] : $cfg->USER_INITIAL_THEME; $tpl = EasySCP_TemplateEngine::getInstance();
* * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Include core library require 'imscp-lib.php'; $eventManager = iMSCP_Events_Aggregator::getInstance(); $eventManager->dispatch(iMSCP_Events::onLoginScriptStart); if (isset($_REQUEST['action'])) { init_login($eventManager); $auth = iMSCP_Authentication::getInstance(); switch ($_REQUEST['action']) { case 'logout': if ($auth->hasIdentity()) { $adminName = $auth->getIdentity()->admin_name; $auth->unsetIdentity(); set_page_message(tr('You have been successfully logged out.'), 'success'); write_log(sprintf("%s logged out", decode_idna($adminName)), E_USER_NOTICE); } break; case 'login': $authResult = $auth->authenticate(); if ($authResult->isValid()) { write_log(sprintf("%s logged in", $authResult->getIdentity()->admin_name), E_USER_NOTICE); } elseif ($messages = $authResult->getMessages()) {