noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Noalyss_User Class Reference

Data & function about connected users. More...

+ Collaboration diagram for Noalyss_User:

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
 
 $email
 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 ()
 

Detailed Description

Data & function about connected users.

Definition at line 33 of file noalyss_user.class.php.

Constructor & Destructor Documentation

◆ __construct()

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.

Parameters
$p_cnDatabaseCore connection
$p_idif -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.

60 {
61 $this->db=$p_cn;
62 // if p_id is not set then check the connected user
63 if ($p_id==-1)
64 {
65 $this->connect_user();
66 $this->set_session_var();
67 }
68 else // if p_id is set get data of another user
69 {
70 $this->id=$p_id;
71 $this->load();
72 }
73 }
set_session_var()
put user_login into Postgres config (session), it can be used for tracking users activities
connect_user()
connect the user and set the $_SESSION variables if not set thanks the $_REQUEST
$SecUser db

References $p_id, connect_user(), db, load(), and set_session_var().

+ Here is the call graph for this function:

Member Function Documentation

◆ __toString()

Noalyss_User::__toString ( )

Definition at line 85 of file noalyss_user.class.php.

85 : string
86 {
87 return "User ".print_r($this,true);
88 }

◆ Admin()

Noalyss_User::Admin ( )

synomym for isAdmin,

Deprecated

Definition at line 669 of file noalyss_user.class.php.

669 :int
670 {
671 return $this->isAdmin();
672 }
isAdmin()
Check if an user is an admin and check also his password.

◆ audit()

Noalyss_User::audit ( $action = 'AUDIT',
$p_module = "" )

Definition at line 1377 of file noalyss_user.class.php.

1378 {
1379 global $audit;
1380 if ($audit)
1381 {
1382 if ($p_module==""&&isset($_REQUEST['ac']))
1383 {
1384 $p_module=$_REQUEST['ac'];
1385 }
1386 $cn=new Database();
1387 if (isset($_REQUEST['gDossier']))
1388 $p_module.=" dossier : ".$_REQUEST['gDossier'];
1389 $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
1390
1391 $cn->exec_sql($sql,
1392 array(
1393 $_SESSION[SESSION_KEY.'g_user'],
1394 $_SERVER["REMOTE_ADDR"],
1395 $p_module,
1396 $_SERVER['REQUEST_URI'],
1397 $action));
1398 }
1399 }
$_REQUEST['ac']

◆ audit_admin()

static Noalyss_User::audit_admin ( $p_module)
static

Audit action from the administration menu.

Parameters
$p_moduledescription of the action

Definition at line 1363 of file noalyss_user.class.php.

1364 {
1365 $cn=new Database();
1366 $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
1367
1368 $cn->exec_sql($sql,
1369 array(
1370 $_SESSION[SESSION_KEY.'g_user'],
1371 $_SERVER["REMOTE_ADDR"],
1372 $p_module,
1373 $_SERVER['REQUEST_URI'],
1374 'ADMIN'));
1375 }

◆ can_add_action()

Noalyss_User::can_add_action ( $p_profile)

Check if the current user can add an action in the profile given in parameter.

Parameters
type$p_profileprofile.p_id = action_gestion.ag_dest
Returns
boolean

Definition at line 1496 of file noalyss_user.class.php.

