Exemplo n.º 1
0
        session_destroy();
        session_start();
        SessionHelper::setSession($row);
        if ($from) {
            header("Location: " . $from);
        } else {
            if (SessionHelper::isAdmin()) {
                header("Location: report_time.php");
            } else {
                header("Location: .");
            }
        }
    }
}
$prefillEmail = $_POST && $_POST["email"] ? $_POST["email"] : ($_GET && $_GET["email"] ? $_GET["email"] : "");
$prefillEmail = $prefillEmail ? $prefillEmail : CookieHelper::getLoginUser();
$focusId = $prefillEmail ? "password" : "email";
if ($_POST) {
    // posted variables from this page
    //  action form
    $success = true;
    require_once "classes/validationhelper.class.php";
    $required = array();
    $required[] = array("key" => "email", "msg" => "Please enter: email");
    $required[] = array("key" => "password", "msg" => "Please enter: Password");
    foreach ($required as $value) {
        if (!ValidationHelper::required($value["key"], $_POST)) {
            $message = "<span class=\"feedbackNegative\">" . $value["msg"] . "</span>";
            $focusId = $value["key"];
            $success = false;
            break;