-
Notifications
You must be signed in to change notification settings - Fork 235
4) User Operations
Aauth User functions.
Logs user into system, if remember is optional. if you set remember as TRUE, it will remember as specified time, unless it will remember just CodeIgniter's session time.
$this->aauth->login('admin@admin.com', 'password', true)
without remember
$this->aauth->login('admin@admin.com', 'password')
Clears all sessions of current user
$this->aauth->logout()
returns list of users as an object
if group_par(group_id or group_name) is given it will olso include groups of users to result
You should also check Group Operations
logins by using only user_id
$this->aauth->login_fast(1)
checks if user logged in, returns true or false
$this->aauth->is_loggedin()
It is a special function which control if a current user has permission (You must see Permissions)for given permission rule to see page. $perm_parm can be id or name of rule. If user doesn't have permission, it stops the execution and shows a message (can be changed from config file) If user has permission, it updates user's last activity date-time if perm_par is not given just control user logged in or not
i recommend you to use this function inside every conrtollers' constructer.
to control access of a user for permission rule with id 5
$this->aauth->control(5)
to control 'bla' permission
$this->aauth->control('bla')
creates user, it also send vertificaton e-mail if verification is set as true from Aauth config file. (Default is false)
$this->aauth->create_user('user@example.com', 'example_pass', 'Optional Name')
Updtates user bu using user_id
send verification to user's email (Remember, create_user also sends verification using this function)
You can also crate a link to verify user. Look Aauth config file.
verifies user
Limits login attempt. People can do 10 login attempts per minute by default.
it can be changed from config file by changing 'try' => 10,
line
You can also deactivate this by changing that line to true
'dos_protection' => true,
bans user
unlock the banned user
returns true if user is banned, false otherwise
deletes user. It is not recomended !!!. I recommend to use ban_user function
if email is available, returns true
send a vertification code to given email if user exists
resets password and sends a random password user's email
Updates the user's last activity time. Remember! control function also do this job.
Updates last login time. Remember! login function also do it.
updates the remember time for a user, login function also use this. You don't need to use this.
returns user information as an objcet you can also use sessions
returns user_id, if email parameter not given, it will return current logged in user's id.
returns joined groups of given user as an object
You should also check Group Operations
Aauth V2 Wiki created by emreakay.com