Class User
Example of using the User module
if (class_exists('User')) { // Try to login try { $u = new \Module\Authentication\User(); // check if the admin user exists $uid = $u->authenticate('developer@envivent.com', 'test'); echo "Authentication successful. User ID is ", $uid; } catch (\Exception $e) { // Admin uses doesn't exist. Let's create it. $u->columns['role_id'] = 1; $u->columns['email'] = 'developer@envivent.com'; $u->columns['password'] = $u->saltPassword('test'); $u->save(); } }
- Module\DB\Record
- Module\Authentication\User
public
integer
|
|
public
string
|
|
public
mixed
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
string
|
__construct(),
delete(),
form()
|
public
string
|
$table
The name of the users table |
#
'users'
|
public
mixed
|
$metadata
The meta data for the table, e.g. fields and field data |
|
private
|
$role
The users Role |
|
private
string
|
$salt
The salt for password encryption |
#
'o_PXO=1-BCTkq>|>*}KmkM8CA-!x|J6Y/UyDJC#ph(*A6me>CJ1Uu8E7gye|Vek['
|
$columns,
$db,
$meta,
$primaryKey
|