noalyss
Version-9
|
Data & function about connected users. More...
Public Member Functions | |
__construct ($p_cn, $p_id=-1) | |
__toString () | |
Admin () | |
synomym for isAdmin, More... | |
audit ($action='AUDIT', $p_module="") | |
can_add_action ($p_profile) | |
Check if the current user can add an action in the profile given in parameter. More... | |
can_connect () | |
check the password and user More... | |
can_delete_action ($dtoc) | |
Check if the profile of the user can write AND delete for this profile. More... | |
can_print ($p_action, $p_js=0) | |
can_read_action ($dtoc) | |
Check if the profile of the user can write for this profile. More... | |
can_read_repo ($p_repo) | |
Check if the profile of the user can read for this repository. More... | |
can_request ($p_action, $p_js=0) | |
can_write_action ($dtoc) | |
Check if the profile of the user can write for this profile. More... | |
can_write_repo ($p_repo) | |
Check if the profile of the user can write for this repository. More... | |
Check ($silent=false, $from='') | |
Check if user is active and exists in therepository Automatically redirect, it doesn't check if a user can access a folder. More... | |
check_action ($p_action_id) | |
Check if an user is allowed to do an action. More... | |
check_dossier ($p_dossier_id, $silent=false) | |
check if an user can access a folder, if he cannot display a dialog box and exit More... | |
check_jrn ($p_jrn) | |
check the access of an user on a ledger More... | |
check_module ($p_module) | |
Check if an user can access a module, return 1 if yes, otherwise 0 record in audit log This function works only if user is connected to a Folder. More... | |
check_print ($p_action) | |
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit. More... | |
get_access_mode () | |
access_mode tells what mode must be used : pc or mobile More... | |
get_available_folder ($p_filter="") | |
Get all the available folders for the users, checked with the security. More... | |
get_available_repository ($p_access='R') | |
return array of available repository More... | |
get_exercice () | |
get_first_week_day () | |
get_folder_access ($p_dossier=0) | |
return the access to a folder, More... | |
get_ledger ($p_type='ALL', $p_access=3, $disable=TRUE) | |
get all the available ledgers for the current user More... | |
get_ledger_access ($p_ledger) | |
check that a user is valid and the access to the folder More... | |
get_ledger_sql ($p_type='ALL', $p_access=3) | |
return an sql condition for filtering the permitted ledger More... | |
get_limit_current_exercice () | |
return the first date and the last date of the current exercice for the current user More... | |
get_mini_report () | |
return the mini rapport to display on the welcome page More... | |
get_periode () | |
Get the default periode from the user's preferences. More... | |
get_preference () | |
Get the default user's preferences. More... | |
get_profile () | |
return the profile (p_id) More... | |
get_readable_profile () | |
return array of readable action_profile More... | |
get_status_security_action () | |
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0. More... | |
get_status_security_ledger () | |
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0. More... | |
get_writable_profile () | |
return array of writable action_profile More... | |
getActive () | |
getAdmin () | |
getDb () | |
getEmail () | |
getFirstName () | |
getId () | |
getLogin () | |
getName () | |
getPassword () | |
getValid () | |
insert () | |
insert_default_global_pref ($p_type="", $p_value="") | |
insert default pref if no parameter are given insert all the existing parameter otherwise only the requested More... | |
is_local_admin ($p_dossier=-1) | |
Check if an user is an local administrator. More... | |
isAdmin () | |
Check if an user is an admin. More... | |
load () | |
load_global_pref () | |
Get the global preferences from user_global_pref in the account_repository db. More... | |
password_to_session () | |
store the password in session More... | |
save () | |
save_email ($p_email) | |
Save the password from PREFERENCE MODULE. More... | |
save_global_preference ($key, $value) | |
Save the preference , the scope is global, the settings are saved into account_repository. More... | |
save_password ($p_pass1, $p_pass2) | |
Save the password of the current user. More... | |
save_profile ($p_id) | |
set_access_mode ($access_mode) | |
access_mode tells what mode must be used : pc or mobile More... | |
set_folder_access ($db_id, $priv) | |
save the access of a folder More... | |
set_mini_report ($p_id) | |
set the mini rapport to display on the welcome page More... | |
set_periode ($p_periode) | |
Set the selected periode in the user's preferences. More... | |
set_status_security_action ($p_value) | |
Set the flag in the table user_active_security. More... | |
set_status_security_ledger ($p_value) | |
Set the flag in the table user_active_security. More... | |
setActive ($active) | |
setAdmin ($admin) | |
setDb ($db) | |
setEmail ($email) | |
setFirstName ($first_name) | |
setId (int $id) | |
setLogin (string $login) | |
setName ($name) | |
setPassword ($password) | |
setValid (int $valid) | |
show_dossier ($p_filtre="") | |
Show all the available folder for the users at the login page. More... | |
sql_readable_profile () | |
Compute the SQL string for the readable profile, the subselect for p_id , example p_id in $g_user->sql_readable_profile. More... | |
sql_writable_profile () | |
Compute the SQL string for the writable profile, the subselect for p_id , example p_id in $g_user->sql_writable_profile. More... | |
update_global_pref ($p_type, $p_value="") | |
update default pref if value is not given then use the default value More... | |
Static Public Member Functions | |
static | audit_admin ($p_module) |
Audit action from the administration menu. More... | |
static | clean_session () |
clean the sessions More... | |
static | get_list ($p_dossier) |
return an array with all the active users who can access $p_dossier including the global admin. More... | |
static | grant_admin_access ($p_login, $p_dossier) |
Grant access to folder, grant administrator profile , all the ledgers and all the action. More... | |
static | remove_inexistant_user ($p_dossier) |
static | revoke_access ($p_login, $p_dossier) |
Remove a user and all his privileges So it cannot connect anymore and all his privileges are removed from the dossier. More... | |
Data Fields | |
$access_mode | |
MOBILE or PC depending if when connecting $login contains @mobile. More... | |
$active | |
1 active , 0 disables More... | |
$admin | |
is or is not admin More... | |
$db | |
database connx More... | |
user's email More... | |
$first_name | |
$id | |
in account_repository , ac_users.use_id More... | |
$login | |
login lower case More... | |
$name | |
$password | |
md5 of the password More... | |
$valid | |
is or is not valid More... | |
Private Member Functions | |
connect_user () | |
connect the user and set the $_SESSION variables if not set thanks the $_REQUEST More... | |
set_default_periode () | |
Data & function about connected users.
Definition at line 33 of file user.class.php.
User::__construct | ( | $p_cn, | |
$p_id = -1 |
|||
) |
Definition at line 49 of file user.class.php.
References $p_id, connect_user(), db, and load().
User::__toString | ( | ) |
Definition at line 63 of file user.class.php.
User::Admin | ( | ) |
synomym for isAdmin,
Definition at line 644 of file user.class.php.
User::audit | ( | $action = 'AUDIT' , |
|
$p_module = "" |
|||
) |
Definition at line 1380 of file user.class.php.
|
static |
Audit action from the administration menu.
$p_module | description of the action |
Definition at line 1366 of file user.class.php.
User::can_add_action | ( | $p_profile | ) |
Check if the current user can add an action in the profile given in parameter.
type | $p_profile | profile.p_id = action_gestion.ag_dest |
Definition at line 1499 of file user.class.php.
User::can_connect | ( | ) |
check the password and user
Definition at line 70 of file user.class.php.
References $cn.
Referenced by Check(), and connect_user().
User::can_delete_action | ( | $dtoc | ) |
Check if the profile of the user can write AND delete for this profile.
$dtoc | action_gestion.ag_id |
Definition at line 1536 of file user.class.php.
User::can_print | ( | $p_action, | |
$p_js = 0 |
|||
) |
Definition at line 1079 of file user.class.php.
User::can_read_action | ( | $dtoc | ) |
Check if the profile of the user can write for this profile.
$dtoc | action_gestion.ag_id |
Definition at line 1555 of file user.class.php.
User::can_read_repo | ( | $p_repo | ) |
Check if the profile of the user can read for this repository.
$p_repo | stock_repository.r_id |
Definition at line 1594 of file user.class.php.
User::can_request | ( | $p_action, | |
$p_js = 0 |
|||
) |
Definition at line 1030 of file user.class.php.
User::can_write_action | ( | $dtoc | ) |
Check if the profile of the user can write for this profile.
$dtoc | action_gestion.ag_id |
Definition at line 1517 of file user.class.php.
User::can_write_repo | ( | $p_repo | ) |
Check if the profile of the user can write for this repository.
$p_repo | stock_repository.r_id |
Definition at line 1573 of file user.class.php.
User::Check | ( | $silent = false , |
|
$from = '' |
|||
) |
Check if user is active and exists in therepository Automatically redirect, it doesn't check if a user can access a folder.
$silent | false, echo an error message and exit, true : exit without warning default is false |
++
Definition at line 405 of file user.class.php.
References $cn, $from, $password, $r, $res, $ret, $sql, can_connect(), DatabaseCore\fetch_array(), index, load_global_pref(), name, and DatabaseCore\num_row().
User::check_action | ( | $p_action_id | ) |
Check if an user is allowed to do an action.
p_action_id |
Definition at line 852 of file user.class.php.
User::check_dossier | ( | $p_dossier_id, | |
$silent = false |
|||
) |
check if an user can access a folder, if he cannot display a dialog box and exit
the | folder if |
$silent | false, echo an error message and exit, true : exit without warning default is false |
Definition at line 1209 of file user.class.php.
User::check_jrn | ( | $p_jrn | ) |
check the access of an user on a ledger
$p_jrn | the ledger id |
Definition at line 1193 of file user.class.php.
User::check_module | ( | $p_module | ) |
Check if an user can access a module, return 1 if yes, otherwise 0 record in audit log This function works only if user is connected to a Folder.
string | $p_module | menu_ref.me_code |
Definition at line 823 of file user.class.php.
User::check_print | ( | $p_action | ) |
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit.
$p_action | requested action |
Definition at line 1060 of file user.class.php.
|
static |
clean the sessions
Definition at line 1839 of file user.class.php.
References $value.
Referenced by connect_user().
|
private |
connect the user and set the $_SESSION variables if not set thanks the $_REQUEST
Definition at line 82 of file user.class.php.
References $access_mode, $admin, $cn, $first_name, $http, $login, $name, $sql, $user_password, can_connect(), clean_session(), exit, load(), load_global_pref(), and redirect().
Referenced by __construct().
User::get_access_mode | ( | ) |
access_mode tells what mode must be used : pc or mobile
Definition at line 153 of file user.class.php.
References $access_mode.
User::get_available_folder | ( | $p_filter = "" | ) |
Get all the available folders for the users, checked with the security.
$p_filter |
Definition at line 1323 of file user.class.php.
User::get_available_repository | ( | $p_access = 'R' | ) |
return array of available repository
$p_access | R for read W for write |
Definition at line 1123 of file user.class.php.
User::get_exercice | ( | ) |
Definition at line 1010 of file user.class.php.
User::get_first_week_day | ( | ) |
Definition at line 1824 of file user.class.php.
References $result, and save_global_preference().
User::get_folder_access | ( | $p_dossier = 0 | ) |
return the access to a folder,
$p_dossier | id if it is == 0 then we take the value from $_SESSION |
Definition at line 472 of file user.class.php.
User::get_ledger | ( | $p_type = 'ALL' , |
|
$p_access = 3 , |
|||
$disable = TRUE |
|||
) |
get all the available ledgers for the current user
$p_type | = ALL or the type of the ledger (ACH,VEN,FIN,ODS) |
$p_access | =3 for Read or WRITE, 2 write, 1 for readonly |
(boolean) | $all if true show also inactive |
[0] => [jrn_def_id] [jrn_def_type] [jrn_def_name] [jrn_def_class_deb] [jrn_def_class_cred] [jrn_type_id] [jrn_desc] [uj_priv]
Definition at line 560 of file user.class.php.
User::get_ledger_access | ( | $p_ledger | ) |
check that a user is valid and the access to the folder
$p_ledger | the ledger to check |
Definition at line 529 of file user.class.php.
User::get_ledger_sql | ( | $p_type = 'ALL' , |
|
$p_access = 3 |
|||
) |
return an sql condition for filtering the permitted ledger
$p_type | = ALL or the type of the ledger (ACH,VEN,FIN,ODS) |
$p_access | =3 for READ or WRITE, 2 READ and write, 1 for readonly |
Definition at line 626 of file user.class.php.
User::get_limit_current_exercice | ( | ) |
return the first date and the last date of the current exercice for the current user
Definition at line 1235 of file user.class.php.
|
static |
return an array with all the active users who can access $p_dossier including the global admin.
The user must be activated
$p_dossier | dossier |
throw | an exception if nobody can access |
Definition at line 1167 of file user.class.php.
User::get_mini_report | ( | ) |
return the mini rapport to display on the welcome page
Definition at line 734 of file user.class.php.
User::get_periode | ( | ) |
Get the default periode from the user's preferences.
Definition at line 717 of file user.class.php.
User::get_preference | ( | ) |
Get the default user's preferences.
Definition at line 791 of file user.class.php.
User::get_profile | ( | ) |
User::get_readable_profile | ( | ) |
User::get_status_security_action | ( | ) |
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0.
Definition at line 1789 of file user.class.php.
References db.
User::get_status_security_ledger | ( | ) |
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0.
Definition at line 1753 of file user.class.php.
References db.
User::get_writable_profile | ( | ) |
User::getActive | ( | ) |
User::getAdmin | ( | ) |
Definition at line 202 of file user.class.php.
References $admin.
User::getDb | ( | ) |
User::getEmail | ( | ) |
User::getFirstName | ( | ) |
Definition at line 234 of file user.class.php.
References $first_name.
User::getId | ( | ) |
User::getLogin | ( | ) |
User::getName | ( | ) |
Definition at line 250 of file user.class.php.
References $name.
User::getPassword | ( | ) |
User::getValid | ( | ) |
|
static |
Grant access to folder, grant administrator profile , all the ledgers and all the action.
Definition at line 1681 of file user.class.php.
Referenced by Dossier\synchro_admin().
User::insert | ( | ) |
User::insert_default_global_pref | ( | $p_type = "" , |
|
$p_value = "" |
|||
) |
insert default pref if no parameter are given insert all the existing parameter otherwise only the requested
$p_type | parameter's type or nothing |
$p_value | parameter value |
Definition at line 942 of file user.class.php.
User::is_local_admin | ( | $p_dossier = -1 | ) |
Check if an user is an local administrator.
$p_dossier | : dossier_id |
Definition at line 1112 of file user.class.php.
User::isAdmin | ( | ) |
Check if an user is an admin.
Definition at line 654 of file user.class.php.
User::load | ( | ) |
Definition at line 333 of file user.class.php.
References $cn, $id, $Max, $Res, $row, $sql, $sql_array, DatabaseCore\fetch_array(), name, and DatabaseCore\num_row().
Referenced by __construct(), and connect_user().
User::load_global_pref | ( | ) |
Get the global preferences from user_global_pref in the account_repository db.
Definition at line 890 of file user.class.php.
Referenced by Check(), and connect_user().
User::password_to_session | ( | ) |
store the password in session
Definition at line 1612 of file user.class.php.
|
static |
Definition at line 1716 of file user.class.php.
References $i, $name, and $nb.
Referenced by Dossier\upgrade().
|
static |
Remove a user and all his privileges So it cannot connect anymore and all his privileges are removed from the dossier.
Definition at line 1657 of file user.class.php.
User::save | ( | ) |
Definition at line 373 of file user.class.php.
User::save_email | ( | $p_email | ) |
Save the password from PREFERENCE MODULE.
type | $p_email |
Definition at line 1644 of file user.class.php.
User::save_global_preference | ( | $key, | |
$value | |||
) |
Save the preference , the scope is global, the settings are saved into account_repository.
$key | THEME, LANG , PAGESIZE |
$value | value of the key |
Definition at line 767 of file user.class.php.
Referenced by get_first_week_day().
User::save_password | ( | $p_pass1, | |
$p_pass2 | |||
) |
Save the password of the current user.
string | $p_pass1 | password (clear) |
string | $p_pass2 | for confirming password (clear) |
Definition at line 1622 of file user.class.php.
User::save_profile | ( | $p_id | ) |
User::set_access_mode | ( | $access_mode | ) |
access_mode tells what mode must be used : pc or mobile
Definition at line 161 of file user.class.php.
References $access_mode.
|
private |
Definition at line 679 of file user.class.php.
User::set_folder_access | ( | $db_id, | |
$priv | |||
) |
save the access of a folder
$db_id | the dossier id |
$priv | boolean, true then it is granted, false it is removed |
Definition at line 495 of file user.class.php.
User::set_mini_report | ( | $p_id | ) |
set the mini rapport to display on the welcome page
Definition at line 744 of file user.class.php.
User::set_periode | ( | $p_periode | ) |
Set the selected periode in the user's preferences.
$p_periode | periode | |
- | $p_user |
Definition at line 673 of file user.class.php.
User::set_status_security_action | ( | $p_value | ) |
Set the flag in the table user_active_security.
int | $p_value | 1==enable , 0 = disable @exceptions invalid value |
Definition at line 1803 of file user.class.php.
References db.
User::set_status_security_ledger | ( | $p_value | ) |
Set the flag in the table user_active_security.
int | $p_value | 1==enable , 0 = disable @exceptions invalid value |
Definition at line 1767 of file user.class.php.
References db.
User::setActive | ( | $active | ) |
User::setAdmin | ( | $admin | ) |
default | int | mixed | string | string[] | null | $admin |
Definition at line 210 of file user.class.php.
References $admin.
User::setDb | ( | $db | ) |
User::setEmail | ( | ) |
User::setFirstName | ( | $first_name | ) |
default | mixed | string | string[] | null | $first_name |
Definition at line 242 of file user.class.php.
References $first_name.
User::setId | ( | int | $id | ) |
User::setLogin | ( | string | $login | ) |
User::setName | ( | $name | ) |
User::setPassword | ( | $password | ) |
User::setValid | ( | int | $valid | ) |
User::show_dossier | ( | $p_filtre = "" | ) |
Show all the available folder for the users at the login page.
For the special case 'E' go directly to extension and bypasse the dashboard
$p_filtre | user |
Definition at line 1254 of file user.class.php.
User::sql_readable_profile | ( | ) |
Compute the SQL string for the readable profile, the subselect for p_id , example p_id in $g_user->sql_readable_profile.
The administrator can read all the profiles
Definition at line 1478 of file user.class.php.
User::sql_writable_profile | ( | ) |
Compute the SQL string for the writable profile, the subselect for p_id , example p_id in $g_user->sql_writable_profile.
The administrator can access all the profiles R = Read Only W = Write and delete O = write and not delete
Definition at line 1437 of file user.class.php.
User::update_global_pref | ( | $p_type, | |
$p_value = "" |
|||
) |
update default pref if value is not given then use the default value
$p_type | parameter's type |
$p_value | parameter's value value of the type |
Definition at line 985 of file user.class.php.
User::$access_mode |
MOBILE or PC depending if when connecting $login contains @mobile.
Definition at line 47 of file user.class.php.
Referenced by connect_user(), get_access_mode(), and set_access_mode().
User::$active |
1 active , 0 disables
Definition at line 43 of file user.class.php.
Referenced by getActive(), and setActive().
User::$admin |
is or is not admin
Definition at line 39 of file user.class.php.
Referenced by connect_user(), getAdmin(), and setAdmin().
User::$db |
User::$email |
user's email
Definition at line 46 of file user.class.php.
Referenced by getEmail(), and setEmail().
User::$first_name |
Definition at line 41 of file user.class.php.
Referenced by connect_user(), getFirstName(), and setFirstName().
User::$id |
in account_repository , ac_users.use_id
Definition at line 36 of file user.class.php.
User::$login |
login lower case
Definition at line 44 of file user.class.php.
Referenced by connect_user(), getLogin(), and setLogin().
User::$name |
Definition at line 42 of file user.class.php.
Referenced by connect_user(), getName(), remove_inexistant_user(), and setName().
User::$password |
md5 of the password
Definition at line 45 of file user.class.php.
Referenced by Check(), getPassword(), and setPassword().
User::$valid |
is or is not valid
Definition at line 40 of file user.class.php.
Referenced by getValid(), and setValid().