示例#1
0
            if (password_verify($pass, $password)) {
                if (!isset($_SESSION)) {
                    session_start();
                }
                $_SESSION['ID'] = $cekquery[0]->id;
                $_SESSION['NAMA'] = $cekquery[0]->nama;
                $_SESSION['HAK'] = $cekquery[0]->hak;
                if ($_SESSION['HAK'] >= 22) {
                    header("Location: index.php");
                } elseif ($_SESSION['HAK'] == 11) {
                    header("Location: userdashboard.php");
                }
            } else {
                $helpers->setAlert('alert-danger', ' Password Salah !! ');
                //echo 'Invalid password.';
            }
        } else {
            $helpers->setAlert('alert-danger', ' Email Tidak terdaftar  !! ');
            //echo 'Email Tidak terdaftar.';
        }
    }
}
/*
 * If we have set the printAlert method then assign to the template variable message
 */
if (isset($_SESSION['alertMessage'])) {
    $smarty->assign('message', $helpers->printAlert());
    $helpers->unsetAlert();
}
// Finally, display the actual page
$smarty->display('login.tpl');