PHP Class Microweber\Providers\UserManager

Show file Open project: microweber/microweber

Public Properties

Property Type Description
$app Microweber\Application
$force_save By default it have security rules. If you are admin you can save any user in the system; However if you are regular user you must post param id with the current user id;
$tables

Public Methods

Method Description
__construct ( $app = null )
admin_access ( )
after_register ( $user_id, $suppress_output = true )
api_login ( $api_key = false )
attributes ( $user_id = false )
count ( )
csrf_form ( $unique_form_name = false )
csrf_token ( $unique_form_name = false )
csrf_validate ( &$data )
data_fields ( $user_id = false )
delete ( $data )
forgot_password_url ( )
get ( $params = false )
get_all ( $params ) : array
get_by_id ( $id ) : array Generic function to get the user by id.
get_by_username ( $username )
has_access ( $function_name )
hash_pass ( $pass )
id ( )
is_admin ( )
is_logged ( )
login ( array | string $params ) : array | boolean Allows you to login a user into the system.
login_as ( $params )
login_set_failed_attempt ( )
login_url ( )
logout ( $params = false )
logout_url ( )
make_logged ( $user_id )
name ( $user_id = false, string $mode = 'full' ) : string
nice_name ( $id, string $mode = 'full' ) : string Function to get user printable name by given ID.
picture ( $user_id = false )
register ( $params )
register_email_send ( $user_id = false )
register_url ( )
reset_password_from_link ( $params )
save ( $params )
send_forgot_password ( $params )
session_all ( )
session_del ( $name )
session_end ( )
session_get ( $name )
session_id ( )
session_set ( $name, $val )
set_table_names ( $tables = false )
social_login ( $params )
social_login_process ( $params = false )
socialite_config ( $provider = false )
update_last_login_time ( )

Method Details

__construct() public method

public __construct ( $app = null )

admin_access() public method

public admin_access ( )

after_register() public method

public after_register ( $user_id, $suppress_output = true )

api_login() public method

public api_login ( $api_key = false )

attributes() public method

public attributes ( $user_id = false )

count() public method

public count ( )

csrf_form() public method

public csrf_form ( $unique_form_name = false )

csrf_token() public method

public csrf_token ( $unique_form_name = false )

csrf_validate() public method

public csrf_validate ( &$data )

data_fields() public method

public data_fields ( $user_id = false )

delete() public method

public delete ( $data )

forgot_password_url() public method

public forgot_password_url ( )

get() public method

public get ( $params = false )

get_all() public method

public get_all ( $params ) : array
$params array|string;
return array of users;

get_by_id() public method

Uses the getUsers function to get the data.
public get_by_id ( $id ) : array
return array

get_by_username() public method

public get_by_username ( $username )

has_access() public method

public has_access ( $function_name )

hash_pass() public method

public hash_pass ( $pass )

id() public method

public id ( )

is_admin() public method

public is_admin ( )

is_logged() public method

public is_logged ( )

login() public method

It also sets user session when the user is logged.
On 5 unsuccessful logins, blocks the ip for few minutes
See also: _table() For the database table fields
public login ( array | string $params ) : array | boolean
$params array | string You can pass parameter as string or as array.
return array | boolean

login_as() public method

public login_as ( $params )

login_set_failed_attempt() public method

login_url() public method

public login_url ( )

logout() public method

public logout ( $params = false )

logout_url() public method

public logout_url ( )

make_logged() public method

public make_logged ( $user_id )

name() public method

public name ( $user_id = false, string $mode = 'full' ) : string
$user_id the id of the user. If false it will use the curent user (you)
$mode string full|first|last|username 'full' //prints full name (first +last) 'first' //prints first name 'last' //prints last name 'username' //prints username
return string

nice_name() public method

Function to get user printable name by given ID.
public nice_name ( $id, string $mode = 'full' ) : string
$id
$mode string
return string

picture() public method

public picture ( $user_id = false )

register() public method

public register ( $params )

register_email_send() public method

public register_email_send ( $user_id = false )

register_url() public method

public register_url ( )

save() public method

public save ( $params )

send_forgot_password() public method

public send_forgot_password ( $params )

session_all() public method

public session_all ( )

session_del() public method

public session_del ( $name )

session_end() public method

public session_end ( )

session_get() public method

public session_get ( $name )

session_id() public method

public session_id ( )

session_set() public method

public session_set ( $name, $val )

set_table_names() public method

public set_table_names ( $tables = false )

social_login() public method

public social_login ( $params )

social_login_process() public method

public social_login_process ( $params = false )

socialite_config() public method

public socialite_config ( $provider = false )

update_last_login_time() public method

Property Details

$app public property

public Application,Microweber $app
return Microweber\Application

$force_save public property

By default it have security rules. If you are admin you can save any user in the system; However if you are regular user you must post param id with the current user id;
public $force_save

$tables public property

public $tables