classAuthDriver
extends jAuthDriverBase
in package
implements
jIAuthDriver
Driver for a class which implement an authentification
Tags
Interfaces, Classes and Traits
- jIAuthDriver
- interface for auth drivers
Table of Contents
- $_params : mixed
- $passwordHashMethod : mixed
- $passwordHashOptions : mixed
- __construct() : mixed
- changePassword() : bool
- change a user password
- checkPassword() : bool|string
- createUserObject() : object
- creates a new user object, with some first data.. Careful : it doesn't create a user in a database for example. Just an object.
- cryptPassword() : string
- hash the given password
- getUser() : object
- return user data corresponding to the given login
- getUserList() : array<string|int, object>
- construct the user list
- removeUser() : mixed
- Erase user data of the user $login
- saveNewUser() : mixed
- store a new user.
- updateUser() : mixed
- save updated data of a user warning : should not save the password !
- verifyPassword() : object|false
- verify that the password correspond to the login
Properties
$_params
protected
mixed
$_params
$passwordHashMethod
protected
mixed
$passwordHashMethod
$passwordHashOptions
protected
mixed
$passwordHashOptions
Methods
__construct()
public
__construct(mixed $params) : mixed
Parameters
- $params : mixed
Return values
mixed —changePassword()
change a user password
public
changePassword(mixed $login, mixed $newpassword) : bool
Parameters
- $login : mixed
-
the login of the user
- $newpassword : mixed
Return values
bool —true if the password has been changed
checkPassword()
public
checkPassword(string $givenPassword, string $currentPasswordHash) : bool|string
Parameters
- $givenPassword : string
-
the password to verify
- $currentPasswordHash : string
-
the hash of the real password
Return values
bool|string —false if password does not correspond. True if it is ok. A string containing a new hash if it is ok and need to store a new hash
createUserObject()
creates a new user object, with some first data.. Careful : it doesn't create a user in a database for example. Just an object.
public
createUserObject(mixed $login, mixed $password) : object
Parameters
- $login : mixed
-
the user login
- $password : mixed
-
the user password
Return values
object —the returned object depends on the driver
cryptPassword()
hash the given password
public
cryptPassword(string $password[, mixed $forceOldHash = false ]) : string
Parameters
- $password : string
-
the password to hash
- $forceOldHash : mixed = false
Return values
string —the hash password
getUser()
return user data corresponding to the given login
public
getUser(mixed $login) : object
Parameters
- $login : mixed
-
the login of the user
Return values
object —the user data container
getUserList()
construct the user list
public
getUserList(mixed $pattern) : array<string|int, object>
Parameters
- $pattern : mixed
-
'' for all users
Return values
array<string|int, object> —array of objects representing the users
removeUser()
Erase user data of the user $login
public
removeUser(mixed $login) : mixed
Parameters
- $login : mixed
-
the login of the user to remove
Return values
mixed —saveNewUser()
store a new user.
public
saveNewUser(mixed $user) : mixed
It create the user in a database for example should be call after a call of createUser and after setting some of its properties...
Parameters
- $user : mixed
-
the user data container
Return values
mixed —updateUser()
save updated data of a user warning : should not save the password !
public
updateUser(mixed $user) : mixed
Parameters
- $user : mixed
-
the user data container
Return values
mixed —verifyPassword()
verify that the password correspond to the login
public
verifyPassword(mixed $login, mixed $password) : object|false
Parameters
- $login : mixed
-
the login of the user
- $password : mixed
-
the password to test
Return values
object|false —returns the object representing the user