Class Auth
Identification d'utilisateur via BDD
// Exemple d'identification $sess = Session::getInstance('nomSession',10); $auth = new Auth($sess); $auth->setUserTable('user'); $auth->setUserField('login'); $auth->setPwdField('pwd'); $auth->setHashRounds(10); $auth->login($_POST['login'],$_POST['mdp']); if(!$auth->error) { if($auth->isLogged()) { echo 'Connnecté'; print_r($_SESSION); } else echo 'pas Connecté'; } else { echo $auth->displayError(); }
Namespace: Pry\Auth
Package: Auth
Category: Pry
Author: Olivier ROGER <oroger.fr>
Version: 1.4.2
See: http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication#477579
Located at Auth/Auth.class.php
Package: Auth
Category: Pry
Author: Olivier ROGER <oroger.fr>
Version: 1.4.2
See: http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication#477579
Located at Auth/Auth.class.php
public
|
|
public
|
|
public
|
|
public
boolean
|
|
public
string
|
|
public
|
|
public
integer
|
|
public
|
|
public
|
|
public
|
|
public
|
#
setAutologTokenField( string $autologTokenField )
Défini le champs contenant le token utilisé par le cookie d'autologin |
public
|
#
setHashRounds( integer $hashRounds )
Défini le nombre d'itération utilisé dans le cryptage Bcrypt du mot de passe |
public
|
|
public
|
|
public
|
|
public
|
#
setOnAutoLoginEvent(
Défini une instance de classe implémentant Auth_Interfaces_OnAutoLoginEvent afin d'appeler la méthode onAutoLogin après l'authentification via cookie |
integer |
NO_ERROR
|
0 |
|
integer |
ERROR_LOG
|
1 |
|
integer |
ERROR_PASS
|
2 |
|
integer |
ERROR_TABLE
|
3 |
|
integer |
ERROR_FIELD
|
4 |
public
boolean
|
$error |
|
#
Erreur lors de l'identification |