noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
|
Data & function about connected users. More...
Public Member Functions | |
__construct ($p_cn, $p_id=-1) | |
Create an user , load an existing one or if p_id == -1 search for the connected user. | |
__toString () | |
Admin () | |
synomym for isAdmin, | |
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. | |
can_connect () | |
check the password and user | |
can_delete_action ($dtoc) | |
Check if the profile of the user can write AND delete for this profile. | |
can_print ($p_action, $p_js=0) | |
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit. | |
can_read_action ($dtoc) | |
Check if the profile of the user can write for this profile. | |
can_read_repo ($p_repo) | |
Check if the profile of the user can read for this repository. | |
can_request ($p_action, $p_js=0) | |
Check if the user can access otherwise warn and exit. | |
can_write_action ($dtoc) | |
Check if the profile of the user can write for this profile. | |
can_write_repo ($p_repo) | |
Check if the profile of the user can write for this repository. | |
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. | |
check_action ($p_action_id) | |
Check if an user is allowed to do an action. | |
check_dossier ($p_dossier_id, $silent=false) | |
check if an user can access a folder, if he cannot display a dialog box and exit | |
check_jrn ($p_jrn) | |
check the access of an user on a ledger | |
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. | |
check_print ($p_action) | |
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit. | |
get_access_mode () | |
access_mode tells what mode must be used : pc or mobile | |
get_available_folder ($p_filter="") | |
Get all the available folders for the users, checked with the security. | |
get_available_repository ($p_access='R') | |
return array of available repository | |
get_exercice () | |
Return the year of current Periode it is the parm_periode.p_exercice col if an error occurs return 0. | |
get_first_week_day () | |
first day in calendar | |
get_folder_access ($p_dossier=0) | |
return the access to a folder, | |
get_ledger ($p_type='ALL', $p_access=3, $disable=TRUE) | |
get all the available ledgers for the current user | |
get_ledger_access ($p_ledger) | |
check that a user is valid and the access to the folder | |
get_ledger_sql ($p_type='ALL', $p_access=3) | |
return an sql condition for filtering the permitted ledger | |
get_limit_current_exercice () | |
return the first date and the last date of the current exercice for the current user | |
get_periode () | |
Get the default periode from the user's preferences. | |
get_preference () | |
Get the default user's preferences. | |
get_profile () | |
return the profile (p_id) | |
get_readable_profile () | |
return array of readable action_profile | |
get_status_security_action () | |
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0. | |
get_status_security_ledger () | |
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0. | |
get_vat_code_preference () | |
Get preference , either the user see the numeric id for VAT or its code, if the preference doesn't exist by default , 0 is saved in ACCOUNT_REPOSITORY. | |
get_writable_profile () | |
return array of writable action_profile | |
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 | |
is_local_admin ($p_dossier=-1) | |
Check if an user is an local administrator. | |
isAdmin () | |
Check if an user is an admin and check also his password. | |
load () | |
load_global_pref () | |
Get the global preferences from user_global_pref in the account_repository db. | |
password_to_session () | |
store the password in session | |
save () | |
save_email ($p_email) | |
Save the password from PREFERENCE MODULE. | |
save_global_preference ($key, $value) | |
Save the preference , the scope is global, the settings are saved into account_repository. | |
save_password ($p_pass1, $p_pass2) | |
Save the password of the current user. | |
save_profile ($p_id) | |
set_access_mode ($access_mode) | |
access_mode tells what mode must be used : pc or mobile | |
set_folder_access ($db_id, $priv) | |
save the access of a folder | |
set_periode ($p_periode) | |
Set the selected periode in the user's preferences. | |
set_session_var () | |
put user_login into Postgres config (session), it can be used for tracking users activities | |
set_status_security_action ($p_value) | |
Set the flag in the table user_active_security. | |
set_status_security_ledger ($p_value) | |
Set the flag in the table user_active_security. | |
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. | |
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. | |
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. | |
update_global_pref ($p_type, $p_value="") | |
update default pref if value is not given then use the default value | |
Static Public Member Functions | |
static | audit_admin ($p_module) |
Audit action from the administration menu. | |
static | clean_session () |
clean the sessions | |
static | get_list ($p_dossier) |
return an array with all the active users who can access $p_dossier including the global admin. | |
static | grant_admin_access ($p_login, $p_dossier) |
Grant access to folder, grant administrator profile , all the ledgers and all the action. | |
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. | |
Data Fields | |
$access_mode | |
MOBILE or PC depending if when connecting $login contains @mobile. | |
$active | |
1 active , 0 disables | |
$admin | |
is or is not admin | |
$db | |
database connx to the folder NOT repository | |
user's email | |
$first_name | |
$id | |
in account_repository , ac_users.use_id | |
$lang | |
user's language | |
$last_name | |
user's last_name | |
$login | |
login lower case | |
$name | |
$password | |
md5 of the password | |
$theme | |
user's CSS Theme | |
$valid | |
is or is not valid | |
Private Member Functions | |
connect_user () | |
connect the user and set the $_SESSION variables if not set thanks the $_REQUEST | |
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 ) |
Create an user , load an existing one or if p_id == -1 search for the connected user.
To have an empty user, give a p_id smaller than -1 or zero.
$p_cn | DatabaseCore connection |
$p_id | if -1 then load the current user, > 0 load the user , = 0 (or < -1 ) means an empty user |
Definition at line 59 of file noalyss_user.class.php.
References $p_id, connect_user(), db, load(), and set_session_var().
Noalyss_User::__toString | ( | ) |
Definition at line 85 of file noalyss_user.class.php.
Noalyss_User::Admin | ( | ) |
synomym for isAdmin,
Definition at line 669 of file noalyss_user.class.php.
Noalyss_User::audit | ( | $action = 'AUDIT', | |
$p_module = "" ) |
Definition at line 1377 of file noalyss_user.class.php.
|
static |
Audit action from the administration menu.
$p_module | description of the action |
Definition at line 1363 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 1496 of file noalyss_user.class.php.
Noalyss_User::can_connect | ( | ) |
check the password and user
Definition at line 92 of file noalyss_user.class.php.
References $cn.
Referenced by Check().
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 1534 of file noalyss_user.class.php.
Noalyss_User::can_print | ( | $p_action, | |
$p_js = 0 ) |
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit.
$p_action | requested action |
Definition at line 1076 of file noalyss_user.class.php.
References h2().
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 1553 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 1592 of file noalyss_user.class.php.
Noalyss_User::can_request | ( | $p_action, | |
$p_js = 0 ) |
Check if the user can access otherwise warn and exit.
$p_action | requested action |
$p_js | = 1 javascript, or 0 just a text or 2 to log it silently |
Definition at line 1026 of file noalyss_user.class.php.
References h2().
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 1515 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 1571 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 431 of file noalyss_user.class.php.
References $cn, $from, $r, $res, $ret, $sql, can_connect(), DatabaseCore\fetch_array(), if, 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 846 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 1206 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 1190 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 817 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 1056 of file noalyss_user.class.php.
|
static |
clean the sessions
Definition at line 1839 of file noalyss_user.class.php.
References $value.
|
private |
connect the user and set the $_SESSION variables if not set thanks the $_REQUEST
Definition at line 104 of file noalyss_user.class.php.
References $access_mode, $login, and if.
Referenced by __construct().
Noalyss_User::get_access_mode | ( | ) |
access_mode tells what mode must be used : pc or mobile
Definition at line 179 of file noalyss_user.class.php.
Noalyss_User::get_available_folder | ( | $p_filter = "" | ) |
Get all the available folders for the users, checked with the security.
$p_filter |
Definition at line 1320 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 1120 of file noalyss_user.class.php.
Noalyss_User::get_exercice | ( | ) |
Return the year of current Periode it is the parm_periode.p_exercice col if an error occurs return 0.
Definition at line 1005 of file noalyss_user.class.php.
Noalyss_User::get_first_week_day | ( | ) |
first day in calendar
Definition at line 1824 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 498 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 585 of file noalyss_user.class.php.
References ALL.
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 554 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 651 of file noalyss_user.class.php.
References ALL, and jrn_def_id.
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 1232 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 1164 of file noalyss_user.class.php.
Noalyss_User::get_periode | ( | ) |
Get the default periode from the user's preferences.
Definition at line 742 of file noalyss_user.class.php.
Noalyss_User::get_preference | ( | ) |
Get the default user's preferences.
Definition at line 785 of file noalyss_user.class.php.
Noalyss_User::get_profile | ( | ) |
return the profile (p_id)
Definition at line 1419 of file noalyss_user.class.php.
Noalyss_User::get_readable_profile | ( | ) |
return array of readable action_profile
Definition at line 1462 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 1788 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 1752 of file noalyss_user.class.php.
References db.
Noalyss_User::get_vat_code_preference | ( | ) |
Get preference , either the user see the numeric id for VAT or its code, if the preference doesn't exist by default , 0 is saved in ACCOUNT_REPOSITORY.
Definition at line 1858 of file noalyss_user.class.php.
References $result, and save_global_preference().
Noalyss_User::get_writable_profile | ( | ) |
return array of writable action_profile
Definition at line 1452 of file noalyss_user.class.php.
Noalyss_User::getActive | ( | ) |
Noalyss_User::getAdmin | ( | ) |
Definition at line 228 of file noalyss_user.class.php.
References $admin.
Noalyss_User::getDb | ( | ) |
Noalyss_User::getEmail | ( | ) |
Noalyss_User::getFirstName | ( | ) |
Definition at line 260 of file noalyss_user.class.php.
Noalyss_User::getId | ( | ) |
Definition at line 196 of file noalyss_user.class.php.
References $id.
Noalyss_User::getLogin | ( | ) |
Definition at line 308 of file noalyss_user.class.php.
Noalyss_User::getName | ( | ) |
Definition at line 276 of file noalyss_user.class.php.
References $name.
Noalyss_User::getPassword | ( | ) |
Definition at line 324 of file noalyss_user.class.php.
Noalyss_User::getValid | ( | ) |
Definition at line 244 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 1680 of file noalyss_user.class.php.
Noalyss_User::insert | ( | ) |
Definition at line 410 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 936 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 1109 of file noalyss_user.class.php.
Noalyss_User::isAdmin | ( | ) |
Check if an user is an admin and check also his password.
Definition at line 679 of file noalyss_user.class.php.
Noalyss_User::load | ( | ) |
Definition at line 359 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().
Noalyss_User::load_global_pref | ( | ) |
Get the global preferences from user_global_pref in the account_repository db.
Definition at line 884 of file noalyss_user.class.php.
Referenced by Check().
Noalyss_User::password_to_session | ( | ) |
|
static |
Definition at line 1715 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 1656 of file noalyss_user.class.php.
References from.
Noalyss_User::save | ( | ) |
Definition at line 399 of file noalyss_user.class.php.
Noalyss_User::save_email | ( | $p_email | ) |
Save the password from PREFERENCE MODULE.
type | $p_email |
Definition at line 1643 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 761 of file noalyss_user.class.php.
Referenced by get_first_week_day(), and get_vat_code_preference().
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 1621 of file noalyss_user.class.php.
Noalyss_User::save_profile | ( | $p_id | ) |
Definition at line 1401 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 187 of file noalyss_user.class.php.
References $access_mode.
|
private |
Definition at line 704 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 521 of file noalyss_user.class.php.
References from.
Noalyss_User::set_periode | ( | $p_periode | ) |
Set the selected periode in the user's preferences.
$p_periode | periode | |
- | $p_user |
Definition at line 698 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 79 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 1802 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 1766 of file noalyss_user.class.php.
Noalyss_User::setActive | ( | $active | ) |
Noalyss_User::setAdmin | ( | $admin | ) |
default | int | mixed | string | string[] | null | $admin |
Definition at line 236 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 268 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 332 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 1251 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 1475 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 1434 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 979 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(), and set_access_mode().
Noalyss_User::$active |
1 active , 0 disables
Definition at line 44 of file noalyss_user.class.php.
Referenced by setActive().
Noalyss_User::$admin |
Noalyss_User::$db |
database connx to the folder NOT repository
Definition at line 38 of file noalyss_user.class.php.
Referenced by setDb().
Noalyss_User::$email |
Noalyss_User::$first_name |
Definition at line 41 of file noalyss_user.class.php.
Referenced by setFirstName().
Noalyss_User::$id |
in account_repository , ac_users.use_id
Definition at line 36 of file noalyss_user.class.php.
Referenced by setId().
Noalyss_User::$lang |
user's language
Definition at line 49 of file noalyss_user.class.php.
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(), and setLogin().
Noalyss_User::$name |
Definition at line 43 of file noalyss_user.class.php.
Referenced by remove_inexistant_user(), and setName().
Noalyss_User::$password |
md5 of the password
Definition at line 46 of file noalyss_user.class.php.
Referenced by setPassword().
Noalyss_User::$theme |
user's CSS Theme
Definition at line 50 of file noalyss_user.class.php.
Noalyss_User::$valid |