FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
User_Model Class Reference
Inheritance diagram for User_Model:
ORM

Public Member Functions

 get_all_users ($limit_from=0, $limit_results=50, $order_by= 'id', $order_by_direction= 'ASC', $filter_sql='', $member_id=NULL)
 Returns all users.
 count_all_users ($filter_sql= '', $member_id=NULL)
 Counts all users with respect to filter's values.
 get_all_users_of_member ($member_id=NULL, $limit_from=0, $limit_results=50, $order_by= 'id', $order_by_direction= 'ASC')
 Gets all users of member.
 get_all_users_of_members ($member_ids=NULL, $limit_from=0, $limit_results=50, $order_by= 'id', $order_by_direction= 'ASC')
 Gets all users of members.
 count_all_users_of_members ($member_ids=NULL)
 Counts all users of members.
 get_users_to_sync_vtiger ($ids, $in_set)
 Function gets selected users.
 login_request ($username= '', $password= '')
 Login test function.
 count_all_users_by_member ($member_id=NULL)
 Counts all users belong to member.
 username_exist ($username, $user_id=null)
 Tests if username exist.
 phone_exist ($phone, $user_id=null)
 Tests if phone exist.
 email_exist ($email, $user_id=null)
 Tests if email exist.
 get_users ($query)
 Gets user whose name contains given str.
 get_all_user_names ()
 Gets all user names.
 get_his_users_names ($user_id)
 Gets user's usernames.
 get_his_username ($user_id)
 Get user's username.
 get_usernames ($query)
 Gets user's usernames whose name contains given str.
 count_dependent_items ($user_id)
 Function searches for items dependent on given user.
 delete_depends_items ($user_id)
 Function searches for items dependent on given user and delete them.
 get_user_emails ($user_id)
 Selects all users emails.
 get_user_by_phone_number_country_code ($number, $country_code)
 Returns user by phone number and country code.
 get_aro_groups_of_user ($user_id)
 Gets ARO groups of user.
 is_user_in_aro_group ($user_id, $aro_group)
 Checks if user is in ARO group.
 select_list_grouped ($optgroup=TRUE)
 Gets array of users for selectbox.
 get_all_by_aro_group_id ($id, $name=NULL)
 Function gets all records, which are in given aro group by id of group.
 get_all_not_in_by_aro_group_id ($id, $name=NULL)
 Function gets all records, which are not in given aro group by id of group.
 get_all_from_device_admins_by_aro_group_id ($id, $name=NULL)
 Function gets all records, which are in given aro device_admins group by id of group.
 get_all_not_in_from_device_admins_by_aro_group_id ($id, $name=NULL)
 Function gets all records, which are not in given aro device_admins group by id of group.
 get_users_not_in_engineer_of ($device_id)
 get_full_name ()
 Gets full name of user.
 get_full_name_with_login ()
 Gets full name of user with his login.
 get_all_users_by_gps ($gpsx, $gpsy, $user_id=NULL)
 get_name_with_login ($user_id=NULL)
 __toString ()
 Gets full name of user.
 get_user_setting ($key, $default=NULL)
 Get user settings.
 set_user_setting ($key, $value)
 Sets user settings.

Public Attributes

const ASSOCIATION = 1
 ID of association user.
const MAIN_USER = 1
 Type of user: First of users of member is main user.
const USER = 2
 Type of user: Not main users of member.
const SETTINGS_MONITORING_GROUP_BY = 'monitoring_group_by'
 User settings constants.

Static Public Attributes

static $arr_sql

Protected Attributes

 $belongs_to = array('member')
 $has_many
 $has_and_belongs_to_many

Member Function Documentation

User_Model::__toString ( )

Gets full name of user.

Returns
string
User_Model::count_all_users (   $filter_sql = '',
  $member_id = NULL 
)

Counts all users with respect to filter's values.

!!!!!! SECURITY WARNING !!!!!! Be careful when you using this method, param $filter_sql is unprotected for SQL injections, security should be made at controller site using Filter_form class. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Author
Michal Kliment
Parameters
string$filter_sql
integer$member_id
Returns
integer
User_Model::count_all_users_by_member (   $member_id = NULL)

Counts all users belong to member.

Parameters
numeric$member_id
Returns
numeric
User_Model::count_all_users_of_members (   $member_ids = NULL)

Counts all users of members.

Author
David Raska
Parameters
array$member_ids
Returns
integer
User_Model::count_dependent_items (   $user_id)

Function searches for items dependent on given user.

Used for deleting user.

Parameters
integer$user_id
Returns
unknown_type
User_Model::delete_depends_items (   $user_id)

Function searches for items dependent on given user and delete them.

Parameters
integer$user_id
User_Model::email_exist (   $email,
  $user_id = null 
)

Tests if email exist.

Parameters
string$email
numeric$user_id
Returns
boolean
User_Model::get_all_by_aro_group_id (   $id,
  $name = NULL 
)

Function gets all records, which are in given aro group by id of group.