1497 {
1498
1499 $r=$this->db->get_value(' select count(*)
1500 from user_sec_action_profile
1501 where p_granted=$2
1502 and p_id=$1', array($this->get_profile(), $p_profile));
1503 if ($r==0)
1504 {
1505 return false;
1506 }
1507 return true;
1508 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
get_profile()
return the profile (p_id)

References from, and p_id.

◆ can_connect()

Noalyss_User::can_connect ( )

check the password and user

Definition at line 92 of file noalyss_user.class.php.

93 {
94 $cn=new \Database();
95 $can_connect=$cn->get_value("select count(*) from ac_users
96 where use_active=1 and
97 use_login=$1 and use_pass=$2",
98 [$this->login,$this->password]);
99 return $can_connect;
100 }

References $cn.

Referenced by Check().

◆ can_delete_action()

Noalyss_User::can_delete_action ( $dtoc)

Check if the profile of the user can write AND delete for this profile.

Parameters
$dtocaction_gestion.ag_id
Returns
true if he can write otherwise false

Definition at line 1534 of file noalyss_user.class.php.

1535 {
1536 if ($this->Admin()==1)
1537 return TRUE;
1538 if ($this->get_status_security_action()==0)
1539 return TRUE;
1540 $profile=$this->get_profile();
1541 $r=$this->db->get_value(" select count(*) from action_gestion where ag_id=$1 and ag_dest in
1542 (select p_granted from user_sec_action_profile where ua_right='W' and p_id=$2) ", array($dtoc, $profile));
1543 if ($r==0)
1544 return FALSE;
1545 return true;
1546 }
get_status_security_action()
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled,...
Admin()
synomym for isAdmin,

◆ can_print()

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.

Parameters
$p_actionrequested action
Returns
nothing the program exits automatically

Definition at line 1076 of file noalyss_user.class.php.

1077 {
1078 if ($this->check_print($p_action)==0)
1079 {
1080 $this->audit('FAIL');
1081 if ($p_js==1)
1082 {
1083 echo create_script("alert_box(content[59])");
1084 }
1085 else
1086 {
1087 echo '<div class="redcontent">';
1088 echo '<h2 class="error">',
1089 htmlspecialchars(_("Cette action ne vous est pas autorisée Contactez votre responsable")),
1090 '</h2>';
1091 echo '</div>';
1092 }
1093 exit(-1);
1094 }
1095 }
_("actif, passif,charge,...")
if(! isset($_GET['submit_query'])) $p_action
audit($action='AUDIT', $p_module="")
check_print($p_action)
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit.
for($e=0; $e< count($afiche); $e++) exit
create_script($p_string)
create the HTML for adding the script tags around of the script

References h2().

+ Here is the call graph for this function:

◆ can_read_action()

Noalyss_User::can_read_action ( $dtoc)

Check if the profile of the user can write for this profile.

Parameters
$dtocaction_gestion.ag_id
Returns
true if he can write otherwise false

Definition at line 1553 of file noalyss_user.class.php.

1554 {
1555 if ($this->Admin()==1)
1556 return true;
1557 $profile=$this->get_profile();
1558 $r=$this->db->get_value(" select count(*) from action_gestion where ag_id=$1 and (ag_dest in
1559 (select p_granted from user_sec_action_profile where p_id=$2) or ag_owner=$3)",
1560 array($dtoc, $profile, $this->login));
1561 if ($r==0)
1562 return false;
1563 return true;
1564 }

◆ can_read_repo()

Noalyss_User::can_read_repo ( $p_repo)

Check if the profile of the user can read for this repository.

Parameters
$p_repostock_repository.r_id
Returns
true if he read write otherwise false

Definition at line 1592 of file noalyss_user.class.php.

1593 {
1594 if ($this->Admin()==1)
1595 return true;
1596 $profile=$this->get_profile();
1597 $r=$this->db->get_value("select count(*)
1598 from profile_sec_repository
1599 where
1600 r_id=$1
1601 and p_id =$2
1602 ", array($p_repo, $profile));
1603 if ($r==0)
1604 return false;
1605 return true;
1606 }

◆ can_request()

Noalyss_User::can_request ( $p_action,
$p_js = 0 )

Check if the user can access otherwise warn and exit.

Parameters
$p_actionrequested action
$p_js= 1 javascript, or 0 just a text or 2 to log it silently
Returns
nothing the program exits automatically

Definition at line 1026 of file noalyss_user.class.php.

1027 {
1028 if ($this->check_action($p_action)==0)
1029 {
1030 $this->audit('FAIL');
1031 if ($p_js==1)
1032 {
1033 echo create_script("alert_box(content[59])");
1034 }
1035 elseif ($p_js==2)
1036 {
1037 record_log(_("Access invalid").$p_action);
1038 }
1039 else
1040 {
1041 echo '<h2 class="error">',
1042 htmlspecialchars(_("Cette action ne vous est pas autorisée Contactez votre responsable")),
1043 '</h2>';
1044 echo '</div>';
1045 }
1046 exit(-1);
1047 }
1048 }
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
check_action($p_action_id)
Check if an user is allowed to do an action.
if( $delta< 0) elseif( $delta==0)

References h2().

+ Here is the call graph for this function:

◆ can_write_action()

Noalyss_User::can_write_action ( $dtoc)

Check if the profile of the user can write for this profile.

Parameters
$dtocaction_gestion.ag_id
Returns
true if he can write otherwise false

Definition at line 1515 of file noalyss_user.class.php.

1516 {
1517 if ($this->Admin()==1)
1518 return TRUE;
1519 if ($this->get_status_security_action()==0)
1520 return TRUE;
1521 $profile=$this->get_profile();
1522 $r=$this->db->get_value(" select count(*) from action_gestion where ag_id=$1 and ag_dest in
1523 (select p_granted from user_sec_action_profile where ua_right in ('W','O') and p_id=$2) ", array($dtoc, $profile));
1524 if ($r==0)
1525 return FALSE;
1526 return true;
1527 }

◆ can_write_repo()

Noalyss_User::can_write_repo ( $p_repo)

Check if the profile of the user can write for this repository.

Parameters
$p_repostock_repository.r_id
Returns
true if he can write otherwise false

Definition at line 1571 of file noalyss_user.class.php.

1572 {
1573 if ($this->Admin()==1)
1574 return true;
1575 $profile=$this->get_profile();
1576 $r=$this->db->get_value("select count(*)
1577 from profile_sec_repository
1578 where
1579 r_id=$1
1580 and p_id =$2
1581 and ur_right='W'", array($p_repo, $profile));
1582 if ($r==0)
1583 return false;
1584 return true;
1585 }

◆ Check()

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.

Parameters
$silentfalse, echo an error message and exit, true : exit without warning default is false

++

Definition at line 431 of file noalyss_user.class.php.

432 {
433
434 $res=0;
435 $pass5=$this->password;
436
437 $cn=new Database();
438 $sql="select ac_users.use_login,ac_users.use_active, ac_users.use_pass,
439 use_admin,use_first_name,use_name
440 from ac_users
441 where ac_users.use_id=$1
442 and ac_users.use_active=1
443 and ac_users.use_pass=$2";
444 $ret=$cn->exec_sql($sql, array($this->id, $pass5));
446 if ($res>0)
447 {
449 $_SESSION[SESSION_KEY.'use_admin']=$r['use_admin'];
450 $_SESSION[SESSION_KEY.'use_name']=$r['use_name'];
451 $_SESSION[SESSION_KEY.'use_first_name']=$r['use_first_name'];
452 $_SESSION[SESSION_KEY.'isValid']=1;
453
454 $this->admin=$_SESSION[SESSION_KEY.'use_admin'];
455 $this->name=$_SESSION[SESSION_KEY.'use_name'];
456 $this->first_name=$_SESSION[SESSION_KEY.'use_first_name'];
457 $this->load_global_pref();
458 }
459 $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
460
461 if ($res==0 || $this->can_connect() == 0)
462 {
463 $cn->exec_sql($sql,
464 array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"],
465 $from, $_SERVER['REQUEST_URI'], 'FAIL'));
466 if (!$silent)
467 {
468 echo '<script> alert(\''._('Utilisateur ou mot de passe incorrect').'\')</script>';
469 redirect('index.html');
470 }
471 $this->valid=0;
472 session_unset();
473 exit-1;
474 }
475 else
476 {
477 if ($from=='LOGIN' || $from=='PORTAL')
478 {
479 $cn->exec_sql($sql,
480 array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"], $from,
481 $_SERVER['REQUEST_URI'], 'SUCCESS'));
482 }
483 $this->valid=1;
484 }
485
486 return $ret;
487 }
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
$from
$from_poste name
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
$password
md5 of the password
load_global_pref()
Get the global preferences from user_global_pref in the account_repository db.
can_connect()
check the password and user

References $cn, $from, $r, $res, $ret, $sql, can_connect(), DatabaseCore\fetch_array(), if, load_global_pref(), name, and DatabaseCore\num_row().

+ Here is the call graph for this function:

◆ check_action()

Noalyss_User::check_action ( $p_action_id)

Check if an user is allowed to do an action.

Parameters
p_action_id
Returns
  • 0 no priv

Definition at line 846 of file noalyss_user.class.php.

847 {
848 /* save it into the log */
849 global $audit;
850 if ($this->Admin()==1)
851 return 1;
852 if ($this->is_local_admin(dossier::id())==1)
853 return 1;
854 if ($this->get_status_security_action()==0)
855 return 1;
856 $Res=$this->db->exec_sql(
857 "select * from user_sec_act where ua_login=$1 and ua_act_id=$2", array($this->login, $p_action_id));
858 $Count=Database::num_row($Res);
859 if ($Count==0)
860 {
861 if (isset($audit)&&$audit==true)
862 {
863 $cn=new Database();
864 $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
865 $cn->exec_sql($sql,
866 array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"], $p_action_id, $_SERVER['REQUEST_URI'],
867 'FAIL'));
868 }
869 return 0;
870 }
871 if ($Count==1)
872 return 1;
873 echo_error(_("Action invalide"));
874 record_log("User:check_action".sprintf("login %s ua_act_id %s", $this->login, $p_action_id));
875 exit();
876 }
echo_error($p_log, $p_line="", $p_message="")
log error into the /tmp/noalyss_error.log it doesn't work on windows
is_local_admin($p_dossier=-1)
Check if an user is an local administrator.

◆ check_dossier()

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

Parameters
thefolder if
$silentfalse, echo an error message and exit, true : exit without warning default is false
Returns
  • L for administrator (local and global)
  • X no access
  • R regular user

Definition at line 1206 of file noalyss_user.class.php.

1207 {
1208 $this->Admin();
1209 if ($this->admin==1||$this->is_local_admin($p_dossier_id)==1)
1210 return 'L';
1211 $cn=new Database();
1212
1213 $dossier=$cn->get_value("select 'R' from jnt_use_dos where dos_id=$1 and use_id=$2",
1214 array($p_dossier_id, $this->id));
1215 $dossier=($dossier=='')?'X':$dossier;
1216 if ($dossier=='X')
1217 {
1218 $this->audit('FAIL', "Access folder ");
1219 if (!$silent)
1220 {
1221 alert(_('Dossier non accessible'));
1222 exit();
1223 }
1224 }
1225 return $dossier;
1226 }
alert($p_msg, $buffer=false)
alert in javascript

◆ check_jrn()

Noalyss_User::check_jrn ( $p_jrn)

check the access of an user on a ledger

Parameters
$p_jrnthe ledger id
Returns
  • O only predefined operation
  • W write
  • R read only
  • X no access

Definition at line 1190 of file noalyss_user.class.php.

1191 {
1192 return $this->get_ledger_access($p_jrn);
1193 }
get_ledger_access($p_ledger)
check that a user is valid and the access to the folder

◆ check_module()

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.

Parameters
string$p_modulemenu_ref.me_code
Returns
0 for FORBIDDEN, 1 for GRANTED

Definition at line 817 of file noalyss_user.class.php.

818 {
819 if ( $this->access_mode == "PC") {
820
821 $acc=$this->db->get_value("select count(*) from v_all_menu where p_id = $1
822 and me_code=$2", array($this->get_profile(), $p_module));
823 } elseif ($this->access_mode=="MOBILE") {
824 $acc=$this->db->get_value("select count(*) from profile_mobile where p_id=$1 and me_code=$2",
825 array($this->get_profile(), $p_module));
826 } else {
827 throw new Exception("USER:823:ACCESS_MODE INCONNU");
828 }
829 if ($acc==0)
830 {
831 $this->audit("FAIL", $p_module);
832 return 0;
833 }
834 $this->audit("SUCCESS", $p_module);
835 return 1;
836 }

◆ check_print()

Noalyss_User::check_print ( $p_action)

Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit.

Parameters
$p_actionrequested action
Returns
nothing the program exits automatically

Definition at line 1056 of file noalyss_user.class.php.

1057 {
1058 global $audit, $cn;
1059 $this->audit('AUDIT', $p_action);
1060 if ($this->Admin()==1)
1061 return 1;
1062
1063 $res=$cn->get_value("select count(*) from profile_menu
1064 join profile_user using (p_id)
1065 where user_name=$1 and me_code=$2 ", array($this->login, $p_action));
1066 return $res;
1067 }

◆ clean_session()

static Noalyss_User::clean_session ( )
static

clean the sessions

Definition at line 1839 of file noalyss_user.class.php.

1840 {
1841
1842 $aSession=$_SESSION;
1843 foreach($aSession as $key => $value) {
1844 if(DEBUGNOALYSS>1) { echo "[$key]=>[$value]";}
1845
1846 if ( strpos($key,SESSION_KEY) === 0) {
1847 unset($_SESSION[$key]);
1848 if(DEBUGNOALYSS>1) { echo "=> [$key] cleaned";}
1849 }
1850 }
1851 }

References $value.

◆ connect_user()

Noalyss_User::connect_user ( )
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.

105 {
106 if (!isset($_SESSION[SESSION_KEY.'g_user']))
107 {
108 $http=new \HttpInput();
109 $user_login=$http->request("p_user", "string", "");
110 $user_password=$http->request("p_pass", "string", "");
111
112 if ($user_login!=""&&$user_password!="")
113 {
114 $_SESSION[SESSION_KEY."g_user"]=$user_login;
115 $_SESSION[SESSION_KEY."g_pass"]=md5($user_password);
116 }
117 else
118 {
119 echo '<h2 class="error">'._('Session expirée<br>Utilisateur déconnecté').'</h2>';
120 redirect('index.php', 1);
121 exit();
122 }
123
124
125 if (strpos($user_login, '@mobile')!=false)
126 {
127 $this->access_mode='MOBILE';
128 $this->login=str_ireplace("@mobile", "", $user_login);
129 }
130 else
131 {
132 $this->access_mode='PC';
133 $this->login=strtolower($user_login);
134 }
135
136 $_SESSION[SESSION_KEY."access_mode"]=$this->access_mode;
137 $_SESSION[SESSION_KEY.'g_user']=$this->login;
138 }
139 $this->login=$_SESSION[SESSION_KEY."g_user"];
140 $this->password=$_SESSION[SESSION_KEY.'g_pass'];
141
142 $this->id=-1;
143 $this->lang=(isset($_SESSION[SESSION_KEY.'g_lang']))?$_SESSION[SESSION_KEY.'g_lang']:'fr_FR.utf8';
144 $this->access_mode=$_SESSION[SESSION_KEY."access_mode"];
145 $cn=new Database();
146
147 // share user login with the repository
148 $cn->exec_sql(sprintf("select set_config('noalyss.user_login','%s',false)",
149 Database::escape_string($_SESSION[SESSION_KEY.'g_user'])));
150
151 if ($this->can_connect() == 0 || $this->load()==-1 )
152 {
153 echo '<h2 class="error">'._('Utilisateur ou mot de passe incorrect').'</h2>';
154 $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
155 $cn->exec_sql($sql,
156 array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"], "DISCON",
157 $_SERVER['REQUEST_URI'], 'FAIL'));
158 $this->clean_session();
159 redirect('logout.php', 1);
160 exit();
161 }
162
163 $this->load_global_pref();
164
165 $_SESSION[SESSION_KEY.'g_lang']=$this->lang;
166 $this->valid=(isset($_SESSION[SESSION_KEY.'isValid']))?1:0;
167 if (isset($_SESSION[SESSION_KEY.'g_theme']))
168 {
169 $this->theme=$_SESSION[SESSION_KEY.'g_theme'];
170 }
171 $_SESSION[SESSION_KEY.'use_admin']=$this->admin;
172 $_SESSION[SESSION_KEY.'use_name']=$this->name;
173 $_SESSION[SESSION_KEY.'use_first_name']=$this->first_name;
174 }
static escape_string($p_string)
wrapper for the function pg_escape_string
$login
login lower case
$lang
user's language
$access_mode
MOBILE or PC depending if when connecting $login contains @mobile.
redirect($p_string, $p_time=0)

References $access_mode, $login, and if.

Referenced by __construct().

◆ get_access_mode()

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.

180 {
181 return $this->access_mode;
182 }

◆ get_available_folder()

Noalyss_User::get_available_folder ( $p_filter = "")

Get all the available folders for the users, checked with the security.

Parameters
$p_filter
Returns
array containing
  • ac_dossier.dos_id
  • ac_dossier.dos_name
  • ac_dossier.dos_description

Definition at line 1320 of file noalyss_user.class.php.

1321 {
1322 $cn=new Database();
1323 $filter="";
1324 if ($this->admin==0)
1325 {
1326 // show only available folders
1327 // if user is not an admin
1328 $Res=$cn->exec_sql("select
1329 distinct dos_id,dos_name,dos_description
1330 from ac_users
1331 natural join jnt_use_dos
1332 natural join ac_dossier
1333 where
1334 use_login= $1
1335 and use_active = 1
1336 and ( dos_name ilike '%' || $2 || '%' or dos_description ilike '%' || $2 || '%' )
1337 order by dos_name", array($this->login, $p_filter));
1338 }
1339 else
1340 {
1341 $Res=$cn->exec_sql("select
1342 distinct dos_id,dos_name,dos_description from ac_dossier
1343 where
1344 dos_name ilike '%' || $1|| '%' or dos_description ilike '%' || $1 || '%'
1345 order by dos_name", array($p_filter));
1346 }
1347
1349 if ($max==0)
1350 return 0;
1351
1352 for ($i=0; $i<$max; $i++)
1353 {
1355 }
1356 return $array;
1357 }
$filter

◆ get_available_repository()

Noalyss_User::get_available_repository ( $p_access = 'R')

return array of available repository

Parameters
$p_accessR for read W for write
Returns
an array

Definition at line 1120 of file noalyss_user.class.php.

1121 {
1122 $profile=$this->get_profile();
1123 $r=array();
1124 if ($p_access=='R')
1125 {
1126 $r=$this->db->get_array("select distinct u.r_id,r_name
1127 from
1128 profile_sec_repository as u
1129 join stock_repository as s on(u.r_id=s.r_id)
1130 where
1131 p_id =$1
1132 and ur_right='W'
1133 order by 2
1134 ", array($profile));
1135 }
1136 if ($p_access=='W')
1137 {
1138 $r=$this->db->get_array("select distinct u.r_id,r_name
1139 from
1140 profile_sec_repository as u
1141 join stock_repository as s on(u.r_id=s.r_id)
1142 where
1143 p_id =$1 order by 2
1144 ", array($profile));
1145 }
1146 return $r;
1147 }

◆ get_exercice()

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.

1006 {
1007 $sql="select p_exercice from parm_periode where p_id=$1";
1008 $Ret=$this->db->exec_sql($sql,[$this->get_periode()]);
1009 if (Database::num_row($Ret)==1)
1010 {
1011 $r=Database::fetch_array($Ret, 0);
1012 return $r['p_exercice'];
1013 }
1014 else
1015 return 0;
1016 }
get_periode()
Get the default periode from the user's preferences.

◆ get_first_week_day()

Noalyss_User::get_first_week_day ( )

first day in calendar

See also
IDate\set_firstDate(

Definition at line 1824 of file noalyss_user.class.php.

1825 {
1826 $repocn=new Database();
1827 $result=$repocn->get_value("select parameter_value from user_global_pref where parameter_type=$1 and user_id=$2 ",
1828 array("first_week_day", $this->login));
1829 if ($repocn->count()==0)
1830 {
1831 $this->save_global_preference("first_week_day", 1);
1832 return 1;
1833 }
1834 return $result;
1835 }
save_global_preference($key, $value)
Save the preference , the scope is global, the settings are saved into account_repository.

References $result, and save_global_preference().

+ Here is the call graph for this function:

◆ get_folder_access()

Noalyss_User::get_folder_access ( $p_dossier = 0)

return the access to a folder,

Parameters
$p_dossierid if it is == 0 then we take the value from $_SESSION
Returns
the priv_priv
  • X no access
  • R has access (normal user)

Definition at line 498 of file noalyss_user.class.php.

499 {
500
501 if ($p_dossier==0)
502 $p_dossier=dossier::id();
503 if ($this->admin==1)
504 return 'R';
505 $cn=new Database();
506
507 $sql="select 'R' from jnt_use_dos where use_id=$1 and dos_id=$2";
508
509 $res=$cn->get_value($sql, array($this->id, $p_dossier));
510
511 if ($cn->get_affected()==0)
512 return 'X';
513 return $res;
514 }

◆ get_ledger()

Noalyss_User::get_ledger ( $p_type = 'ALL',
$p_access = 3,
$disable = TRUE )

get all the available ledgers for the current user

Parameters
$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
Returns
a double array of available ledgers
[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.

586 {
587 $p_type=strtoupper($p_type);
588 if (!in_array($p_type, ["FIN", "ALL", "ODS", "VEN", 'ACH']))
589 {
590 record_log(sprintf("UGL1, p_type %s", $p_type));
591 throw new Exception("UGL1"._("Type incorrecte"));
592 }
593 if ($disable==TRUE)
594 {
595 $sql_enable="";
596 }
597 else
598 {
599 $sql_enable="and jrn_enable=1";
600 }
601 if ($this->admin!=1&&$this->is_local_admin()!=1&&$this->get_status_security_ledger()==1)
602 {
603 $sql_type=($p_type=='ALL')?'':"and jrn_def_type=upper('".sql_string($p_type)."')";
604 switch ($p_access)
605 {
606 case 3:
607 $sql_access=" and uj_priv!= 'X' ";
608 break;
609 case 2:
610 $sql_access=" and uj_priv = 'W' and jrn_enable=1 ";
611 break;
612
613 case 1:
614 $sql_access=" and ( uj_priv = 'R' or uj_priv='W') ";
615 break;
616 }
617
618 $sql="select jrn_def_id,jrn_def_type,jrn_def_code,
619 jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
620 jrn_deb_max_line,jrn_cred_max_line,jrn_def_description,jrn_enable
621 from jrn_def join jrn_type on jrn_def_type=jrn_type_id
622 join user_sec_jrn on uj_jrn_id=jrn_def_id
623 where
624 uj_login='".$this->login."'".
625 $sql_type.$sql_access.$sql_enable.
626 " order by jrn_Def_name";
627 }
628 else
629 {
630 $sql_type=($p_type=='ALL')?' '.$sql_enable:"where jrn_def_type=upper('".sql_string($p_type)."') ".$sql_enable;
631 $sql="select jrn_def_id,jrn_def_type,jrn_def_code,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line,
632 jrn_type_id,jrn_desc,'W' as uj_priv,jrn_def_description,jrn_enable
633 from jrn_def join jrn_type on jrn_def_type=jrn_type_id
634 $sql_type
635 order by jrn_Def_name";
636 }
637 $res=$this->db->exec_sql($sql);
638 if (Database::num_row($res)==0)
639 return null;
641 return $array;
642 }
sql_string($p_string)
Fix the problem with the quote char for the database.
static fetch_all($ret)
wrapper for the function pg_fetch_all
get_status_security_ledger()
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled,...

References ALL.

◆ get_ledger_access()

Noalyss_User::get_ledger_access ( $p_ledger)

check that a user is valid and the access to the folder

Parameters
$p_ledgerthe ledger to check
Returns
the priv_priv
  • O only predefined operation
  • W write
  • R read only
  • X no access

Definition at line 554 of file noalyss_user.class.php.

555 {
556 if ($this->admin==1||
557 $this->is_local_admin(dossier::id())==1||$this->get_status_security_ledger()==0)
558 return 'W';
559
560 $sql="select uj_priv from user_sec_jrn where uj_login=$1 and uj_jrn_id=$2";
561 $res=$this->db->get_value($sql, array($this->login, $p_ledger));
562
563 if ($res=='')
564 $res='X';
565 return $res;
566 }

◆ get_ledger_sql()

Noalyss_User::get_ledger_sql ( $p_type = 'ALL',
$p_access = 3 )

return an sql condition for filtering the permitted ledger

Parameters
$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
Returns
sql condition like = jrn_def_id in (...)

Definition at line 651 of file noalyss_user.class.php.

652 {
653 $aLedger=$this->get_ledger($p_type, $p_access);
654 if (empty($aLedger))
655 return ' jrn_def_id < 0 ';
656 $sql=" jrn_def_id in (";
657 foreach ($aLedger as $row)
658 {
659 $sql.=$row['jrn_def_id'].',';
660 }
661 $sql.='-1)';
662 return $sql;
663 }
get_ledger($p_type='ALL', $p_access=3, $disable=TRUE)
get all the available ledgers for the current user

References ALL, and jrn_def_id.

◆ get_limit_current_exercice()

Noalyss_User::get_limit_current_exercice ( )

return the first date and the last date of the current exercice for the current user

Returns
and array ([0] => start_date,[1] => end_date)

Definition at line 1232 of file noalyss_user.class.php.

1233 {
1235 $periode=new Periode($this->db);
1236 list($per_start, $per_end)=$periode->get_limit($current_exercice);
1237 $start=$per_start->first_day();
1238 $end=$per_end->last_day();
1239 return array($start, $end);
1240 }
get_exercice()
Return the year of current Periode it is the parm_periode.p_exercice col if an error occurs return 0.

◆ get_list()

static Noalyss_User::get_list ( $p_dossier)
static

return an array with all the active users who can access $p_dossier including the global admin.

The user must be activated

Parameters
$p_dossierdossier
Returns
an array of user's object array indices
  • use_id (id )
  • use_login (login of the user)
  • use_name
  • use_first_name
Exceptions
throwan exception if nobody can access

Definition at line 1164 of file noalyss_user.class.php.

1165 {
1166 $sql="select distinct use_id,use_login,use_first_name,use_name from ac_users
1167 left outer join jnt_use_dos using (use_id)
1168 where
1169 (dos_id=$1 and use_active=1) or (use_active=1 and use_admin=1)
1170 order by use_login,use_name";
1171
1172 $repo=new Database();
1173 $array=$repo->get_array($sql, array($p_dossier));
1174 if ($repo->size()==0)
1175 throw new Exception('Error inaccessible folder');
1176 return $array;
1177 }
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo

◆ get_periode()

Noalyss_User::get_periode ( )

Get the default periode from the user's preferences.

Returns
the default periode

Definition at line 742 of file noalyss_user.class.php.

743 {
744
745 $array=$this->get_preference();
746 if (!isset($array['PERIODE']))
747 {
748 $this->set_default_periode();
749 $array=$this->get_preference();
750 }
751 return $array['PERIODE'];
752 }
get_preference()
Get the default user's preferences.

◆ get_preference()

Noalyss_User::get_preference ( )

Get the default user's preferences.

Returns
array of (parameter_type => parameter_value)

Definition at line 785 of file noalyss_user.class.php.

786 {
787 $sql="select parameter_type,parameter_value from user_local_pref where user_id=$1";
788 $Res=$this->db->exec_sql($sql, array($this->id));
789 $l_array=array();
790 for ($i=0; $i<Database::num_row($Res); $i++)
791 {
793 $type=$row['parameter_type'];
794 $l_array[$type]=$row['parameter_value'];
795 }
796 $repo=new Database();
797 $a_global_pref=$repo->get_array("select parameter_type,parameter_value from user_global_pref
798 where
799 upper(user_id) = upper($1)", [$this->login]);
800 $nb_global=count($a_global_pref);
801 for ($i=0; $i<$nb_global; $i++)
802 {
803 $idx=$a_global_pref[$i]['parameter_type'];
804 $value=$a_global_pref[$i]['parameter_value'];
805 $l_array[$idx]=$value;
806 }
807
808 return $l_array;
809 }

◆ get_profile()

Noalyss_User::get_profile ( )

return the profile (p_id)

Returns
profile.p_id

Definition at line 1419 of file noalyss_user.class.php.

1420 {
1421 $profile=$this->db->get_value("select p_id from profile_user where
1422 lower(user_name)=lower($1) ", array($this->login));
1423 return $profile;
1424 }

◆ get_readable_profile()

Noalyss_User::get_readable_profile ( )

return array of readable action_profile

Definition at line 1462 of file noalyss_user.class.php.

1463 {
1464 $value=$this->db->get_array("select p_granted from ".$this->sql_readable_profile()." as m") ;
1465 $aGranted=array_column($value,"p_granted");
1466 return $aGranted;
1467 }
sql_readable_profile()
Compute the SQL string for the readable profile, the subselect for p_id , example p_id in $g_user->sq...

◆ get_status_security_action()

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.

1789 {
1790 $security=$this->db->get_value("select us_action from user_active_security
1791 where
1792 us_login=$1", [$this->login]);
1793 $n_security=($security=="Y")?1:0;
1794 return $n_security;
1795 }

References db.

◆ get_status_security_ledger()

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.

1753 {
1754 $security=$this->db->get_value("select us_ledger from user_active_security
1755 where
1756 us_login=$1", [$this->login]);
1757 $n_security=($security=="Y")?1:0;
1758 return $n_security;
1759 }

References db.

◆ get_vat_code_preference()

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.

See also
ITva_Popup\set_vat_code()
ITva_Popup

Definition at line 1858 of file noalyss_user.class.php.

1858 :int
1859 {
1860 $repocn=new Database();
1861 $result=$repocn->get_value("select parameter_value from user_global_pref where parameter_type=$1 and user_id=$2 ",
1862 array("vat_code", $this->login));
1863 if ($repocn->count()==0)
1864 {
1865 $this->save_global_preference("vat_code", 0);
1866 return 0;
1867 }
1868 return $result;
1869 }

References $result, and save_global_preference().

+ Here is the call graph for this function:

◆ get_writable_profile()

Noalyss_User::get_writable_profile ( )

return array of writable action_profile

Definition at line 1452 of file noalyss_user.class.php.

1453 {
1454 $value=$this->db->get_array("select p_granted from ".$this->sql_writable_profile()." as m") ;
1455 $aGranted=array_column($value,"p_granted");
1456 return $aGranted;
1457 }
sql_writable_profile()
Compute the SQL string for the writable profile, the subselect for p_id , example p_id in $g_user->sq...

◆ getActive()

Noalyss_User::getActive ( )
Returns
mixed

Definition at line 292 of file noalyss_user.class.php.

293 {
294 return $this->active;
295 }
$active
1 active , 0 disables

◆ getAdmin()

Noalyss_User::getAdmin ( )
Returns
default|int|mixed|string|string[]|null

Definition at line 228 of file noalyss_user.class.php.

229 {
230 return $this->admin;
231 }
$admin
is or is not admin

References $admin.

◆ getDb()

Noalyss_User::getDb ( )
Returns
mixed

Definition at line 212 of file noalyss_user.class.php.

213 {
214 return $this->db;
215 }
$db
database connx to the folder NOT repository

◆ getEmail()

Noalyss_User::getEmail ( )
Returns
mixed

Definition at line 340 of file noalyss_user.class.php.

341 {
342 return $this->email;
343 }

◆ getFirstName()

Noalyss_User::getFirstName ( )
Returns
default|mixed|string|string[]|null

Definition at line 260 of file noalyss_user.class.php.

261 {
262 return $this->first_name;
263 }

◆ getId()

Noalyss_User::getId ( )
Returns
int|mixed

Definition at line 196 of file noalyss_user.class.php.

196 : int
197 {
198 return $this->id;
199 }
$id
in account_repository , ac_users.use_id

References $id.

◆ getLogin()

Noalyss_User::getLogin ( )
Returns
string

Definition at line 308 of file noalyss_user.class.php.

308 : string
309 {
310 return $this->login;
311 }

◆ getName()

Noalyss_User::getName ( )
Returns
default|mixed|string|string[]|null

Definition at line 276 of file noalyss_user.class.php.

277 {
278 return $this->name;
279 }

References $name.

◆ getPassword()

Noalyss_User::getPassword ( )
Returns
mixed

Definition at line 324 of file noalyss_user.class.php.

325 {
326 return $this->password;
327 }

◆ getValid()

Noalyss_User::getValid ( )
Returns
int

Definition at line 244 of file noalyss_user.class.php.

244 : int
245 {
246 return $this->valid;
247 }
$valid
is or is not valid

References $valid.

◆ grant_admin_access()

static Noalyss_User::grant_admin_access ( $p_login,
$p_dossier )
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.

1681 {
1682 $repo_cnx=new Database();
1683 $user=$repo_cnx->get_array("select use_id,use_login
1684 from ac_users
1685 where use_login=$1", array($p_login));
1686
1687 if (!$user)
1688 return false;
1689 $cn_dossier=new Database($p_dossier);
1690 // if not access to DB
1691 if (
1692 $repo_cnx->get_value("select count(*) from jnt_use_dos where use_id=$1 and dos_id=$2",
1693 array($user[0]['use_id'], $p_dossier))==0
1694 )
1695 {
1696 $repo_cnx->exec_sql("insert into jnt_use_dos(use_id,dos_id) values ($1,$2)",
1697 array($user[0]['use_id'], $p_dossier));
1698 }
1699 //------ Give him the admin menu
1700 if ($cn_dossier->get_value("select count(*) from profile_user where user_name=$1", array($user[0]['use_login']))==0)
1701 {
1702 $cn_dossier->exec_sql('insert into profile_user(user_name,p_id) values($1,1)', array($user[0]['use_login']));
1703 }
1704 // Grant all action + ledger to him
1705 $cn_dossier->exec_sql("delete from user_sec_act where ua_login=$1", array($p_login));
1706
1707 $cn_dossier->exec_sql("insert into user_sec_act (ua_login,ua_act_id)"
1708 ." select $1 ,ac_id from action ", array($p_login));
1709
1710 $cn_dossier->exec_sql("delete from user_sec_jrn where uj_login=$1", array($p_login));
1711 $cn_dossier->exec_sql("insert into user_sec_jrn(uj_login,uj_jrn_id,uj_priv)"
1712 ." select $1,jrn_def_id,'W' from jrn_def", array($p_login));
1713 }

◆ insert()

Noalyss_User::insert ( )

Definition at line 410 of file noalyss_user.class.php.

411 {
412
413 $Sql="INSERT INTO ac_users(
414 use_first_name, use_name, use_login, use_active,
415 use_admin, use_pass, use_email)
416 VALUES ($1, $2, $3, $4, $5, $6, $7) returning use_id";
417
418 $cn=new Database();
419 $this->id=$cn->get_value($Sql,
420 array($this->first_name, $this->last_name, $this->login, 1, $this->admin,
421 $this->password, $this->email));
422 }

References $cn.

◆ insert_default_global_pref()

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

Parameters
$p_typeparameter's type or nothing
$p_valueparameter value

Definition at line 936 of file noalyss_user.class.php.

937 {
938
939 $default_parameter=array("THEME"=>"classic",
940 "PAGESIZE"=>"50",
941 'TOPMENU'=>'TEXT',
942 'LANG'=>'fr_FR.utf8',
943 'csv_fieldsep'=>'0',
944 'csv_decimal'=>'0',
945 'csv_encoding'=>'utf8',
946 'first_week_day'=>1
947 );
948 $cn=new Database();
949 $sql="insert into user_global_pref(user_id,parameter_type,parameter_value)
950 values ($1,$2,$3)";
951 if ($p_type=="")
952 {
953 foreach ($default_parameter as $name=> $value)
954 {
955 $cn->exec_sql($sql, array($this->login, $name, $value));
956 }
957 }
958 else
959 {
960 $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
961 if ( $cn->get_value("select count(*) from user_global_pref where user_id=$1 and parameter_type=$2",
962 array($this->login,$p_type)) == 1)
963 {
964 $cn->exec_sql("update user_global_pref set parameter_value=$1 where user_id=$2 and parameter_type=$3",
965 array($value,$this->login,$p_type));
966 } else {
967 $cn->exec_sql($sql, array($this->login, $p_type, $value));
968 }
969 }
970 }

◆ is_local_admin()

Noalyss_User::is_local_admin ( $p_dossier = -1)

Check if an user is an local administrator.

Deprecated
since version 6.7
Parameters
$p_dossier: dossier_id
Returns
  • 0 if no
  • 1 if yes

Definition at line 1109 of file noalyss_user.class.php.

1110 {
1111 return 0;
1112 }

◆ isAdmin()

Noalyss_User::isAdmin ( )

Check if an user is an admin and check also his password.

Returns
1 for yes 0 for no

Definition at line 679 of file noalyss_user.class.php.

679 :int
680 {
681 $this->admin=0;
682 $pass5=$this->password;
683 $sql="select count(*) from ac_users where use_login=$1
684 and use_active=1 and use_admin=1 and use_pass=$2 ";
685
686 $cn=new Database();
687 $this->admin=$cn->get_value($sql, array($this->login,$pass5));
688 return $this->admin;
689 }

◆ load()

Noalyss_User::load ( )

Definition at line 359 of file noalyss_user.class.php.

359 :int
360 {
361 /* if this->id == -1, it is unknown so we have to retrieve it from
362 the database thanks it login */
363 if ($this->id<0)
364 {
365 $sql_cond=" where lower(use_login)=lower($1)";
366 $sql_array=array($this->login);
367 }
368 else
369 {
370 $sql_cond=" where use_id=$1";
371 $sql_array=array($this->id);
372 }
373 $sql="select use_id,
374 use_first_name,
375 use_name,
376 use_login,
377 use_active,
378 use_admin,
379 use_pass,
380 use_email
381 from ac_users ";
382 $cn=new Database();
383 $Res=$cn->exec_sql($sql.$sql_cond, $sql_array);
384 if (($Max=Database::num_row($Res))==0)
385 return -1;
387 $this->id=$row['use_id'];
388 $this->first_name=$row['use_first_name'];
389 $this->last_name=$row['use_name'];
390 $this->name=$row['use_name'];
391 $this->active=$row['use_active'];
392 $this->login=strtolower($row['use_login']);
393 $this->admin=$row['use_admin'];
394 $this->password=$row['use_pass'];
395 $this->email=$row['use_email'];
396 return $this->id;
397 }
$sql_array['query']

References $cn, $id, $Max, $Res, $row, $sql, $sql_array, DatabaseCore\fetch_array(), name, and DatabaseCore\num_row().

Referenced by __construct().

+ Here is the call graph for this function:

◆ load_global_pref()

Noalyss_User::load_global_pref ( )

Get the global preferences from user_global_pref in the account_repository db.

Note
set $SESSION[g_variable]

Definition at line 884 of file noalyss_user.class.php.

885 {
886 $cn=new Database();
887 // Load everything in an array
888 $Res=$cn->exec_sql("select parameter_type,parameter_value from
889 user_global_pref
890 where user_id=$1", [$this->login]);
892 if ($Max==0)
893 {
895 $this->load_global_pref();
896 return;
897 }
898 // Load value into array
899 $line=array();
900 for ($i=0; $i<$Max; $i++)
901 {
903 $type=$row['parameter_type'];
904 $line[$type]=$row['parameter_value'];
905 }
906 // save array into g_ variable
907 $array_pref=array('g_theme'=>'THEME',
908 'g_pagesize'=>'PAGESIZE',
909 'g_topmenu'=>'TOPMENU',
910 'g_lang'=>'LANG',
911 'csv_fieldsep'=>'csv_fieldsep',
912 'csv_decimal'=>'csv_decimal',
913 'csv_encoding'=>'csv_encoding',
914 'first_week_day'=>'first_week_day');
915
916 foreach ($array_pref as $name=> $parameter)
917 {
918 if (!isset($line[$parameter]))
919 {
920 $this->insert_default_global_pref($parameter);
921 $this->load_global_pref();
922 return;
923 }
924 $_SESSION[SESSION_KEY.$name]=$line[$parameter];
925 }
926 }
insert_default_global_pref($p_type="", $p_value="")
insert default pref if no parameter are given insert all the existing parameter otherwise only the re...

Referenced by Check().

◆ password_to_session()

Noalyss_User::password_to_session ( )

store the password in session

Definition at line 1610 of file noalyss_user.class.php.

1611 {
1612 $_SESSION[SESSION_KEY.'g_pass']=$this->getPassword();
1613 }

◆ remove_inexistant_user()

static Noalyss_User::remove_inexistant_user ( $p_dossier)
static

Definition at line 1715 of file noalyss_user.class.php.

1716 {
1717 $cnx_repo=new Database();
1718 $name=$cnx_repo->format_name($p_dossier, 'dos');
1719 if ($cnx_repo->exist_database($name)==0)
1720 return;
1721 $cnx_dossier=new Database($p_dossier);
1722 if ($cnx_dossier->exist_table('profile_user'))
1723 $a_user=$cnx_dossier->get_array('select user_name from profile_user');
1724 else
1725 return;
1726
1727 if (!$a_user)
1728 return;
1729 $nb=count($a_user);
1730 for ($i=0; $i<$nb; $i++)
1731 {
1732 if ($cnx_repo->get_value('select count(*) from ac_users where use_login=$1', array($a_user[$i]['user_name']))==0)
1733 {
1734 if ($cnx_dossier->exist_table('user_sec_jrn'))
1735 $cnx_dossier->exec_sql("delete from user_sec_jrn where uj_login=$1", array($a_user[$i]['user_name']));
1736 $cnx_dossier->exec_sql("delete from profile_user where user_name=$1", array($a_user[$i]['user_name']));
1737 if ($cnx_dossier->exist_table('user_sec_act'))
1738 $cnx_dossier->exec_sql("delete from user_sec_act where ua_login=$1", array($a_user[$i]['user_name']));
1739 if ($cnx_dossier->exist_table('user_sec_jrn'))
1740 $cnx_dossier->exec_sql("delete from user_sec_jrn where uj_login=$1", array($a_user[$i]['user_name']));
1741 if ($cnx_dossier->exist_table('user_active_security'))
1742 $cnx_dossier->exec_sql("delete from user_active_security where us_login=$1",
1743 array($a_user[$i]['user_name']));
1744 }
1745 }
1746 }

References $i, $name, and $nb.

◆ revoke_access()

static Noalyss_User::revoke_access ( $p_login,
$p_dossier )
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.

1657 {
1658 // connect to the repository
1659 $repo_cnx=new Database();
1660
1661 // Retrieve the user
1662 $user=$repo_cnx->get_array('select use_id,use_login from ac_users where use_login=$1', array($p_login));
1663 if (!$user)
1664 return false;
1665
1666 // remove him from jnt_use_dos
1667 $repo_cnx->exec_sql("delete from jnt_use_dos WHERE use_id=$1 and dos_id=$2",
1668 array($user[0]['use_id'], $p_dossier));
1669
1670 // Remove user from user's dossier
1671 $cn_dossier=new Database($p_dossier);
1672 $cn_dossier->exec_sql("delete from profile_user where user_name=$1", array($p_login));
1673 $cn_dossier->exec_sql("delete from user_sec_act where ua_login=$1", array($p_login));
1674 }

References from.

◆ save()

Noalyss_User::save ( )

Definition at line 399 of file noalyss_user.class.php.

400 {
401
402 $Sql="update ac_users set use_first_name=$1, use_name=$2
403 ,use_active=$3,use_admin=$4,use_pass=$5 ,use_email = $7 where use_id=$6";
404 $cn=new Database();
405 $Res=$cn->exec_sql($Sql,
406 array($this->first_name, $this->last_name, $this->active, $this->admin, $this->password,
407 $this->id, $this->email));
408 }

References $cn, and $Res.

◆ save_email()

Noalyss_User::save_email ( $p_email)

Save the password from PREFERENCE MODULE.

Parameters
type$p_email

Definition at line 1643 of file noalyss_user.class.php.

1644 {
1645 $repo=new Database();
1646 $repo->exec_sql("update ac_users set use_email=$1 where use_login=$2",
1647 array($p_email, $_SESSION[SESSION_KEY.'g_user']));
1648 }

◆ save_global_preference()

Noalyss_User::save_global_preference ( $key,
$value )

Save the preference , the scope is global, the settings are saved into account_repository.

Parameters
$keyTHEME, LANG , PAGESIZE
$valuevalue of the key

Definition at line 761 of file noalyss_user.class.php.

762 {
763 $repo=new Database();
764 $count=$repo->get_value("select count(*)
765 from
766 user_global_pref
767 where
768 parameter_type=$1 and user_id=$2", array($key, $this->login));
769 if ($count==1)
770 {
771 $repo->exec_sql("update user_global_pref set parameter_value=$1
772 where parameter_type=$2 and user_id=$3", array($value, $key, $this->login));
773 }
774 elseif ($count==0)
775 {
776 $repo->exec_sql("insert into user_global_pref(user_id,parameter_type,parameter_value)
777 values($1,$2,$3)", array($this->login, $key, $value));
778 }
779 }
$count

Referenced by get_first_week_day(), and get_vat_code_preference().

◆ save_password()

Noalyss_User::save_password ( $p_pass1,
$p_pass2 )

Save the password of the current user.

Parameters
string$p_pass1password (clear)
string$p_pass2for confirming password (clear)
See also
check_password_strength()
Returns
true : password successfully changed otherwise false

Definition at line 1621 of file noalyss_user.class.php.

1622 {
1623 if ($p_pass1==$p_pass2 && count(check_password_strength($p_pass1)['msg'])==0)
1624 {
1625 $repo=new Database();
1626 $l_pass=md5($p_pass1);
1627 $this->setPassword($l_pass);
1628 $repo->exec_sql("update ac_users set use_pass=$1 where use_login=$2",
1629 array($l_pass, $this->login));
1630 return true;
1631 }
1632 else
1633 {
1634
1635 return false;
1636 }
1637 }
check_password_strength($password)
returns an double array with the error found and code , if the count is 0 then the password is very s...

◆ save_profile()

Noalyss_User::save_profile ( $p_id)

Definition at line 1401 of file noalyss_user.class.php.

1402 {
1403 $count=$this->db->get_value("select count(*) from profile_user where user_name=$1", array($this->login));
1404 if ($count==0)
1405 {
1406 $this->db->exec_sql("insert into profile_user(p_id,user_name)
1407 values ($1,$2)", array($p_id, $this->login));
1408 }
1409 else
1410 {
1411 $this->db->exec_sql("update profile_user set p_id=$1 where user_name=$2", array($p_id, $this->login));
1412 }
1413 }

◆ set_access_mode()

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.

187 : object
188 {
189 $this->access_mode=$access_mode;
190 return $this;
191 }

References $access_mode.

◆ set_default_periode()

Noalyss_User::set_default_periode ( )
private

Definition at line 704 of file noalyss_user.class.php.

705 {
706
707 /* get the first periode */
708 $sql='select min(p_id) as pid '
709 .' from parm_periode '
710 .' where p_closed = false and p_start = (select min(p_start) from parm_periode)';
711 $Res=$this->db->exec_sql($sql);
712
713 $pid=Database::fetch_result($Res, 0, 0);
714 /* if all the periode are closed, then we use the last closed period */
715 if ($pid==null)
716 {
717 $sql='select min(p_id) as pid '
718 .'from parm_periode '
719 .'where p_start = (select max(p_start) from parm_periode)';
720 $Res2=$this->db->exec_sql($sql);
721 $pid=Database::fetch_result($Res2, 0, 0);
722 if ($pid==null)
723 {
724 throw new Exception(_("Aucune période trouvéee !!!"));
725 }
726
727 $pid=Database::fetch_result($Res2, 0, 0);
728 }
729
730 $sql=sprintf("insert into user_local_pref (user_id,parameter_value,parameter_type)
731 values ('%s','%d','PERIODE')", $this->id, $pid);
732 $Res=$this->db->exec_sql($sql);
733 }
static fetch_result($ret, $p_row=0, $p_col=0)
wrapper for the function pg_fetch_all

References from, and p_id.

◆ set_folder_access()

Noalyss_User::set_folder_access ( $db_id,
$priv )

save the access of a folder

Parameters
$db_idthe dossier id
$privboolean, true then it is granted, false it is removed

Definition at line 521 of file noalyss_user.class.php.

522 {
523
524 $cn=new Database();
525 if ($priv)
526 {
527 // the access is granted
528 $jnt=$cn->get_value("select jnt_id from jnt_use_dos where dos_id=$1 and use_id=$2", array($db_id, $this->id));
529
530 if ($cn->size()==0)
531 {
532
533 $Res=$cn->exec_sql("insert into jnt_use_dos(dos_id,use_id) values($1,$2)", array($db_id, $this->id));
534 }
535 }
536 else
537 {
538 // Access is revoked
539 $cn->exec_sql('delete from jnt_use_dos where use_id = $1 and dos_id = $2 ', array($this->id, $db_id));
540 }
541 }
$priv

References from.

◆ set_periode()

Noalyss_User::set_periode ( $p_periode)

Set the selected periode in the user's preferences.

Parameters
$p_periodeperiode
-$p_user

Definition at line 698 of file noalyss_user.class.php.

699 {
700 $sql="update user_local_pref set parameter_value=$1 where user_id=$2 and parameter_type='PERIODE'";
701 $Res=$this->db->exec_sql($sql, [$p_periode, $this->id]);
702 }

◆ set_session_var()

Noalyss_User::set_session_var ( )

put user_login into Postgres config (session), it can be used for tracking users activities

Returns
void

Definition at line 79 of file noalyss_user.class.php.

80 {
81 $this->db->exec_sql(sprintf("select set_config('noalyss.user_login','%s',false)",
82 Database::escape_string($_SESSION[SESSION_KEY.'g_user'])));
83
84 }

References db, and DatabaseCore\escape_string().

Referenced by __construct().

+ Here is the call graph for this function:

◆ set_status_security_action()

Noalyss_User::set_status_security_action ( $p_value)

Set the flag in the table user_active_security.

Parameters
int$p_value1==enable , 0 = disable @exceptions invalid value

Definition at line 1802 of file noalyss_user.class.php.

1803 {
1804 if ($p_value!=0&&$p_value!=1)
1805 throw new Exception(_("Valeur invalide"));
1806 $exist=$this->db->get_value("select count(*) from user_active_security where us_login=$1", [$this->login]);
1807 $flag=($p_value==1)?"Y":"N";
1808 if ($exist==0)
1809 {
1810 $this->db->exec_sql("insert into user_active_security (us_login,us_action,us_ledger) values ($1,$2,$3)",
1811 [$this->login, $flag, 'Y']);
1812 }
1813 else
1814 {
1815 $this->db->exec_sql("update user_active_security set us_action=$1 where us_login = $2",
1816 [$flag, $this->login]);
1817 }
1818 }
$flag
Definition install.php:536

References $flag, _, and db.

◆ set_status_security_ledger()

Noalyss_User::set_status_security_ledger ( $p_value)

Set the flag in the table user_active_security.

Parameters
int$p_value1==enable , 0 = disable @exceptions invalid value

Definition at line 1766 of file noalyss_user.class.php.

1767 {
1768 if ($p_value!=0&&$p_value!=1)
1769 throw new Exception(_("Valeur invalide"));
1770 $exist=$this->db->get_value("select count(*) from user_active_security where us_login=$1", [$this->login]);
1771 $flag=($p_value==1)?"Y":"N";
1772 if ($exist==0)
1773 {
1774 $this->db->exec_sql("insert into user_active_security (us_login,us_ledger,us_action) values ($1,$2,$3)",
1775 [$this->login, $flag, 'Y']);
1776 }
1777 else
1778 {
1779 $this->db->exec_sql("update user_active_security set us_ledger=$1 where us_login = $2",
1780 [$flag, $this->login]);
1781 }
1782 }

References $flag, _, and db.

◆ setActive()

Noalyss_User::setActive ( $active)
Parameters
mixed$active

Definition at line 300 of file noalyss_user.class.php.

300 : void
301 {
302 $this->active=$active;
303 }

References $active.

◆ setAdmin()

Noalyss_User::setAdmin ( $admin)
Parameters
default | int | mixed | string | string[] | null$admin

Definition at line 236 of file noalyss_user.class.php.

236 : void
237 {
238 $this->admin=$admin;
239 }

References $admin.

◆ setDb()

Noalyss_User::setDb ( $db)
Parameters
mixed$db

Definition at line 220 of file noalyss_user.class.php.

220 : void
221 {
222 $this->db=$db;
223 }

References $db, and db.

◆ setEmail()

Noalyss_User::setEmail ( $email)
Parameters
mixed$email

Definition at line 348 of file noalyss_user.class.php.

348 : void
349 {
350 $this->email=$email;
351 }

References $email.

◆ setFirstName()

Noalyss_User::setFirstName ( $first_name)
Parameters
default | mixed | string | string[] | null$first_name

Definition at line 268 of file noalyss_user.class.php.

268 : void
269 {
270 $this->first_name=$first_name;
271 }

References $first_name.

◆ setId()

Noalyss_User::setId ( int $id)
Parameters
int | mixed$id

Definition at line 204 of file noalyss_user.class.php.

204 : void
205 {
206 $this->id=$id;
207 }

References $id.

◆ setLogin()

Noalyss_User::setLogin ( string $login)
Parameters
string$login

Definition at line 316 of file noalyss_user.class.php.

316 : void
317 {
318 $this->login=$login;
319 }

References $login.

◆ setName()

Noalyss_User::setName ( $name)
Parameters
default | mixed | string | string[] | null$name

Definition at line 284 of file noalyss_user.class.php.

284 : void
285 {
286 $this->name=$name;
287 }

References $name, and name.

◆ setPassword()

Noalyss_User::setPassword ( $password)
Parameters
mixed$password

Definition at line 332 of file noalyss_user.class.php.

332 : void
333 {
334 $this->password=$password;
335 }

References $password.

◆ setValid()

Noalyss_User::setValid ( int $valid)
Parameters
int$valid

Definition at line 252 of file noalyss_user.class.php.

252 : void
253 {
254 $this->valid=$valid;
255 }

References $valid.

◆ show_dossier()

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

Parameters
$p_filtreuser
Returns
table in HTML

Definition at line 1251 of file noalyss_user.class.php.

1252 {
1253 $p_array=$this->get_available_folder($p_filtre);
1254
1255 $result="";
1256
1257 $result.="<TABLE id=\"folder\" class=\"result\">";
1258 $result.="<tr>";
1259 $result.="<th>";
1260 $result.=_("Id");
1261 $result.="</th>";
1262 $result.="<th>";
1263 $result.=_("Nom");
1264 $result.="</th>";
1265 $result.="<th>";
1266 $result.=_("Description");
1267 $result.="</th>";
1268 $result.="</tr>";
1269 if ($p_array==0)
1270 {
1271 $result.="<tr>";
1272 $result.='<td style="width:auto" colspan=3>';
1273 $result.=_("Aucun dossier disponible");
1274 $result.='</td>';
1275 $result.="</tr>";
1276 return $result;
1277 }
1278
1279 for ($i=0; $i<sizeof($p_array); $i++)
1280 {
1281
1282 $id=$p_array[$i]['dos_id'];
1283 $name=$p_array[$i]['dos_name'];
1284 $desc=$p_array[$i]['dos_description'];
1285 if ($i%2==0)
1286 $tr="odd";
1287 else
1288 $tr="even";
1289 $target="do.php?gDossier=$id";
1290
1291 $result.="<TR class=\"$tr\">";
1292
1293 $result.=td($id, ' class="num" ');
1294 $result.="<TD class=\"$tr\">";
1295 $result.="<A class=\"dossier\" HREF=\"$target\">";
1296 $result.=" <B>".h($name)."</B>";
1297 $result.="</A>";
1298 $result.="</TD>";
1299 $desc=($desc=="")?"<i>Aucune description</i>":h($desc);
1300 $desc="<A class=\"dossier\" HREF=\"$target\">$desc</A>";
1301 $result.="<TD class=\"$tr\" >".$desc;
1302 $result.="</TD>";
1303 $result.="</TR>";
1304 }
1305 $result.="</TABLE>";
1306 return $result;
1307 }
td($p_string='', $p_extra='')
surround the string with td
Definition ac_common.php:83
h( $row[ 'oa_description'])
get_available_folder($p_filter="")
Get all the available folders for the users, checked with the security.

References style, and td().

+ Here is the call graph for this function:

◆ sql_readable_profile()

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

Returns
SQL string with the subselect for p_id

Definition at line 1475 of file noalyss_user.class.php.

1476 {
1477 if ($this->admin!=1)
1478 {
1479 $sql=" (select p_granted "
1480 ." from user_sec_action_profile "
1481 ." where ua_right in ('W','R','O') and p_id=".$this->get_profile().") ";
1482 }
1483 else
1484 {
1485 $sql="(select p_id p_granted from profile)";
1486 }
1487 return $sql;
1488 }

◆ sql_writable_profile()

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

Returns
SQL string with the subselect for p_id

Definition at line 1434 of file noalyss_user.class.php.

1435 {
1436 if ($this->admin!=1)
1437 {
1438 $sql=" (select p_granted "
1439 ." from user_sec_action_profile "
1440 ." where ua_right in ('W','O') and p_id=".$this->get_profile().") ";
1441 }
1442 else
1443 {
1444 $sql="(select p_id p_granted from profile)";
1445 }
1446 return $sql;
1447 }

◆ update_global_pref()

Noalyss_User::update_global_pref ( $p_type,
$p_value = "" )

update default pref if value is not given then use the default value

Parameters
$p_typeparameter's type
$p_valueparameter's value value of the type

Definition at line 979 of file noalyss_user.class.php.

980 {
981 $default_parameter=array("THEME"=>"classic",
982 "PAGESIZE"=>"50",
983 "LANG"=>'fr_FR.utf8',
984 'TOPMENU'=>'SELECT',
985 'csv_fieldsep'=>'0',
986 'csv_decimal'=>'0',
987 'csv_encoding'=>'utf8',
988 'first_week_day'=>1
989 );
990 $cn=new Database();
991 $Sql="update user_global_pref set parameter_value=$1
992 where parameter_type=$2 and
993 user_id=$3";
994 $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
995 $cn->exec_sql($Sql, array($value, $p_type, $this->login));
996 }

Field Documentation

◆ $access_mode

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().

◆ $active

Noalyss_User::$active

1 active , 0 disables

Definition at line 44 of file noalyss_user.class.php.

Referenced by setActive().

◆ $admin

Noalyss_User::$admin

is or is not admin

Definition at line 39 of file noalyss_user.class.php.

Referenced by setAdmin().

◆ $db

Noalyss_User::$db

database connx to the folder NOT repository

Definition at line 38 of file noalyss_user.class.php.

Referenced by setDb().

◆ $email

Noalyss_User::$email

user's email

Definition at line 47 of file noalyss_user.class.php.

Referenced by setEmail().

◆ $first_name

Noalyss_User::$first_name

Definition at line 41 of file noalyss_user.class.php.

Referenced by setFirstName().

◆ $id

Noalyss_User::$id

in account_repository , ac_users.use_id

Definition at line 36 of file noalyss_user.class.php.

Referenced by setId().

◆ $lang

Noalyss_User::$lang

user's language

Definition at line 49 of file noalyss_user.class.php.

◆ $last_name

Noalyss_User::$last_name

user's last_name

Definition at line 42 of file noalyss_user.class.php.

◆ $login

Noalyss_User::$login

login lower case

Definition at line 45 of file noalyss_user.class.php.

Referenced by connect_user(), and setLogin().

◆ $name

Noalyss_User::$name

Definition at line 43 of file noalyss_user.class.php.

Referenced by remove_inexistant_user(), and setName().

◆ $password

Noalyss_User::$password

md5 of the password

Definition at line 46 of file noalyss_user.class.php.

Referenced by setPassword().

◆ $theme

Noalyss_User::$theme

user's CSS Theme

Definition at line 50 of file noalyss_user.class.php.

◆ $valid

Noalyss_User::$valid

is or is not valid

Definition at line 40 of file noalyss_user.class.php.

Referenced by setValid().


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