noalyss  Version-9
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions
User Class Reference

Data & function about connected users. More...

+ Collaboration diagram for User:

Public Member Functions

 __construct ($p_cn, $p_id=-1)
 
 Admin ()
 synomym for isAdmin, More...
 
 audit ($action='AUDIT', $p_module="")
 
 can_add_action ($p_profile)
 Check if the current user can add an action in the profile given in parameter. More...
 
 can_delete_action ($dtoc)
 Check if the profile of the user can write AND delete for this profile. More...
 
 can_print ($p_action, $p_js=0)
 
 can_read_action ($dtoc)
 Check if the profile of the user can write for this profile. More...
 
 can_read_repo ($p_repo)
 Check if the profile of the user can read for this repository. More...
 
 can_request ($p_action, $p_js=0)
 
 can_write_action ($dtoc)
 Check if the profile of the user can write for this profile. More...
 
 can_write_repo ($p_repo)
 Check if the profile of the user can write for this repository. More...
 
 Check ($silent=false, $from='')
 Check if user is active and exists in therepository Automatically redirect, it doesn't check if a user can access a folder. More...
 
 check_action ($p_action_id)
 Check if an user is allowed to do an action. More...
 
 check_dossier ($p_dossier_id, $silent=false)
 check if an user can access a folder, if he cannot display a dialog box and exit More...
 
 check_jrn ($p_jrn)
 check the access of an user on a ledger More...
 
 check_module ($p_module)
 Check if an user can access a module, return 1 if yes, otherwise 0 record in audit log This function works only if user is connected to a Folder. More...
 
 check_print ($p_action)
 Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit. More...
 
 get_access_mode ()
 access_mode tells what mode must be used : pc or mobile More...
 
 get_available_folder ($p_filter="")
 Get all the available folders for the users, checked with the security. More...
 
 get_available_repository ($p_access='R')
 return array of available repository More...
 
 get_exercice ()
 
 get_first_week_day ()
 
 get_folder_access ($p_dossier=0)
 return the access to a folder, More...
 
 get_ledger ($p_type='ALL', $p_access=3, $disable=TRUE)
 get all the available ledgers for the current user More...
 
 get_ledger_access ($p_ledger)
 check that a user is valid and the access to the folder More...
 
 get_ledger_sql ($p_type='ALL', $p_access=3)
 return an sql condition for filtering the permitted ledger More...
 
 get_limit_current_exercice ()
 return the first date and the last date of the current exercice for the current user More...
 
 get_mini_report ()
 return the mini rapport to display on the welcome page More...
 
 get_periode ()
 Get the default periode from the user's preferences. More...
 
 get_preference ()
 Get the default user's preferences. More...
 
 get_profile ()
 return the profile (p_id) More...
 
 get_readable_profile ()
 Compute the SQL string for the readable profile, the subselect for p_id , example p_id in $g_user->get_readable_profile. More...
 
 get_status_security_action ()
 Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0. More...
 
 get_status_security_ledger ()
 Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled, otherwise 0. More...
 
 get_writable_profile ()
 Compute the SQL string for the writable profile, the subselect for p_id , example p_id in $g_user->get_writable_profile. More...
 
 getActive ()
 
 getAdmin ()
 
 getDb ()
 
 getEmail ()
 
 getFirstName ()
 
 getId ()
 
 getLogin ()
 
 getName ()
 
 getPass ()
 
 getPassword ()
 
 getValid ()
 
 insert ()
 
 insert_default_global_pref ($p_type="", $p_value="")
 insert default pref if no parameter are given insert all the existing parameter otherwise only the requested More...
 
 is_local_admin ($p_dossier=-1)
 Check if an user is an local administrator. More...
 
 isAdmin ()
 Check if an user is an admin. More...
 
 load ()
 
 load_global_pref ()
 Get the global preferences from user_global_pref in the account_repository db. More...
 
 save ()
 
 save_email ($p_email)
 Save the password from PREFERENCE MODULE. More...
 
 save_global_preference ($key, $value)
 Save the preference , the scope is global, the settings are saved into account_repository. More...
 
 save_password ($p_pass1, $p_pass2)
 
 save_profile ($p_id)
 
 set_access_mode ($access_mode)
 access_mode tells what mode must be used : pc or mobile More...
 
 set_folder_access ($db_id, $priv)
 save the access of a folder More...
 
 set_mini_report ($p_id)
 set the mini rapport to display on the welcome page More...
 
 set_periode ($p_periode)
 Set the selected periode in the user's preferences. More...
 
 set_status_security_action ($p_value)
 Set the flag in the table user_active_security. More...
 
 set_status_security_ledger ($p_value)
 Set the flag in the table user_active_security. More...
 
 setActive ($active)
 
 setAdmin ($admin)
 
 setDb ($db)
 
 setEmail ($email)
 
 setFirstName ($first_name)
 
 setId (int $id)
 
 setLogin (string $login)
 
 setName ($name)
 
 setPass ($pass)
 
 setPassword ($password)
 
 setValid (int $valid)
 
 show_dossier ($p_filtre="")
 Show all the available folder for the users at the login page. More...
 
 update_global_pref ($p_type, $p_value="")
 update default pref if value is not given then use the default value More...
 

Static Public Member Functions

static audit_admin ($p_module)
 Audit action from the administration menu. More...
 
static clean_session ()
 clean the sessions More...
 
static get_list ($p_dossier)
 return an array with all the active users who can access $p_dossier including the global admin. More...
 
static grant_admin_access ($p_login, $p_dossier)
 Grant access to folder, grant administrator profile , all the ledgers and all the action. More...
 
static remove_inexistant_user ($p_dossier)
 
static revoke_access ($p_login, $p_dossier)
 Remove a user and all his privileges So it cannot connect anymore and all his privileges are removed from the dossier. More...
 

Data Fields

 $access_mode
 MOBILE or PC depending if when connecting $login contains @mobile. More...
 
 $active
 1 active , 0 disables More...
 
 $admin
 is or is not admin More...
 
 $db
 database connx More...
 
 $email
 user's email More...
 
 $first_name
 
 $id
 in account_repository , ac_users.use_id More...
 
 $login
 login lower case More...
 
 $name
 
 $pass
 password More...
 
 $password
 password More...
 
 $valid
 is or is not valid More...
 

Private Member Functions

 connect_user ()
 connect the user and set the $_SESSION variables if not set thanks the $_REQUEST
More...
 
 set_default_periode ()
 

Detailed Description

Data & function about connected users.

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

Constructor & Destructor Documentation

◆ __construct()

User::__construct (   $p_cn,
  $p_id = -1 
)

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

50  {
51  $this->db=$p_cn;
52  // if p_id is not set then check the connected user
53  if ($p_id==-1)
54  {
55  $this->connect_user();
56  }
57  else // if p_id is set get data of another user
58  {
59  $this->id=$p_id;
60  $this->load();
61  }
62  }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ Admin()

User::Admin ( )

synomym for isAdmin,

Deprecated:

Definition at line 634 of file user.class.php.

635  {
636  return $this->isAdmin();
637  }

◆ audit()

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

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

1364  {
1365  global $audit;
1366  if ($audit)
1367  {
1368  if ($p_module==""&&isset($_REQUEST['ac']))
1369  {
1370  $p_module=$_REQUEST['ac'];
1371  }
1372  $cn=new Database();
1373  if (isset($_REQUEST['gDossier']))
1374  $p_module.=" dossier : ".$_REQUEST['gDossier'];
1375  $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
1376 
1377  $cn->exec_sql($sql,
1378  array(
1379  $_SESSION[SESSION_KEY.'g_user'],
1380  $_SERVER["REMOTE_ADDR"],
1381  $p_module,
1382  $_SERVER['REQUEST_URI'],
1383  $action));
1384  }
1385  }

