Exemplo n.º 1
0
<?php

include "Config.php";
include "Auth.php";
$dbh = new PDO("mysql:host=localhost;dbname=user_login", "root", "root") or die("lolo");
$config = new PHPAuth\Config($dbh);
$auth = new PHPAuth\Auth($dbh, $config);
var_dump($auth->getUser(5));
$email = "*****@*****.**";
$password = "******";
$password2 = "ucsc@123!@#AB";
//var_dump($auth->resendActivation($email,1));
var_dump($auth->logout($auth->getSessionHash()));
//var_dump($auth->changePassword(5,$password,$password2,$password2));
if (!$auth->isLogged()) {
    header('HTTP/1.0 403 Forbidden');
    echo "Forbidden";
    exit;
} else {
    echo "youhaveloginchamath SIlva";
}
Exemplo n.º 2
0
<?php

require "../../models/DB/Db.class.php";
$db = new Db();
$dbh = $db->getPurePodo();
include "../../models/PHPAuth/Config.php";
include "../../models/PHPAuth/Auth.php";
$config = new PHPAuth\Config($dbh);
$auth = new PHPAuth\Auth($dbh, $config);
$email = "*****@*****.**";
$password = "******";
$repeatpassword = "******";
echo '<pre>';
$result = $auth->logout($auth->getSessionHash());
var_dump($result);
//header('location: ../../../index.php');
echo '<br>';
Exemplo n.º 3
0
 /**
  * Удаляем данные о пользователе из сессии
  */
 public function actionLogout()
 {
     // Удаляем информацию о пользователе из сессии
     $dbh = Db::getConnection();
     $config = new PHPAuth\Config($dbh);
     $auth = new PHPAuth\Auth($dbh, $config);
     if (!$auth->isLogged()) {
         header("Location: /user/login");
     }
     $userHash = $auth->getSessionHash();
     $auth->logout($userHash);
     header("Location: /user/login");
 }