<?php TaskerMAN\WebInterface\Session::destroy(); header('Location: index.php?p=login'); exit;
if (TaskerMAN\WebInterface\Session::isLoggedIn()) { header('Location: index.php?p=main'); exit; } // Hide template TaskerMAN\WebInterface\WebInterface::showTemplate(false); $error = null; if (isset($_POST['submit'])) { $user = TaskerMAN\Application\Login::verifyCredentials(TaskerMAN\Core\IO::POST('email'), TaskerMAN\Core\IO::POST('password')); if (!$user) { // Login failed $error = '<span style="align: center; color: red">Invalid username or password combination</span>'; } elseif (!$user->admin) { $error = '<span style="align: center; color: red">Your account does not have access to this control panel</span>'; } else { TaskerMAN\WebInterface\Session::set('uid', $user->id); header('Location: index.php?p=main'); exit; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Log in · TaskerMAN</title>