Пример #1
0
<?php

// Check if the application is installed, if not, bounce to install page
if (TaskerMAN\Core\Install::required()) {
    header('Location: index.php?p=install');
    exit;
}
// If user is already logged in, take them to main dashboard
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>