models / users_model.php
UsersModel
Model
Manages users, registering new ones, returning and updating lists of user information, user settings, and forgotten passwords.
public
email_username_password
(
email, username, password
)
public
email_username_password
(
email, username, password
)
Email temporary username and password to email address.
email |
|
username |
|
password |
public
forgotpass_process
(
email
)
public
forgotpass_process
(
email
)
Start the forgotten pass process for the provided email.
email |
public
forgotpass_validate
(
email
)
public
forgotpass_validate
(
email
)
Validate an email address used in the forgotten password form.
email |
[is_valid, msg]
public
get_by_id
(
id
)
public
get_by_id
(
id
)
Get a user by ID.
id |
user
public
group_delete
(
id
)
public
group_delete
(
id
)
Delete a group.
id |
public
group_list
(
hide_permissions = false
)
public
group_list
(
hide_permissions = false
)
Get all groups.
hide_permissions |
By default this gets all of a groups associated permissions. Set to TRUE to hide these. |
groups
public
group_save
(
data, id = null
)
public
group_save
(
data, id = null
)
Save or insert a group.
data |
|
id |
Group ID. NULL by default when inserting a new group. |
public
group_validate
(
data, id = null
)
public
group_validate
(
data, id = null
)
Validate a group before updating.
data |
|
id |
Group ID. NULL by default when inserting a new group. |
[is_valid, msg]
public
newaccount_process
(
data
)
public
newaccount_process
(
data
)
Create a new user account with the provided data, generating a random password and sending a confirmation email.
data |
public
newaccount_validate
(
data
)
public
newaccount_validate
(
data
)
Validate data (name, email, and username) provided for a new account.
data |
[is_valid, msg]
public
permissions_list
(
)
public
permissions_list
(
)
Get all users permissions as well as the ones linked to each player.
permissions
public
randpass
(
)
public
randpass
(
)
Generate a random password.
password
public
settings_update
(
user_id, data
)
public
settings_update
(
user_id, data
)
Update user settings.
user_id |
|
data |
public
settings_validate
(
user_id, data
)
public
settings_validate
(
user_id, data
)
Validate user settings.
user_id |
|
data |
[is_valid, msg]
public
user_delete
(
id
)
public
user_delete
(
id
)
Delete a user.
id |
public
user_list
(
)
public
user_list
(
)
List all users' display names, IDs, and associated email addresses.
users
public
user_manage_key_delete
(
id, user_id
)
public
user_manage_key_delete
(
id, user_id
)
Delete an App Key associated with a specified user.
id |
|
user_id |
is_deleted?
public
user_manage_key_load
(
id
)
public
user_manage_key_load
(
id
)
Load all App Keys associated with a user.
id |
appkeys
public
user_manage_key_new
(
id
)
public
user_manage_key_new
(
id
)
Generate a new App Key for the provided user ID.
id |
[id, name, key, created, last_access]
public
user_manage_key_permissions_save
(
id, permissions, user_id
)
public
user_manage_key_permissions_save
(
id, permissions, user_id
)
Save App Key permisisons (will validate first).
id |
|
permissions |
|
user_id |
public
user_manage_key_permissions_validate
(
id, permissions, user_id
)
public
user_manage_key_permissions_validate
(
id, permissions, user_id
)
Validate App Key permisisons.
id |
|
permissions |
|
user_id |
public
user_manage_list
(
sort_col = 'display_name', sort_dir = 'asc'
)
public
user_manage_list
(
sort_col = 'display_name', sort_dir = 'asc'
)
Return a filtered list of users and their associated groups.
sort_col |
Column to sort users by. 'display_name' by default. |
sort_dir |
Direction to sort. 'asc' by default. |
users
public
user_manage_list_get_sort
(
)
public
user_manage_list_get_sort
(
)
Get the user list sorting settings from the settings table.
[sort_col, sort_dir]
public
user_manage_list_set_sort
(
sort_col, sort_dir
)
public
user_manage_list_set_sort
(
sort_col, sort_dir
)
Update settings table with sorting settings for users list.
sort_col |
Column to sort users list by. |
sort_dir |
Direction to sort users list. |
public
user_registration_get
(
)
public
user_registration_get
(
)
Return the user registration settings.
can_register
public
user_registration_set
(
value
)
public
user_registration_set
(
value
)
Set to TRUE or FALSE in the settings table depending on whether new users can be registered.
value |
Boolean determing whether new users can register. |
public
user_save
(
data, id = null
)
public
user_save
(
data, id = null
)
Udate or save a new user.
data |
|
id |
User ID. NULL by default if inserting a new user. |
public
user_validate
(
data, id = null
)
public
user_validate
(
data, id = null
)
Validate user fields before updating.
data |
|
id |
User ID. NULL by default if inserting a new user. |
[is_valid, msg]