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 and check also his password. 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_session_var () | |
put user_login into Postgres config (session), it can be used for tracking users activities 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 to the folder NOT repository More... | |
user's email More... | |
$first_name | |
$id | |
in account_repository , ac_users.use_id More... | |
$lang | |
user's language More... | |
$last_name | |
user's last_name More... | |
$login | |
login lower case More... | |
$name | |
$password | |
md5 of the password More... | |
$theme | |
user's CSS Theme 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 noalyss_user.class.php.
Noalyss_User::__construct | ( | $p_cn, | |
$p_id = -1 |
|||
) |
Definition at line 52 of file noalyss_user.class.php.
References $p_id, connect_user(), db, load(), and set_session_var().
Noalyss_User::__toString | ( | ) |
Definition at line 78 of file noalyss_user.class.php.
Noalyss_User::Admin | ( | ) |
synomym for isAdmin,
Definition at line 663 of file noalyss_user.class.php.
Noalyss_User::audit | ( | $action = 'AUDIT' , |
|
$p_module = "" |
|||
) |
Definition at line 1399 of file noalyss_user.class.php.
|
static |
Audit action from the administration menu.
$p_module | description of the action |
Definition at line 1385 of file noalyss_user.class.php.
Noalyss_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 1518 of file noalyss_user.class.php.
Noalyss_User::can_connect | ( | ) |
check the password and user
Definition at line 85 of file noalyss_user.class.php.
References $cn.
Referenced by Check(), and connect_user().
Noalyss_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 1555 of file noalyss_user.class.php.
Noalyss_User::can_print | ( | $p_action, | |
$p_js = 0 |
|||
) |
Definition at line 1098 of file noalyss_user.class.php.
Noalyss_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 1574 of file noalyss_user.class.php.
Noalyss_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 1613 of file noalyss_user.class.php.
Noalyss_User::can_request | ( | $p_action, | |
$p_js = 0 |
|||
) |
Definition at line 1049 of file noalyss_user.class.php.
Noalyss_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 1536 of file noalyss_user.class.php.
Noalyss_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 1592 of file noalyss_user.class.php.
Noalyss_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 424 of file noalyss_user.class.php.
References $cn, $from, $password, $r, $res, $ret, $sql, can_connect(), DatabaseCore\fetch_array(), load_global_pref(), name, and DatabaseCore\num_row().
Noalyss_User::check_action | ( | $p_action_id | ) |
Check if an user is allowed to do an action.
p_action_id |
Definition at line 871 of file noalyss_user.class.php.
Noalyss_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 1228 of file noalyss_user.class.php.
Noalyss_User::check_jrn | ( | $p_jrn | ) |
check the access of an user on a ledger
$p_jrn | the ledger id |
Definition at line 1212 of file noalyss_user.class.php.
Noalyss_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 842 of file noalyss_user.class.php.
Noalyss_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 1079 of file noalyss_user.class.php.
|
static |
clean the sessions
Definition at line 1859 of file noalyss_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 97 of file noalyss_user.class.php.
References $access_mode, $admin, $cn, $first_name, $http, $lang, $login, $name, $sql, $user_password, can_connect(), clean_session(), DatabaseCore\escape_string(), exit, load(), load_global_pref(), and redirect().
Referenced by __construct().
Noalyss_User::get_access_mode | ( | ) |
access_mode tells what mode must be used : pc or mobile
Definition at line 172 of file noalyss_user.class.php.
References $access_mode.
Noalyss_User::get_available_folder | ( | $p_filter = "" | ) |
Get all the available folders for the users, checked with the security.
$p_filter |
Definition at line 1342 of file noalyss_user.class.php.
Noalyss_User::get_available_repository | ( | $p_access = 'R' | ) |
return array of available repository
$p_access | R for read W for write |
Definition at line 1142 of file noalyss_user.class.php.
Noalyss_User::get_exercice | ( | ) |
Definition at line 1029 of file noalyss_user.class.php.
Noalyss_User::get_first_week_day | ( | ) |
Definition at line 1844 of file noalyss_user.class.php.
References $result, and save_global_preference().
Noalyss_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 491 of file noalyss_user.class.php.
Noalyss_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 579 of file noalyss_user.class.php.
Noalyss_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 548 of file noalyss_user.class.php.
Noalyss_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 645 of file noalyss_user.class.php.
Noalyss_User::get_limit_current_exercice | ( | ) |
return the first date and the last date of the current exercice for the current user
Definition at line 1254 of file noalyss_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 1186 of file noalyss_user.class.php.
Noalyss_User::get_mini_report | ( | ) |
return the mini rapport to display on the welcome page
Definition at line 753 of file noalyss_user.class.php.
Noalyss_User::get_periode | ( | ) |
Get the default periode from the user's preferences.
Definition at line 736 of file noalyss_user.class.php.
Noalyss_User::get_preference | ( | ) |
Get the default user's preferences.
Definition at line 810 of file noalyss_user.class.php.
Noalyss_User::get_profile | ( | ) |
return the profile (p_id)
Definition at line 1441 of file noalyss_user.class.php.
Noalyss_User::get_readable_profile | ( | ) |
return array of readable action_profile
Definition at line 1484 of file noalyss_user.class.php.
Noalyss_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 1809 of file noalyss_user.class.php.
References db.
Noalyss_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 1773 of file noalyss_user.class.php.
References db.
Noalyss_User::get_writable_profile | ( | ) |
return array of writable action_profile
Definition at line 1474 of file noalyss_user.class.php.
Noalyss_User::getActive | ( | ) |
Noalyss_User::getAdmin | ( | ) |
Definition at line 221 of file noalyss_user.class.php.
References $admin.
Noalyss_User::getDb | ( | ) |
Noalyss_User::getEmail | ( | ) |
Noalyss_User::getFirstName | ( | ) |
Definition at line 253 of file noalyss_user.class.php.
References $first_name.
Noalyss_User::getId | ( | ) |
Definition at line 189 of file noalyss_user.class.php.
References $id.
Noalyss_User::getLogin | ( | ) |
Noalyss_User::getName | ( | ) |
Definition at line 269 of file noalyss_user.class.php.
References $name.
Noalyss_User::getPassword | ( | ) |
Noalyss_User::getValid | ( | ) |
Definition at line 237 of file noalyss_user.class.php.
References $valid.
|
static |
Grant access to folder, grant administrator profile , all the ledgers and all the action.
Definition at line 1701 of file noalyss_user.class.php.
Noalyss_User::insert | ( | ) |
Definition at line 403 of file noalyss_user.class.php.
References $cn.
Noalyss_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 961 of file noalyss_user.class.php.
Noalyss_User::is_local_admin | ( | $p_dossier = -1 | ) |
Check if an user is an local administrator.
$p_dossier | : dossier_id |
Definition at line 1131 of file noalyss_user.class.php.
Noalyss_User::isAdmin | ( | ) |
Check if an user is an admin and check also his password.
Definition at line 673 of file noalyss_user.class.php.
Noalyss_User::load | ( | ) |
Definition at line 352 of file noalyss_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().
Noalyss_User::load_global_pref | ( | ) |
Get the global preferences from user_global_pref in the account_repository db.
Definition at line 909 of file noalyss_user.class.php.
Referenced by Check(), and connect_user().
Noalyss_User::password_to_session | ( | ) |
|
static |
Definition at line 1736 of file noalyss_user.class.php.
|
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 1677 of file noalyss_user.class.php.
Noalyss_User::save | ( | ) |
Definition at line 392 of file noalyss_user.class.php.
Noalyss_User::save_email | ( | $p_email | ) |
Save the password from PREFERENCE MODULE.
type | $p_email |
Definition at line 1664 of file noalyss_user.class.php.
Noalyss_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 786 of file noalyss_user.class.php.
Referenced by get_first_week_day().
Noalyss_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 1642 of file noalyss_user.class.php.
Noalyss_User::save_profile | ( | $p_id | ) |
Definition at line 1423 of file noalyss_user.class.php.
Noalyss_User::set_access_mode | ( | $access_mode | ) |
access_mode tells what mode must be used : pc or mobile
Definition at line 180 of file noalyss_user.class.php.
References $access_mode.
|
private |
Definition at line 698 of file noalyss_user.class.php.
Noalyss_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 514 of file noalyss_user.class.php.
Noalyss_User::set_mini_report | ( | $p_id | ) |
set the mini rapport to display on the welcome page
Definition at line 763 of file noalyss_user.class.php.
Noalyss_User::set_periode | ( | $p_periode | ) |
Set the selected periode in the user's preferences.
$p_periode | periode | |
- | $p_user |
Definition at line 692 of file noalyss_user.class.php.
Noalyss_User::set_session_var | ( | ) |
put user_login into Postgres config (session), it can be used for tracking users activities
Definition at line 72 of file noalyss_user.class.php.
References db, and DatabaseCore\escape_string().
Referenced by __construct().
Noalyss_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 1823 of file noalyss_user.class.php.
Noalyss_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 1787 of file noalyss_user.class.php.
Noalyss_User::setActive | ( | $active | ) |
Noalyss_User::setAdmin | ( | $admin | ) |
default | int | mixed | string | string[] | null | $admin |
Definition at line 229 of file noalyss_user.class.php.
References $admin.
Noalyss_User::setDb | ( | $db | ) |
Noalyss_User::setEmail | ( | ) |
Noalyss_User::setFirstName | ( | $first_name | ) |
default | mixed | string | string[] | null | $first_name |
Definition at line 261 of file noalyss_user.class.php.
References $first_name.
Noalyss_User::setId | ( | int | $id | ) |
Noalyss_User::setLogin | ( | string | $login | ) |
Noalyss_User::setName | ( | $name | ) |
Noalyss_User::setPassword | ( | $password | ) |
mixed | $password |
Definition at line 325 of file noalyss_user.class.php.
References $password.
Noalyss_User::setValid | ( | int | $valid | ) |
Noalyss_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 1273 of file noalyss_user.class.php.
Noalyss_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 1497 of file noalyss_user.class.php.
Noalyss_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 1456 of file noalyss_user.class.php.
Noalyss_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 1004 of file noalyss_user.class.php.
Noalyss_User::$access_mode |
MOBILE or PC depending if when connecting $login contains @mobile.
Definition at line 48 of file noalyss_user.class.php.
Referenced by connect_user(), get_access_mode(), and set_access_mode().
Noalyss_User::$active |
1 active , 0 disables
Definition at line 44 of file noalyss_user.class.php.
Referenced by getActive(), and setActive().
Noalyss_User::$admin |
is or is not admin
Definition at line 39 of file noalyss_user.class.php.
Referenced by connect_user(), getAdmin(), and setAdmin().
Noalyss_User::$db |
database connx to the folder NOT repository
Definition at line 38 of file noalyss_user.class.php.
Noalyss_User::$email |
user's email
Definition at line 47 of file noalyss_user.class.php.
Referenced by getEmail(), and setEmail().
Noalyss_User::$first_name |
Definition at line 41 of file noalyss_user.class.php.
Referenced by connect_user(), getFirstName(), and setFirstName().
Noalyss_User::$id |
in account_repository , ac_users.use_id
Definition at line 36 of file noalyss_user.class.php.
Noalyss_User::$lang |
Noalyss_User::$last_name |
user's last_name
Definition at line 42 of file noalyss_user.class.php.
Noalyss_User::$login |
login lower case
Definition at line 45 of file noalyss_user.class.php.
Referenced by connect_user(), getLogin(), and setLogin().
Noalyss_User::$name |
Definition at line 43 of file noalyss_user.class.php.
Referenced by connect_user(), getName(), remove_inexistant_user(), and setName().
Noalyss_User::$password |
md5 of the password
Definition at line 46 of file noalyss_user.class.php.
Referenced by Check(), getPassword(), and setPassword().
Noalyss_User::$theme |
user's CSS Theme
Definition at line 50 of file noalyss_user.class.php.
Noalyss_User::$valid |
is or is not valid
Definition at line 40 of file noalyss_user.class.php.
Referenced by getValid(), and setValid().