◆ audit_admin()

static User::audit_admin (   $p_module)
static

Audit action from the administration menu.

Parameters
$p_moduledescription of the action

Definition at line 1349 of file user.class.php.

1350  {
1351  $cn=new Database();
1352  $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
1353 
1354  $cn->exec_sql($sql,
1355  array(
1356  $_SESSION[SESSION_KEY.'g_user'],
1357  $_SERVER["REMOTE_ADDR"],
1358  $p_module,
1359  $_SERVER['REQUEST_URI'],
1360  'ADMIN'));
1361  }

◆ can_add_action()

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 1462 of file user.class.php.

1463  {
1464  $r=$this->db->get_value(' select count(*)
1465  from user_sec_action_profile
1466  where p_granted=$2
1467  and p_id=$1', array($this->get_profile(), $p_profile));
1468  if ($r==0)
1469  {
1470  return false;
1471  }
1472  return true;
1473  }

◆ can_delete_action()

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 1499 of file user.class.php.

1500  {
1501  if ($this->Admin()==1)
1502  return TRUE;
1503  if ($this->get_status_security_action()==0)
1504  return TRUE;
1505  $profile=$this->get_profile();
1506  $r=$this->db->get_value(" select count(*) from action_gestion where ag_id=$1 and ag_dest in
1507  (select p_granted from user_sec_action_profile where ua_right='W' and p_id=$2) ", array($dtoc, $profile));
1508  if ($r==0)
1509  return FALSE;
1510  return true;
1511  }

◆ can_print()

User::can_print (   $p_action,
  $p_js = 0 
)

Definition at line 1062 of file user.class.php.

1063  {
1064  if ($this->check_print($p_action)==0)
1065  {
1066  $this->audit('FAIL');
1067  if ($p_js==1)
1068  {
1069  echo create_script("alert_box(content[59])");
1070  }
1071  else
1072  {
1073  echo '<div class="redcontent">';
1074  echo '<h2 class="error">',
1075  htmlspecialchars(_("Cette action ne vous est pas autorisée Contactez votre responsable")),
1076  '</h2>';
1077  echo '</div>';
1078  }
1079  exit(-1);
1080  }
1081  }

◆ can_read_action()

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 1518 of file user.class.php.

1519  {
1520  if ($this->Admin()==1)
1521  return true;
1522  $profile=$this->get_profile();
1523  $r=$this->db->get_value(" select count(*) from action_gestion where ag_id=$1 and (ag_dest in
1524  (select p_granted from user_sec_action_profile where p_id=$2) or ag_owner=$3)",
1525  array($dtoc, $profile, $this->login));
1526  if ($r==0)
1527  return false;
1528  return true;
1529  }

◆ can_read_repo()

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 1557 of file user.class.php.

1558  {
1559  if ($this->Admin()==1)
1560  return true;
1561  $profile=$this->get_profile();
1562  $r=$this->db->get_value("select count(*)
1563  from profile_sec_repository
1564  where
1565  r_id=$1
1566  and p_id =$2
1567  ", array($p_repo, $profile));
1568  if ($r==0)
1569  return false;
1570  return true;
1571  }

◆ can_request()

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

Definition at line 1013 of file user.class.php.

1014  {
1015  if ($this->check_action($p_action)==0)
1016  {
1017  $this->audit('FAIL');
1018  if ($p_js==1)
1019  {
1020  echo create_script("alert_box(content[59])");
1021  }
1022  elseif ($p_js==2)
1023  {
1024  record_log(_("Access invalid").$p_action);
1025  }
1026  else
1027  {
1028  echo '<h2 class="error">',
1029  htmlspecialchars(_("Cette action ne vous est pas autorisée Contactez votre responsable")),
1030  '</h2>';
1031  echo '</div>';
1032  }
1033  exit(-1);
1034  }
1035  }

◆ can_write_action()

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 1480 of file user.class.php.

1481  {
1482  if ($this->Admin()==1)
1483  return TRUE;
1484  if ($this->get_status_security_action()==0)
1485  return TRUE;
1486  $profile=$this->get_profile();
1487  $r=$this->db->get_value(" select count(*) from action_gestion where ag_id=$1 and ag_dest in
1488  (select p_granted from user_sec_action_profile where ua_right in ('W','O') and p_id=$2) ", array($dtoc, $profile));
1489  if ($r==0)
1490  return FALSE;
1491  return true;
1492  }

◆ can_write_repo()

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 1536 of file user.class.php.

1537  {
1538  if ($this->Admin()==1)
1539  return true;
1540  $profile=$this->get_profile();
1541  $r=$this->db->get_value("select count(*)
1542  from profile_sec_repository
1543  where
1544  r_id=$1
1545  and p_id =$2
1546  and ur_right='W'", array($p_repo, $profile));
1547  if ($r==0)
1548  return false;
1549  return true;
1550  }

◆ Check()

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 397 of file user.class.php.

398  {
399 
400  $res=0;
401  $pass5=md5($this->pass);
402 
403  $cn=new Database();
404  $sql="select ac_users.use_login,ac_users.use_active, ac_users.use_pass,
405  use_admin,use_first_name,use_name
406  from ac_users
407  where ac_users.use_id=$1
408  and ac_users.use_active=1
409  and ac_users.use_pass=$2";
410  $ret=$cn->exec_sql($sql, array($this->id, $pass5));
412  if ($res>0)
413  {
415  $_SESSION[SESSION_KEY.'use_admin']=$r['use_admin'];
416  $_SESSION[SESSION_KEY.'use_name']=$r['use_name'];
417  $_SESSION[SESSION_KEY.'use_first_name']=$r['use_first_name'];
418  $_SESSION[SESSION_KEY.'isValid']=1;
419 
420  $this->admin=$_SESSION[SESSION_KEY.'use_admin'];
421  $this->name=$_SESSION[SESSION_KEY.'use_name'];
422  $this->first_name=$_SESSION[SESSION_KEY.'use_first_name'];
423  $this->load_global_pref();
424  }
425  $sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
426 
427  if ($res==0)
428  {
429  $cn->exec_sql($sql,
430  array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"],
431  $from, $_SERVER['REQUEST_URI'], 'FAIL'));
432  if (!$silent)
433  {
434  echo '<script> alert(\''._('Utilisateur ou mot de passe incorrect').'\')</script>';
435  redirect('index.html');
436  }
437  $this->valid=0;
438  session_unset();
439  exit-1;
440  }
441  else
442  {
443  if ($from=='LOGIN')
444  $cn->exec_sql($sql,
445  array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"], $from,
446  $_SERVER['REQUEST_URI'], 'SUCCESS'));
447  $this->valid=1;
448  }
449 
450  return $ret;
451  }

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

+ Here is the call graph for this function:

◆ check_action()

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 842 of file user.class.php.

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

◆ check_dossier()

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 1192 of file user.class.php.

1193  {
1194  $this->Admin();
1195  if ($this->admin==1||$this->is_local_admin($p_dossier_id)==1)
1196  return 'L';
1197  $cn=new Database();
1198 
1199  $dossier=$cn->get_value("select 'R' from jnt_use_dos where dos_id=$1 and use_id=$2",
1200  array($p_dossier_id, $this->id));
1201  $dossier=($dossier=='')?'X':$dossier;
1202  if ($dossier=='X')
1203  {
1204  $this->audit('FAIL', "Access folder ");
1205  if (!$silent)
1206  {
1207  alert(_('Dossier non accessible'));
1208  exit();
1209  }
1210  }
1211  return $dossier;
1212  }

◆ check_jrn()

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 1176 of file user.class.php.

1177  {
1178  return $this->get_ledger_access($p_jrn);
1179  }

◆ check_module()

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 813 of file user.class.php.

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

◆ check_print()

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 1043 of file user.class.php.

1044  {
1045  global $audit, $cn;
1046  $this->audit('AUDIT', $p_action);
1047  if ($this->Admin()==1)
1048  return 1;
1049 
1050  $res=$cn->get_value("select count(*) from profile_menu
1051  join profile_user using (p_id)
1052  where user_name=$1 and me_code=$2 ", array($this->login, $p_action));
1053  return $res;
1054  }

◆ clean_session()

static User::clean_session ( )
static

clean the sessions

Definition at line 1788 of file user.class.php.

1789  {
1790 
1791  $aSession=$_SESSION;
1792  foreach($aSession as $key => $value) {
1793  if(DEBUGNOALYSS>1) { echo "[$key]=>[$value]";}
1794 
1795  if ( strpos($key,SESSION_KEY) === 0) {
1796  unset($_SESSION[$key]);
1797  if(DEBUGNOALYSS>1) { echo "=> [$key] cleaned";}
1798  }
1799  }
1800  }

References $value.

◆ connect_user()

User::connect_user ( )
private

connect the user and set the $_SESSION variables if not set thanks the $_REQUEST

Definition at line 67 of file user.class.php.

68  {
69  if (!isset($_SESSION[SESSION_KEY.'g_user']))
70  {
71  $http=new \HttpInput();
72  $user_login=$http->request("p_user", "string", "");
73  $user_password=$http->request("p_pass", "string", "");
74 
75  if ($user_login!=""&&$user_password!="")
76  {
77  $_SESSION[SESSION_KEY."g_user"]=$user_login;
78  $_SESSION[SESSION_KEY."g_pass"]=$user_password;
79  }
80  else
81  {
82  echo '<h2 class="error">'._('Session expirée<br>Utilisateur déconnecté').'</h2>';
83  redirect('index.php', 1);
84  exit();
85  }
86 
87 
88  if (strpos($user_login, '@mobile')!=false)
89  {
90  $this->access_mode='MOBILE';
91  $this->login=str_ireplace("@mobile", "", $user_login);
92  }
93  else
94  {
95  $this->access_mode='PC';
96  $this->login=strtolower($user_login);
97  }
98 
99  $_SESSION[SESSION_KEY."access_mode"]=$this->access_mode;
100  $_SESSION[SESSION_KEY.'g_user']=$this->login;
101  }
102  $this->login=$_SESSION[SESSION_KEY."g_user"];
103  $this->pass=$_SESSION[SESSION_KEY.'g_pass'];
104  $this->id=-1;
105  $this->lang=(isset($_SESSION[SESSION_KEY.'g_lang']))?$_SESSION[SESSION_KEY.'g_lang']:'fr_FR.utf8';
106  $this->access_mode=$_SESSION[SESSION_KEY."access_mode"];
107 
108  if ($this->load()==-1)
109  {
110  echo '<h2 class="error">'._('Utilisateur ou mot de passe incorrect').'</h2>';
111 
112  redirect('logout.php', 1);
113  exit();
114  }
115 
116  $this->load_global_pref();
117 
118  $_SESSION[SESSION_KEY.'g_lang']=$this->lang;
119  $this->valid=(isset($_SESSION[SESSION_KEY.'isValid']))?1:0;
120  if (isset($_SESSION[SESSION_KEY.'g_theme']))
121  {
122  $this->theme=$_SESSION[SESSION_KEY.'g_theme'];
123  }
124  $_SESSION[SESSION_KEY.'use_admin']=$this->admin;
125  $_SESSION[SESSION_KEY.'use_name']=$this->name;
126  $_SESSION[SESSION_KEY.'use_first_name']=$this->first_name;
127  }

References $access_mode, $admin, $first_name, $http, $login, $name, $user_password, exit, if, load(), load_global_pref(), and redirect().

Referenced by __construct().

+ Here is the call graph for this function:

◆ get_access_mode()

User::get_access_mode ( )

access_mode tells what mode must be used : pc or mobile

Definition at line 132 of file user.class.php.

133  {
134  return $this->access_mode;
135  }

References $access_mode.

◆ get_available_folder()

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 1306 of file user.class.php.

1307  {
1308  $cn=new Database();
1309  $filter="";
1310  if ($this->admin==0)
1311  {
1312  // show only available folders
1313  // if user is not an admin
1314  $Res=$cn->exec_sql("select
1315  distinct dos_id,dos_name,dos_description
1316  from ac_users
1317  natural join jnt_use_dos
1318  natural join ac_dossier
1319  where
1320  use_login= $1
1321  and use_active = 1
1322  and ( dos_name ilike '%' || $2 || '%' or dos_description ilike '%' || $2 || '%' )
1323  order by dos_name", array($this->login, $p_filter));
1324  }
1325  else
1326  {
1327  $Res=$cn->exec_sql("select
1328  distinct dos_id,dos_name,dos_description from ac_dossier
1329  where
1330  dos_name ilike '%' || $1|| '%' or dos_description ilike '%' || $1 || '%'
1331  order by dos_name", array($p_filter));
1332  }
1333 
1335  if ($max==0)
1336  return 0;
1337 
1338  for ($i=0; $i<$max; $i++)
1339  {
1341  }
1342  return $array;
1343  }

◆ get_available_repository()

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 1106 of file user.class.php.

1107  {
1108  $profile=$this->get_profile();
1109  $r=array();
1110  if ($p_access=='R')
1111  {
1112  $r=$this->db->get_array("select distinct u.r_id,r_name
1113  from
1114  profile_sec_repository as u
1115  join stock_repository as s on(u.r_id=s.r_id)
1116  where
1117  p_id =$1
1118  and ur_right='W'
1119  order by 2
1120  ", array($profile));
1121  }
1122  if ($p_access=='W')
1123  {
1124  $r=$this->db->get_array("select distinct u.r_id,r_name
1125  from
1126  profile_sec_repository as u
1127  join stock_repository as s on(u.r_id=s.r_id)
1128  where
1129  p_id =$1 order by 2
1130  ", array($profile));
1131  }
1132  return $r;
1133  }

◆ get_exercice()

User::get_exercice ( )

Definition at line 993 of file user.class.php.

994  {
995  $sql="select p_exercice from parm_periode where p_id=$1";
996  $Ret=$this->db->exec_sql($sql,[$this->get_periode()]);
997  if (Database::num_row($Ret)==1)
998  {
999  $r=Database::fetch_array($Ret, 0);
1000  return $r['p_exercice'];
1001  }
1002  else
1003  return 0;
1004  }

◆ get_first_week_day()

User::get_first_week_day ( )

Definition at line 1773 of file user.class.php.

1774  {
1775  $repocn=new Database();
1776  $result=$repocn->get_value("select parameter_value from user_global_pref where parameter_type=$1 and user_id=$2 ",
1777  array("first_week_day", $this->login));
1778  if ($repocn->count()==0)
1779  {
1780  $this->save_global_preference("first_week_day", 1);
1781  return 1;
1782  }
1783  return $result;
1784  }

References $result, and save_global_preference().

+ Here is the call graph for this function:

◆ get_folder_access()

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 462 of file user.class.php.

463  {
464 
465  if ($p_dossier==0)
466  $p_dossier=dossier::id();
467  if ($this->admin==1)
468  return 'R';
469  $cn=new Database();
470 
471  $sql="select 'R' from jnt_use_dos where use_id=$1 and dos_id=$2";
472 
473  $res=$cn->get_value($sql, array($this->id, $p_dossier));
474 
475  if ($cn->get_affected()==0)
476  return 'X';
477  return $res;
478  }

◆ get_ledger()

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 550 of file user.class.php.

551  {
552  $p_type=strtoupper($p_type);
553  if (!in_array($p_type, ["FIN", "ALL", "ODS", "VEN", 'ACH']))
554  {
555  record_log(sprintf("UGL1, p_type %s", $p_type));
556  throw new Exception("UGL1"._("Type incorrecte"));
557  }
558  if ($disable==TRUE)
559  {
560  $sql_enable="";
561  }
562  else
563  {
564  $sql_enable="and jrn_enable=1";
565  }
566  if ($this->admin!=1&&$this->is_local_admin()!=1&&$this->get_status_security_ledger()==1)
567  {
568  $sql_type=($p_type=='ALL')?'':"and jrn_def_type=upper('".sql_string($p_type)."')";
569  switch ($p_access)
570  {
571  case 3:
572  $sql_access=" and uj_priv!= 'X' ";
573  break;
574  case 2:
575  $sql_access=" and uj_priv = 'W' and jrn_enable=1 ";
576  break;
577 
578  case 1:
579  $sql_access=" and ( uj_priv = 'R' or uj_priv='W') ";
580  break;
581  }
582 
583  $sql="select jrn_def_id,jrn_def_type,
584  jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
585  jrn_deb_max_line,jrn_cred_max_line,jrn_def_description,jrn_enable
586  from jrn_def join jrn_type on jrn_def_type=jrn_type_id
587  join user_sec_jrn on uj_jrn_id=jrn_def_id
588  where
589  uj_login='".$this->login."'".
590  $sql_type.$sql_access.$sql_enable.
591  " order by jrn_Def_name";
592  }
593  else
594  {
595  $sql_type=($p_type=='ALL')?' '.$sql_enable:"where jrn_def_type=upper('".sql_string($p_type)."') ".$sql_enable;
596  $sql="select jrn_def_id,jrn_def_type,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line,
597  jrn_type_id,jrn_desc,'W' as uj_priv,jrn_def_description,jrn_enable
598  from jrn_def join jrn_type on jrn_def_type=jrn_type_id
599  $sql_type
600  order by jrn_Def_name";
601  }
602  $res=$this->db->exec_sql($sql);
603  if (Database::num_row($res)==0)
604  return null;
606  return $array;
607  }

◆ get_ledger_access()

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 519 of file user.class.php.

520  {
521  if ($this->admin==1||
522  $this->is_local_admin(dossier::id())==1||$this->get_status_security_ledger()==0)
523  return 'W';
524 
525  $sql="select uj_priv from user_sec_jrn where uj_login=$1 and uj_jrn_id=$2";
526  $res=$this->db->get_value($sql, array($this->login, $p_ledger));
527 
528  if ($res=='')
529  $res='X';
530  return $res;
531  }

◆ get_ledger_sql()

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 616 of file user.class.php.

617  {
618  $aLedger=$this->get_ledger($p_type, $p_access);
619  if (empty($aLedger))
620  return ' jrn_def_id < 0 ';
621  $sql=" jrn_def_id in (";
622  foreach ($aLedger as $row)
623  {
624  $sql.=$row['jrn_def_id'].',';
625  }
626  $sql.='-1)';
627  return $sql;
628  }

◆ get_limit_current_exercice()

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 1218 of file user.class.php.

1219  {
1221  $periode=new Periode($this->db);
1222  list($per_start, $per_end)=$periode->get_limit($current_exercice);
1223  $start=$per_start->first_day();
1224  $end=$per_end->last_day();
1225  return array($start, $end);
1226  }

◆ get_list()

static 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 1150 of file user.class.php.

1151  {
1152  $sql="select distinct use_id,use_login,use_first_name,use_name from ac_users
1153  left outer join jnt_use_dos using (use_id)
1154  where
1155  (dos_id=$1 and use_active=1) or (use_active=1 and use_admin=1)
1156  order by use_login,use_name";
1157 
1158  $repo=new Database();
1159  $array=$repo->get_array($sql, array($p_dossier));
1160  if ($repo->size()==0)
1161  throw new Exception('Error inaccessible folder');
1162  return $array;
1163  }

◆ get_mini_report()

User::get_mini_report ( )

return the mini rapport to display on the welcome page

Returns
0 if nothing if found or the report to display (form_definition.fr_id)

Definition at line 724 of file user.class.php.

725  {
726  $array=$this->get_preference();
727  $fr_id=(isset($array['MINIREPORT']))?$array['MINIREPORT']:0;
728  return $fr_id;
729  }

◆ get_periode()

User::get_periode ( )

Get the default periode from the user's preferences.

Returns
the default periode

Definition at line 707 of file user.class.php.

708  {
709 
710  $array=$this->get_preference();
711  if (!isset($array['PERIODE']))
712  {
713  $this->set_default_periode();
714  $array=$this->get_preference();
715  }
716  return $array['PERIODE'];
717  }

◆ get_preference()

User::get_preference ( )

Get the default user's preferences.

Returns
array of (parameter_type => parameter_value)

Definition at line 781 of file user.class.php.

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

◆ get_profile()

User::get_profile ( )

return the profile (p_id)

Returns
profile.p_id

Definition at line 1405 of file user.class.php.

1406  {
1407  $profile=$this->db->get_value("select p_id from profile_user where
1408  lower(user_name)=lower($1)", array($this->login));
1409  return $profile;
1410  }

◆ get_readable_profile()

User::get_readable_profile ( )

Compute the SQL string for the readable profile, the subselect for p_id , example p_id in $g_user->get_readable_profile.

The administrator can read all the profiles

Returns
SQL string with the subselect for p_id

Definition at line 1441 of file user.class.php.

1442  {
1443  if ($this->admin!=1)
1444  {
1445  $sql=" (select p_granted "
1446  ." from user_sec_action_profile "
1447  ." where ua_right in ('W','R') and p_id=".$this->get_profile().") ";
1448  }
1449  else
1450  {
1451  $sql="(select p_id from profile)";
1452  }
1453  return $sql;
1454  }

◆ get_status_security_action()

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 1738 of file user.class.php.

1739  {
1740  $security=$this->db->get_value("select us_action from user_active_security
1741  where
1742  us_login=$1", [$this->login]);
1743  $n_security=($security=="Y")?1:0;
1744  return $n_security;
1745  }

References db.

◆ get_status_security_ledger()

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 1702 of file user.class.php.

1703  {
1704  $security=$this->db->get_value("select us_ledger from user_active_security
1705  where
1706  us_login=$1", [$this->login]);
1707  $n_security=($security=="Y")?1:0;
1708  return $n_security;
1709  }

References db.

◆ get_writable_profile()

User::get_writable_profile ( )

Compute the SQL string for the writable profile, the subselect for p_id , example p_id in $g_user->get_writable_profile.

The administrator can access all the profiles

Returns
SQL string with the subselect for p_id

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

1420  {
1421  if ($this->admin!=1)
1422  {
1423  $sql=" (select p_granted "
1424  ." from user_sec_action_profile "
1425  ." where ua_right='W' and p_id=".$this->get_profile().") ";
1426  }
1427  else
1428  {
1429  $sql="(select p_id from profile)";
1430  }
1431  return $sql;
1432  }

◆ getActive()

User::getActive ( )
Returns
mixed

Definition at line 261 of file user.class.php.

262  {
263  return $this->active;
264  }

References $active.

◆ getAdmin()

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

Definition at line 197 of file user.class.php.

198  {
199  return $this->admin;
200  }

References $admin.

◆ getDb()

User::getDb ( )
Returns
mixed

Definition at line 181 of file user.class.php.

182  {
183  return $this->db;
184  }

References $db.

◆ getEmail()

User::getEmail ( )
Returns
mixed

Definition at line 309 of file user.class.php.

310  {
311  return $this->email;
312  }

References $email.

◆ getFirstName()

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

Definition at line 229 of file user.class.php.

230  {
231  return $this->first_name;
232  }

References $first_name.

◆ getId()

User::getId ( )
Returns
int|mixed

Definition at line 149 of file user.class.php.

149  : int
150  {
151  return $this->id;
152  }

References $id.

◆ getLogin()

User::getLogin ( )
Returns
string

Definition at line 277 of file user.class.php.

277  : string
278  {
279  return $this->login;
280  }

References $login.

◆ getName()

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

Definition at line 245 of file user.class.php.

246  {
247  return $this->name;
248  }

References $name.

◆ getPass()

User::getPass ( )
Returns
default|mixed|string|string[]|null

Definition at line 165 of file user.class.php.

166  {
167  return $this->pass;
168  }

References $pass.

◆ getPassword()

User::getPassword ( )
Returns
mixed

Definition at line 293 of file user.class.php.

294  {
295  return $this->password;
296  }

References $password.

◆ getValid()

User::getValid ( )
Returns
int

Definition at line 213 of file user.class.php.

213  : int
214  {
215  return $this->valid;
216  }

References $valid.

◆ grant_admin_access()

static 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 1630 of file user.class.php.

1631  {
1632  $repo_cnx=new Database();
1633  $user=$repo_cnx->get_array("select use_id,use_login
1634  from ac_users
1635  where use_login=$1", array($p_login));
1636 
1637  if (!$user)
1638  return false;
1639  $cn_dossier=new Database($p_dossier);
1640  // if not access to DB
1641  if (
1642  $repo_cnx->get_value("select count(*) from jnt_use_dos where use_id=$1 and dos_id=$2",
1643  array($user[0]['use_id'], $p_dossier))==0
1644  )
1645  {
1646  $repo_cnx->exec_sql("insert into jnt_use_dos(use_id,dos_id) values ($1,$2)",
1647  array($user[0]['use_id'], $p_dossier));
1648  }
1649  //------ Give him the admin menu
1650  if ($cn_dossier->get_value("select count(*) from profile_user where user_name=$1", array($user[0]['use_login']))==0)
1651  {
1652  $cn_dossier->exec_sql('insert into profile_user(user_name,p_id) values($1,1)', array($user[0]['use_login']));
1653  }
1654  // Grant all action + ledger to him
1655  $cn_dossier->exec_sql("delete from user_sec_act where ua_login=$1", array($p_login));
1656 
1657  $cn_dossier->exec_sql("insert into user_sec_act (ua_login,ua_act_id)"
1658  ." select $1 ,ac_id from action ", array($p_login));
1659 
1660  $cn_dossier->exec_sql("delete from user_sec_jrn where uj_login=$1", array($p_login));
1661  $cn_dossier->exec_sql("insert into user_sec_jrn(uj_login,uj_jrn_id,uj_priv)"
1662  ." select $1,jrn_def_id,'W' from jrn_def", array($p_login));
1663  }

Referenced by Dossier\synchro_admin().

◆ insert()

User::insert ( )

Definition at line 377 of file user.class.php.

378  {
379 
380  $Sql="INSERT INTO ac_users(
381  use_first_name, use_name, use_login, use_active,
382  use_admin, use_pass, use_email)
383  VALUES ($1, $2, $3, $4, $5, $6, $7) returning use_id";
384 
385  $cn=new Database();
386  $this->id=$cn->get_value($Sql,
387  array($this->first_name, $this->last_name, $this->login, 1, $this->admin, $this->pass, $this->email));
388  }

References $cn.

◆ insert_default_global_pref()

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 932 of file user.class.php.

933  {
934 
935  $default_parameter=array("THEME"=>"classic",
936  "PAGESIZE"=>"50",
937  'TOPMENU'=>'TEXT',
938  'LANG'=>'fr_FR.utf8',
939  'csv_fieldsep'=>'0',
940  'csv_decimal'=>'0',
941  'csv_encoding'=>'utf8',
942  'first_week_day'=>1
943  );
944  $cn=new Database();
945  $sql="insert into user_global_pref(user_id,parameter_type,parameter_value)
946  values ($1,$2,$3)";
947  if ($p_type=="")
948  {
949  foreach ($default_parameter as $name=> $value)
950  {
951  $cn->exec_sql($sql, array($this->login, $name, $value));
952  }
953  }
954  else
955  {
956  $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
957  $cn->exec_sql($sql, array($this->login, $p_type, $value));
958  }
959  }

◆ is_local_admin()

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 1095 of file user.class.php.

1096  {
1097  return 0;
1098  }

◆ isAdmin()

User::isAdmin ( )

Check if an user is an admin.

Returns
1 for yes 0 for no

Definition at line 644 of file user.class.php.

645  {
646  $this->admin=0;
647  $pass5=md5($this->pass);
648  $sql="select count(*) from ac_users where use_login=$1
649  and use_active=1 and use_admin=1 ";
650 
651  $cn=new Database();
652  $this->admin=$cn->get_value($sql, array($this->login));
653  return $this->admin;
654  }

◆ load()

User::load ( )

Definition at line 328 of file user.class.php.

329  {
330  /* if this->id == -1, it is unknown so we have to retrieve it from
331  the database thanks it login */
332  if ($this->id<0)
333  {
334  $sql_cond=" where lower(use_login)=lower($1)";
335  $sql_array=array($this->login);
336  }
337  else
338  {
339  $sql_cond=" where use_id=$1";
340  $sql_array=array($this->id);
341  }
342  $sql="select use_id,
343  use_first_name,
344  use_name,
345  use_login,
346  use_active,
347  use_admin,
348  use_pass,
349  use_email
350  from ac_users ";
351  $cn=new Database();
352  $Res=$cn->exec_sql($sql.$sql_cond, $sql_array);
353  if (($Max=Database::num_row($Res))==0)
354  return -1;
356  $this->id=$row['use_id'];
357  $this->first_name=$row['use_first_name'];
358  $this->last_name=$row['use_name'];
359  $this->name=$row['use_name'];
360  $this->active=$row['use_active'];
361  $this->login=strtolower($row['use_login']);
362  $this->admin=$row['use_admin'];
363  $this->password=$row['use_pass'];
364  $this->email=$row['use_email'];
365  }

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

Referenced by __construct(), and connect_user().

+ Here is the call graph for this function:

◆ load_global_pref()

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 880 of file user.class.php.

881  {
882  $cn=new Database();
883  // Load everything in an array
884  $Res=$cn->exec_sql("select parameter_type,parameter_value from
885  user_global_pref
886  where user_id=$1", [$this->login]);
888  if ($Max==0)
889  {
891  $this->load_global_pref();
892  return;
893  }
894  // Load value into array
895  $line=array();
896  for ($i=0; $i<$Max; $i++)
897  {
899  $type=$row['parameter_type'];
900  $line[$type]=$row['parameter_value'];
901  }
902  // save array into g_ variable
903  $array_pref=array('g_theme'=>'THEME',
904  'g_pagesize'=>'PAGESIZE',
905  'g_topmenu'=>'TOPMENU',
906  'g_lang'=>'LANG',
907  'csv_fieldsep'=>'csv_fieldsep',
908  'csv_decimal'=>'csv_decimal',
909  'csv_encoding'=>'csv_encoding',
910  'first_week_day'=>'first_week_day');
911 
912  foreach ($array_pref as $name=> $parameter)
913  {
914  if (!isset($line[$parameter]))
915  {
916  $this->insert_default_global_pref($parameter);
917  $this->load_global_pref();
918  return;
919  }
920  $_SESSION[SESSION_KEY.$name]=$line[$parameter];
921  }
922  }

Referenced by Check(), and connect_user().

◆ remove_inexistant_user()

static User::remove_inexistant_user (   $p_dossier)
static

Definition at line 1665 of file user.class.php.

1666  {
1667  $cnx_repo=new Database();
1668  $name=$cnx_repo->format_name($p_dossier, 'dos');
1669  if ($cnx_repo->exist_database($name)==0)
1670  return;
1671  $cnx_dossier=new Database($p_dossier);
1672  if ($cnx_dossier->exist_table('profile_user'))
1673  $a_user=$cnx_dossier->get_array('select user_name from profile_user');
1674  else
1675  return;
1676 
1677  if (!$a_user)
1678  return;
1679  $nb=count($a_user);
1680  for ($i=0; $i<$nb; $i++)
1681  {
1682  if ($cnx_repo->get_value('select count(*) from ac_users where use_login=$1', array($a_user[$i]['user_name']))==0)
1683  {
1684  if ($cnx_dossier->exist_table('user_sec_jrn'))
1685  $cnx_dossier->exec_sql("delete from user_sec_jrn where uj_login=$1", array($a_user[$i]['user_name']));
1686  $cnx_dossier->exec_sql("delete from profile_user where user_name=$1", array($a_user[$i]['user_name']));
1687  if ($cnx_dossier->exist_table('user_sec_act'))
1688  $cnx_dossier->exec_sql("delete from user_sec_act where ua_login=$1", array($a_user[$i]['user_name']));
1689  if ($cnx_dossier->exist_table('user_sec_jrn'))
1690  $cnx_dossier->exec_sql("delete from user_sec_jrn where uj_login=$1", array($a_user[$i]['user_name']));
1691  if ($cnx_dossier->exist_table('user_active_security'))
1692  $cnx_dossier->exec_sql("delete from user_active_security where us_login=$1",
1693  array($a_user[$i]['user_name']));
1694  }
1695  }
1696  }

References $i, $name, and $nb.

Referenced by Dossier\upgrade().

◆ revoke_access()

static 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 1606 of file user.class.php.

1607  {
1608  // connect to the repository
1609  $repo_cnx=new Database();
1610 
1611  // Retrieve the user
1612  $user=$repo_cnx->get_array('select use_id,use_login from ac_users where use_login=$1', array($p_login));
1613  if (!$user)
1614  return false;
1615 
1616  // remove him from jnt_use_dos
1617  $repo_cnx->exec_sql("delete from jnt_use_dos WHERE use_id=$1 and dos_id=$2",
1618  array($user[0]['use_id'], $p_dossier));
1619 
1620  // Remove user from user's dossier
1621  $cn_dossier=new Database($p_dossier);
1622  $cn_dossier->exec_sql("delete from profile_user where user_name=$1", array($p_login));
1623  $cn_dossier->exec_sql("delete from user_sec_act where ua_login=$1", array($p_login));
1624  }

◆ save()

User::save ( )

Definition at line 367 of file user.class.php.

368  {
369 
370  $Sql="update ac_users set use_first_name=$1, use_name=$2
371  ,use_active=$3,use_admin=$4,use_pass=$5 ,use_email = $7 where use_id=$6";
372  $cn=new Database();
373  $Res=$cn->exec_sql($Sql,
374  array($this->first_name, $this->last_name, $this->active, $this->admin, $this->pass, $this->id, $this->email));
375  }

References $cn, and $Res.

◆ save_email()

User::save_email (   $p_email)

Save the password from PREFERENCE MODULE.

Parameters
type$p_email

Definition at line 1593 of file user.class.php.

1594  {
1595  $repo=new Database();
1596  $repo->exec_sql("update ac_users set use_email=$1 where use_login=$2",
1597  array($p_email, $_SESSION[SESSION_KEY.'g_user']));
1598  }

◆ save_global_preference()

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 757 of file user.class.php.

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

Referenced by get_first_week_day().

◆ save_password()

User::save_password (   $p_pass1,
  $p_pass2 
)

Definition at line 1573 of file user.class.php.

1574  {
1575  if ($p_pass1==$p_pass2)
1576  {
1577  $repo=new Database();
1578  $l_pass=md5($_POST['pass_1']);
1579  $repo->exec_sql("update ac_users set use_pass=$1 where use_login=$2",
1580  array($l_pass, $_SESSION[SESSION_KEY.'g_user']));
1581  $_SESSION[SESSION_KEY.'g_pass']=$_POST['pass_1'];
1582  }
1583  else
1584  {
1585  alert(_("Les mots de passe ne correspondent pas. Mot de passe inchangé"));
1586  }
1587  }

◆ save_profile()

User::save_profile (   $p_id)

Definition at line 1387 of file user.class.php.

1388  {
1389  $count=$this->db->get_value("select count(*) from profile_user where user_name=$1", array($this->login));
1390  if ($count==0)
1391  {
1392  $this->db->exec_sql("insert into profile_user(p_id,user_name)
1393  values ($1,$2)", array($p_id, $this->login));
1394  }
1395  else
1396  {
1397  $this->db->exec_sql("update profile_user set p_id=$1 where user_name=$2", array($p_id, $this->login));
1398  }
1399  }

◆ set_access_mode()

User::set_access_mode (   $access_mode)

access_mode tells what mode must be used : pc or mobile

Definition at line 140 of file user.class.php.

140  : object
141  {
142  $this->access_mode=$access_mode;
143  return $this;
144  }

References $access_mode.

◆ set_default_periode()

User::set_default_periode ( )
private

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

670  {
671 
672  /* get the first periode */
673  $sql='select min(p_id) as pid '
674  .' from parm_periode '
675  .' where p_closed = false and p_start = (select min(p_start) from parm_periode)';
676  $Res=$this->db->exec_sql($sql);
677 
678  $pid=Database::fetch_result($Res, 0, 0);
679  /* if all the periode are closed, then we use the last closed period */
680  if ($pid==null)
681  {
682  $sql='select min(p_id) as pid '
683  .'from parm_periode '
684  .'where p_start = (select max(p_start) from parm_periode)';
685  $Res2=$this->db->exec_sql($sql);
686  $pid=Database::fetch_result($Res2, 0, 0);
687  if ($pid==null)
688  {
689  throw new Exception(_("Aucune période trouvéee !!!"));
690  }
691 
692  $pid=Database::fetch_result($Res2, 0, 0);
693  }
694 
695  $sql=sprintf("insert into user_local_pref (user_id,parameter_value,parameter_type)
696  values ('%s','%d','PERIODE')", $this->id, $pid);
697  $Res=$this->db->exec_sql($sql);
698  }

◆ set_folder_access()

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 485 of file user.class.php.

486  {
487 
488  $cn=new Database();
489  if ($priv)
490  {
491  // the access is granted
492  $jnt=$cn->get_value("select jnt_id from jnt_use_dos where dos_id=$1 and use_id=$2", array($db_id, $this->id));
493 
494  if ($cn->size()==0)
495  {
496 
497  $Res=$cn->exec_sql("insert into jnt_use_dos(dos_id,use_id) values($1,$2)", array($db_id, $this->id));
498  }
499  }
500  else
501  {
502  // Access is revoked
503  $cn->exec_sql('delete from jnt_use_dos where use_id = $1 and dos_id = $2 ', array($this->id, $db_id));
504  }
505  }

◆ set_mini_report()

User::set_mini_report (   $p_id)

set the mini rapport to display on the welcome page

Definition at line 734 of file user.class.php.

735  {
736  $count=$this->db->get_value("select count(*) from user_local_pref where user_id=$1 and parameter_type=$2",
737  array($this->id, 'MINIREPORT'));
738  if ($count==1)
739  {
740  $sql="update user_local_pref set parameter_value=$1 where user_id=$2 and parameter_type='MINIREPORT'";
741  $Res=$this->db->exec_sql($sql, array($p_id, $this->id));
742  }
743  else
744  {
745  $sql="insert into user_local_pref (user_id,parameter_type,parameter_value)".
746  "values($1,'MINIREPORT',$2)";
747  $Res=$this->db->exec_sql($sql, array($this->id, $p_id));
748  }
749  }

◆ set_periode()

User::set_periode (   $p_periode)

Set the selected periode in the user's preferences.

Parameters
$p_periodeperiode
-$p_user

Definition at line 663 of file user.class.php.

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

◆ set_status_security_action()

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 1752 of file user.class.php.

1753  {
1754  if ($p_value!=0&&$p_value!=1)
1755  throw new Exception(_("Valeur invalide"));
1756  $exist=$this->db->get_value("select count(*) from user_active_security where us_login=$1", [$this->login]);
1757  $flag=($p_value==1)?"Y":"N";
1758  if ($exist==0)
1759  {
1760  $this->db->exec_sql("insert into user_active_security (us_login,us_action,us_ledger) values ($1,$2,$3)",
1761  [$this->login, $flag, 'Y']);
1762  }
1763  else
1764  {
1765  $this->db->exec_sql("update user_active_security set us_action=$1 where us_login = $2",
1766  [$flag, $this->login]);
1767  }
1768  }

References db.

◆ set_status_security_ledger()

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 1716 of file user.class.php.

1717  {
1718  if ($p_value!=0&&$p_value!=1)
1719  throw new Exception(_("Valeur invalide"));
1720  $exist=$this->db->get_value("select count(*) from user_active_security where us_login=$1", [$this->login]);
1721  $flag=($p_value==1)?"Y":"N";
1722  if ($exist==0)
1723  {
1724  $this->db->exec_sql("insert into user_active_security (us_login,us_ledger,us_action) values ($1,$2,$3)",
1725  [$this->login, $flag, 'Y']);
1726  }
1727  else
1728  {
1729  $this->db->exec_sql("update user_active_security set us_ledger=$1 where us_login = $2",
1730  [$flag, $this->login]);
1731  }
1732  }

References db.

◆ setActive()

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

Definition at line 269 of file user.class.php.

269  : void
270  {
271  $this->active=$active;
272  }

References $active.

◆ setAdmin()

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

Definition at line 205 of file user.class.php.

205  : void
206  {
207  $this->admin=$admin;
208  }

References $admin.

◆ setDb()

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

Definition at line 189 of file user.class.php.

189  : void
190  {
191  $this->db=$db;
192  }

References $db, and db.

◆ setEmail()

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

Definition at line 317 of file user.class.php.

317  : void
318  {
319  $this->email=$email;
320  }

References $email.

◆ setFirstName()

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

Definition at line 237 of file user.class.php.

237  : void
238  {
239  $this->first_name=$first_name;
240  }

References $first_name.

◆ setId()

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

Definition at line 157 of file user.class.php.

157  : void
158  {
159  $this->id=$id;
160  }

References $id.

◆ setLogin()

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

Definition at line 285 of file user.class.php.

285  : void
286  {
287  $this->login=$login;
288  }

References $login.

◆ setName()

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

Definition at line 253 of file user.class.php.

253  : void
254  {
255  $this->name=$name;
256  }

References $name, and name.

◆ setPass()

User::setPass (   $pass)
Parameters
default | mixed | string | string[] | null$pass

Definition at line 173 of file user.class.php.

173  : void
174  {
175  $this->pass=$pass;
176  }

References $pass.

◆ setPassword()

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

Definition at line 301 of file user.class.php.

301  : void
302  {
303  $this->password=$password;
304  }

References $password.

◆ setValid()

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

Definition at line 221 of file user.class.php.

221  : void
222  {
223  $this->valid=$valid;
224  }

References $valid.

◆ show_dossier()

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 1237 of file user.class.php.

1238  {
1239  $p_array=$this->get_available_folder($p_filtre);
1240 
1241  $result="";
1242 
1243  $result.="<TABLE id=\"folder\" class=\"result\">";
1244  $result.="<tr>";
1245  $result.="<th>";
1246  $result.=_("Id");
1247  $result.="</th>";
1248  $result.="<th>";
1249  $result.=_("Nom");
1250  $result.="</th>";
1251  $result.="<th>";
1252  $result.=_("Description");
1253  $result.="</th>";
1254  $result.="</tr>";
1255  if ($p_array==0)
1256  {
1257  $result.="<tr>";
1258  $result.='<td style="width:auto" colspan=3>';
1259  $result.=_("Aucun dossier disponible");
1260  $result.='</td>';
1261  $result.="</tr>";
1262  return $result;
1263  }
1264 
1265  for ($i=0; $i<sizeof($p_array); $i++)
1266  {
1267 
1268  $id=$p_array[$i]['dos_id'];
1269  $name=$p_array[$i]['dos_name'];
1270  $desc=$p_array[$i]['dos_description'];
1271  if ($i%2==0)
1272  $tr="odd";
1273  else
1274  $tr="even";
1275  $target="do.php?gDossier=$id";
1276 
1277  $result.="<TR class=\"$tr\">";
1278 
1279  $result.=td($id, ' class="num" ');
1280  $result.="<TD class=\"$tr\">";
1281  $result.="<A class=\"dossier\" HREF=\"$target\">";
1282  $result.=" <B>".h($name)."</B>";
1283  $result.="</A>";
1284  $result.="</TD>";
1285  $desc=($desc=="")?"<i>Aucune description</i>":h($desc);
1286  $desc="<A class=\"dossier\" HREF=\"$target\">$desc</A>";
1287  $result.="<TD class=\"$tr\" >".$desc;
1288  $result.="</TD>";
1289  $result.="</TR>";
1290  }
1291  $result.="</TABLE>";
1292  return $result;
1293  }

◆ update_global_pref()

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 968 of file user.class.php.

969  {
970  $default_parameter=array("THEME"=>"classic",
971  "PAGESIZE"=>"50",
972  "LANG"=>'fr_FR.utf8',
973  'TOPMENU'=>'SELECT',
974  'csv_fieldsep'=>'0',
975  'csv_decimal'=>'0',
976  'csv_encoding'=>'utf8',
977  'first_week_day'=>1
978  );
979  $cn=new Database();
980  $Sql="update user_global_pref set parameter_value=$1
981  where parameter_type=$2 and
982  user_id=$3";
983  $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
984  $cn->exec_sql($Sql, array($value, $p_type, $this->login));
985  }

Field Documentation

◆ $access_mode

User::$access_mode

MOBILE or PC depending if when connecting $login contains @mobile.

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

Referenced by connect_user(), get_access_mode(), and set_access_mode().

◆ $active

User::$active

1 active , 0 disables

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

Referenced by getActive(), and setActive().

◆ $admin

User::$admin

is or is not admin

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

Referenced by connect_user(), getAdmin(), and setAdmin().

◆ $db

User::$db

database connx

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

Referenced by getDb(), and setDb().

◆ $email

User::$email

user's email

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

Referenced by getEmail(), and setEmail().

◆ $first_name

User::$first_name

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

Referenced by connect_user(), getFirstName(), and setFirstName().

◆ $id

User::$id

in account_repository , ac_users.use_id

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

Referenced by getId(), and setId().

◆ $login

User::$login

login lower case

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

Referenced by connect_user(), getLogin(), and setLogin().

◆ $name

User::$name

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

Referenced by connect_user(), getName(), remove_inexistant_user(), and setName().

◆ $pass

User::$pass

password

Definition at line 37 of file user.class.php.

Referenced by getPass(), and setPass().

◆ $password

User::$password

password

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

Referenced by getPassword(), and setPassword().

◆ $valid

User::$valid

is or is not valid

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

Referenced by getValid(), and setValid().


The documentation for this class was generated from the following file:
h
h( $row[ 'oa_description'])
Definition: ajax_anc_detail_operation.php:46
$ret
$ret
Definition: ajax_display_letter.php:51
DatabaseCore\fetch_all
static fetch_all($ret)
wrapper for the function pg_fetch_all
Definition: database_core.class.php:755
User\$pass
$pass
password
Definition: user.class.php:37
Periode
For the periode tables parm_periode and jrn_periode.
Definition: periode.class.php:32
$max
$max
Definition: ajax_boxcard_search.php:40
User\$login
$login
login lower case
Definition: user.class.php:44
db
$SecUser db
Definition: export_security_pdf.php:118
User\$active
$active
1 active , 0 disables
Definition: user.class.php:43
User\$password
$password
password
Definition: user.class.php:45
$_POST
$_POST['ac']
Definition: do.php:365
User\get_available_folder
get_available_folder($p_filter="")
Get all the available folders for the users, checked with the security.
Definition: user.class.php:1306
User\connect_user
connect_user()
connect the user and set the $_SESSION variables if not set thanks the $_REQUEST
Definition: user.class.php:67
User\load_global_pref
load_global_pref()
Get the global preferences from user_global_pref in the account_repository db.
Definition: user.class.php:880
$p_type
$p_type
Definition: export_balance_age_csv.php:45
$start
$start
Definition: ajax_display_letter.php:104
User\get_status_security_ledger
get_status_security_ledger()
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled,...
Definition: user.class.php:1702
create_script
create_script($p_string)
create the HTML for adding the script tags around of the script
Definition: function_javascript.php:38
DatabaseCore\fetch_array
static fetch_array($ret, $p_indice=0)
wrapper for the function pg_fetch_array
Definition: database_core.class.php:745
User\set_default_periode
set_default_periode()
Definition: user.class.php:669
User\$email
$email
user's email
Definition: user.class.php:46
$sql
$sql
Definition: ajax_add_concerned_card.php:100
$priv
$priv
Definition: user_login.php:115
User\get_ledger_access
get_ledger_access($p_ledger)
check that a user is valid and the access to the folder
Definition: user.class.php:519
$desc
$desc[]
Definition: database.item.php:2
$type
$type
Definition: balance_age.inc.php:28
User\check_print
check_print($p_action)
Check if the user can print (in menu_ref p_type_display=p) otherwise warn and exit.
Definition: user.class.php:1043
User\is_local_admin
is_local_admin($p_dossier=-1)
Check if an user is an local administrator.
Definition: user.class.php:1095
$target
$target
Definition: ajax_anc_key_compute.php:41
$result
$result
Definition: anc_great_ledger.inc.php:26
$periode
$periode
Definition: ajax_display_letter.php:48
sql_string
sql_string($p_string)
Fix the problem with the quote char for the database.
Definition: ac_common.php:504
$array
$array
Definition: ajax_add_concerned_card.php:115
id
$input_from id
Definition: balance.inc.php:63
DatabaseCore\fetch_result
static fetch_result($ret, $p_row=0, $p_col=0)
wrapper for the function pg_fetch_all
Definition: database_core.class.php:767
name
$from_poste name
Definition: balance.inc.php:159
User\Admin
Admin()
synomym for isAdmin,
Definition: user.class.php:634
$p_jrn
$p_jrn
Definition: history_operation.inc.php:62
$value
$value
Definition: export_document.php:41
$profile
$profile
Definition: ajax_display_submenu.php:51
$i
$i
Definition: action_document_type_mtable_input.php:83
User\$valid
$valid
is or is not valid
Definition: user.class.php:40
$filter
$filter
Definition: balance.inc.php:105
User\get_exercice
get_exercice()
Definition: user.class.php:993
User\check_action
check_action($p_action_id)
Check if an user is allowed to do an action.
Definition: user.class.php:842
DatabaseCore\num_row
static num_row($ret)
wrapper for the function pg_NumRows
Definition: database_core.class.php:734
$Max
$Max
Definition: export_security_pdf.php:158
$p_action
if(! isset($_GET['submit_query'])) $p_action
Definition: category_followup.inc.php:41
$sql_array
$sql_array['query']
Definition: ajax_add_concerned_card.php:92
$from
$from
Definition: balance.inc.php:61
$http
$http
Definition: action.common.inc.php:33
User\get_status_security_action
get_status_security_action()
Check the security on ledger for the user , it returns 1 if the security on ledgers is enabled,...
Definition: user.class.php:1738
$end
$end
Definition: ajax_display_letter.php:120
User\$access_mode
$access_mode
MOBILE or PC depending if when connecting $login contains @mobile.
Definition: user.class.php:47
User\insert_default_global_pref
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...
Definition: user.class.php:932
$action
$action
Definition: admin_repo.inc.php:32
User\audit
audit($action='AUDIT', $p_module="")
Definition: user.class.php:1363
$r
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
Definition: ajax_add_concerned_card.php:53
$idx
$idx
Definition: ajax_bookmark.php:79
$line
$line
Definition: ajax_display_letter.php:88
User\$admin
$admin
is or is not admin
Definition: user.class.php:39
$_REQUEST
$_REQUEST['ac']
Definition: ajax_search_action.php:26
User\$db
$db
database connx
Definition: user.class.php:38
$audit
global $audit
Definition: constant.security.php:33
User\get_preference
get_preference()
Get the default user's preferences.
Definition: user.class.php:781
exit
for($e=0; $e< count($afiche); $e++) exit
Definition: export_fiche_balance_csv.php:109
echo_error
echo_error($p_log, $p_line="", $p_message="")
log error into the /tmp/noalyss_error.log it doesn't work on windows
Definition: ac_common.php:169
User\get_ledger
get_ledger($p_type='ALL', $p_access=3, $disable=TRUE)
get all the available ledgers for the current user
Definition: user.class.php:550
$cn
$cn
Definition: ajax_anc_accounting.php:30
$Res
$Res
Definition: export_security_pdf.php:117
$count
$count
Definition: modele.inc.php:251
User\isAdmin
isAdmin()
Check if an user is an admin.
Definition: user.class.php:644
Database
contains the class for connecting to Noalyss
Definition: database.class.php:32
User\$name
$name
Definition: user.class.php:42
alert
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:731
$user_password
$user_password
Definition: recover.php:93
User\load
load()
Definition: user.class.php:328
$repo
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
Definition: ajax_preference.php:47
User\$id
$id
in account_repository , ac_users.use_id
Definition: user.class.php:36
$dossier
$dossier
Definition: cfgfiche.inc.php:157
User\save_global_preference
save_global_preference($key, $value)
Save the preference , the scope is global, the settings are saved into account_repository.
Definition: user.class.php:757
$nb
$nb
Definition: ajax_auto_anc_card.php:32
User\get_profile
get_profile()
return the profile (p_id)
Definition: user.class.php:1405
td
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
redirect
redirect($p_string, $p_time=0)
Definition: user_common.php:181
$p_filter
$p_filter
Definition: export_balance_csv.php:38
$row
$row
Definition: ajax_anc_detail_operation.php:33
index
z index
Definition: action_search.php:31
User\get_periode
get_periode()
Get the default periode from the user's preferences.
Definition: user.class.php:707
$current_exercice
$current_exercice
Definition: export_fiche_detail_pdf.php:90
$p_array
$p_array
Definition: ajax_view_mod_stock.php:33
$p_id
$p_id
Definition: ajax_accounting.php:33
$res
$res
Definition: ajax_preference.php:49
if
if(! defined('ALLOWED')) if(! defined( 'ALLOWED_ADMIN'))
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
Definition: admin_repo.inc.php:25
User\$first_name
$first_name
Definition: user.class.php:41
record_log
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1400