\Login_m

Class Login_m - Model

Model for admin table.

Summary

Methods
Properties
Constants
__construct()
get_user()
get_user_id()
login()
user_has_role()
logout()
is_loged_in()
No public properties found
No constants found
No protected methods found
$primary_key
$table
$session_var
N/A
No private methods found
$user
N/A

Properties

$primary_key

$primary_key : string

Type

string — This is the name of the primary key field for our model.

$table

$table : string

Type

string — This is the database table for this model.

$session_var

$session_var : integer

Type

integer — This is private var to use on this class.

$user

$user : integer

Type

integer — This is private var to use on this class.

Methods

__construct()

__construct() 

Constructor

get_user()

get_user() : array

Fetch a single record based on the primary key. Return an array

Returns

array

get_user_id()

get_user_id() : array

Retrieve ID of user located on session

Returns

array

login()

login(string  $user, string  $pass) : integer

Try to make login with provided params

Parameters

string $user

Username

string $pass

Password

Returns

integer

user_has_role()

user_has_role(string  $permission, true|false  $redirect = false) : integer

Check if user have permision

Parameters

string $permission

Username

true|false $redirect

Returns

integer

logout()

logout() 

Delete user session

is_loged_in()

is_loged_in() : true|false

Check if user is logged

Returns

true|false