Example #1
0
<?php

require "../../admin/db.php";
if (isset($_GET['email']) && isset($_GET['code'])) {
    $Auth = new Auth();
    $result = $Auth->verify($_GET['email'], $_GET['code']);
    if ($result == 1) {
        if ($Auth->checkSession()) {
            $_SESSION['verified'] = "yes";
            if ($_SESSION['is_admin']) {
                header("Location: " . $baseurl . "admin/?msg=verified");
            } elseif ($_SESSION['is_super']) {
                header("Location: " . $baseurl . "super/?msg=verified");
            } elseif ($_SESSION['is_provider']) {
                header("Location: " . $baseurl . "provider/?msg=verified");
            } else {
                header("Location: " . $baseurl . "dashboard/?msg=verified");
            }
        } else {
            header("Location: " . $baseurl . "user/login/?msg=verified");
        }
    }
    if ($result == 2) {
        if ($Auth->checkSession()) {
            $_SESSION['verified'] = "yes";
            if ($_SESSION['data']['verifiedProvider'] != "yes") {
                header("Location: " . $baseurl . "provider/verify/?msg=email");
            } else {
                header("Location: " . $baseurl . "provider/");
            }
        } else {
Example #2
0
<?php

require_once './lib/auth.php';
$login = new Auth();
if (!isset($_POST['submit'])) {
    header("Location: index.php");
    exit;
} else {
    $username = $_POST['user'];
    $password = $_POST['pass'];
    $login->verify($username, $password);
}
 public function testSuccessVerifyLoginAttempt()
 {
     $attempt = \Auth::verify(['username' => 'Admin', 'password' => 'password'], false, false);
     $this->assertEquals($attempt, VerifyHelper::SUCCESS);
 }