PHP Class Ezuser

This model represents user data. It can be used for retriving user data and validate agains the login.
Author: Roni Kumar Saha ([email protected])
Inheritance: extends CI_Model
Datei anzeigen Open project: xiidea/ezrbac

Public Methods

Method Description
__construct ( ) constructor function
create ( $data = [] )
generate_password ( $salt )
getUserID ( $user )
get_user_by_email ( $email ) : object Get user record by email
get_user_by_id ( $user_id ) : object Get user record by user_id
get_user_meta ( $user_id )
on_duplicate_update ( $table, null $data = NULL, null $update = NULL ) : boolean
requestPassword ( $user_id ) : string Reset user password, create reset request key and return it
set_new_password ( $npass, $email ) Save new password after hashing that
update ( $data = [] )
update_login_info ( $user_id ) : void Update user login info, such as IP-address or login time, and clear previously generated (but not activated) passwords.
update_user_meta ( $user_id, $data )

Protected Methods

Method Description
generateSalt ( ) : string Generates a salt that can be used to generate a password hash.

Private Methods

Method Description
_duplicate_insert_sql ( $table, $values, null $update = NULL ) : string
_f ( $f )
parseData ( $data )
validate_schema ( )

Method Details

__construct() public method

constructor function
public __construct ( )

create() public method

public create ( $data = [] )

generateSalt() protected method

Generates a salt that can be used to generate a password hash.
protected generateSalt ( ) : string
return string the salt

generate_password() public method

public generate_password ( $salt )

getUserID() public method

public getUserID ( $user )

get_user_by_email() public method

Get user record by email
public get_user_by_email ( $email ) : object
return object

get_user_by_id() public method

Get user record by user_id
public get_user_by_id ( $user_id ) : object
return object

get_user_meta() public method

public get_user_meta ( $user_id )

on_duplicate_update() public method

public on_duplicate_update ( $table, null $data = NULL, null $update = NULL ) : boolean
$table
$data null
$update null
return boolean

requestPassword() public method

Reset user password, create reset request key and return it
public requestPassword ( $user_id ) : string
$user_id
return string

set_new_password() public method

Save new password after hashing that
public set_new_password ( $npass, $email )
$npass
$email

update() public method

public update ( $data = [] )

update_login_info() public method

Update user login info, such as IP-address or login time, and clear previously generated (but not activated) passwords.
public update_login_info ( $user_id ) : void
return void

update_user_meta() public method

public update_user_meta ( $user_id, $data )