Parameters
integer$id
string$name
Returns
unknown_type
User_Model::get_all_from_device_admins_by_aro_group_id (   $id,
  $name = NULL 
)

Function gets all records, which are in given aro device_admins group by id of group.

Parameters
integer$id
string$name
Returns
unknown_type
User_Model::get_all_not_in_by_aro_group_id (   $id,
  $name = NULL 
)

Function gets all records, which are not in given aro group by id of group.

Parameters
integer$id
string$name
Returns
unknown_type
User_Model::get_all_not_in_from_device_admins_by_aro_group_id (   $id,
  $name = NULL 
)

Function gets all records, which are not in given aro device_admins group by id of group.

Parameters
integer$id
string$name
Returns
unknown_type
User_Model::get_all_user_names ( )

Gets all user names.

Returns
unknown_type
User_Model::get_all_users (   $limit_from = 0,
  $limit_results = 50,
  $order_by = 'id',
  $order_by_direction = 'ASC',
  $filter_sql = '',
  $member_id = NULL 
)

Returns all users.

!!!!!! SECURITY WARNING !!!!!! Be careful when you using this method, param $filter_sql is unprotected for SQL injections, security should be made at controller site using Filter_form class. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Parameters
numeric$limit_from
numeric$limit_results
string$order_by
string$order_by_direction
string$filter_sql
numeric$member_id
Returns
Mysql_Result object
User_Model::get_all_users_of_member (   $member_id = NULL,
  $limit_from = 0,
  $limit_results = 50,
  $order_by = 'id',
  $order_by_direction = 'ASC' 
)

Gets all users of member.

Parameters
integer$member_id
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
Returns
unknown_type
User_Model::get_all_users_of_members (   $member_ids = NULL,
  $limit_from = 0,
  $limit_results = 50,
  $order_by = 'id',
  $order_by_direction = 'ASC' 
)

Gets all users of members.

Author
David Raska
Parameters
array$member_ids
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
Returns
unknown_type
User_Model::get_aro_groups_of_user (   $user_id)

Gets ARO groups of user.

Parameters
integer$user_id
Returns
unknown_type
User_Model::get_full_name ( )

Gets full name of user.

Returns
string
User_Model::get_full_name_with_login ( )

Gets full name of user with his login.

Returns
string
User_Model::get_his_username (   $user_id)

Get user's username.

Parameters
integer$user_id
Returns
unknown_type
User_Model::get_his_users_names (   $user_id)

Gets user's usernames.

Parameters
integer$user_id
Returns
unknown_type
User_Model::get_user_by_phone_number_country_code (   $number,
  $country_code 
)

Returns user by phone number and country code.

Author
Michal Kliment
Parameters
string$number
string$country_code
Returns
MySQL_Result object
User_Model::get_user_emails (   $user_id)

Selects all users emails.

Author
Ondřej Fibich
Parameters
integer$user_id
Returns
unknown_type Mysql result
User_Model::get_user_setting (   $key,
  $default = NULL 
)

Get user settings.

Parameters
string$keyKey
Returns
mixed Value
User_Model::get_usernames (   $query)

Gets user's usernames whose name contains given str.

Parameters
integer$query
Returns
unknown_type
User_Model::get_users (   $query)

Gets user whose name contains given str.

Parameters
string$query
Returns
unknown_type
User_Model::get_users_to_sync_vtiger (   $ids,
  $in_set 
)

Function gets selected users.

Parameters
array$ids
boolean$in_set
Author
Jan Dubina
Returns
Mysql_Result
User_Model::is_user_in_aro_group (   $user_id,
  $aro_group 
)

Checks if user is in ARO group.

Parameters
int$user_idUser ID
int$aro_groupARO Group
Returns
int
User_Model::login_request (   $username = '',
  $password = '' 
)

Login test function.

Parameters
string$username
string$password
Returns
boolean
User_Model::phone_exist (   $phone,
  $user_id = null 
)

Tests if phone exist.

Parameters
string$phone
numeric$user_id
Returns
boolean
User_Model::select_list_grouped (   $optgroup = TRUE)

Gets array of users for selectbox.

Returns
array[string]
User_Model::set_user_setting (   $key,
  $value 
)

Sets user settings.

Parameters
string$keyKey
mixed$valueValue
User_Model::username_exist (   $username,
  $user_id = null 
)

Tests if username exist.

Parameters
string$username
numeric$user_id
Returns
boolean

Member Data Documentation

User_Model::$arr_sql
static
Initial value:
array
(
'id' => 'u.id',
'name' => 'u.name',
'surname' => 'u.surname',
'login' => 'u.login',
'member_name' => 'm.name',
'email' => 'c.value'
)
User_Model::$has_and_belongs_to_many
protected
Initial value:
array
(
'clouds',
'users_contacts' => 'contacts',
)
User_Model::$has_many
protected
Initial value:
array
(
'jobs', 'devices', 'logs', 'phone_invoices_users', 'sms_messages',
'users' => 'private_phone_contacts', 'users_keys', 'device_admins',
'device_engineers', 'connection_requests'
)

The documentation for this class was generated from the following file: