*
*/
/**
* Class users: Contains all the functions and forms to manage users
*
* @author Claire Figueras
";
if(trim($groupusers) <> "")
{
$this->query("select DISTINCT USER_ID from ".$_SESSION['tablename']['usergroup_content']." where GROUP_ID in (".trim($groupusers).")");
$userlist = "";
while($line2 = $this->fetch_object() )
{
$userlist .= "'".trim($line2->USER_ID)."' , ";
}
$userlist = ereg_replace(" , $", "", $userlist);
//echo $userlist."
";
$is_userlist = true;
}
}
$temp= "";
$this->query("select * from ".$_SESSION['tablename']['baskets']." where BASKET_ID ='".$baskets[$tmp[$k]]."'");
$line2 = $this->fetch_object();
$_SESSION['user']['baskets'][$k]['basket_id'] = $baskets[$tmp[$k]];
$_SESSION['user']['baskets'][$k ]['table'] = $line2->RES_TABLE;
$_SESSION['user']['baskets'][$k ]['desc'] = $line2->BASKET_DESC;
$_SESSION['user']['baskets'][$k ]['name'] = $line2->BASKET_NAME;
$temp = $line2->BASKET_CLAUSE;
if($is_userlist == true)
{
$temp = str_replace("@groupuser", $userlist , $temp);
//echo $temp."
";
}
$temp = str_replace("@user", $usertmp , $temp);
$_SESSION['user']['baskets'][$k ]['clause']= "( ".$temp." )";
//echo $_SESSION['user']['baskets'][$k ]['clause'].'
';
//echo $_SESSION['user']['baskets'][$k ]['name'].'
';
for($j=0; $j < count($_SESSION['user']['security']); $j++)
{
if( $_SESSION['user']['baskets'][$k ]['table'] == $_SESSION['user']['security'][$j]['table'] )
{
if($_SESSION['user']['security'][$j]['can_insert'] == 'Y' && $rights_basket[$tmp[$k]]['DUPLICATION'] == 'Y')
{
$_SESSION['user']['baskets'][$k]['can_insert'] = true;
}
else
{
$_SESSION['user']['baskets'][$k]['can_insert'] = false;
}
if($_SESSION['user']['security'][$j]['can_insert'] == 'Y' )
{
$_SESSION['user']['baskets'][$k]['can_modify'] = true;
}
else
{
$_SESSION['user']['baskets'][$k]['can_modify'] = false;
}
if($_SESSION['user']['security'][$j]['can_update'] == 'Y' && $rights_basket[$tmp[$k]]['DELETE'] == 'Y')
{
$_SESSION['user']['baskets'][$k]['can_delete'] = true;
}
else
{
$_SESSION['user']['baskets'][$k]['can_delete'] = false;
}
//echo $_SESSION['user']['baskets'][$k]['clause'].'
';
$_SESSION['user']['baskets'][$k]['can_redirect'] = $rights_basket[$tmp[$k]]['REDIRECT'];
break;
}
}
}
}
/**
* Loads a virtual basket to process mail when an user is missing.
*
*/
private function load_basket_abs()
{
$usertmp = "'".$_SESSION['user']['UserId']."'";
$this->query("select mu.USER_ABS, mu.NEW_USER, u.LASTNAME, u.FIRSTNAME from ".$_SESSION['tablename']['missing_user']." mu, ".$_SESSION['tablename']['users']." u where mu.NEW_USER =".$usertmp." and u.USER_ID = mu.USER_ABS");
//$this->show();
while ($line = $this->fetch_object())
{
$tmp = array();
$tmp['basket_id'] = "ABS_".$line->USER_ABS;
$tmp['table'] = "res_x";
$tmp['page'] = "mail_process";
$tmp['desc'] = _PROCESS_MAIL_OF." ".$line->FIRSTNAME.' '.$line->LASTNAME;
$tmp['name'] = _PROCESS_MAIL_OF." ".$line->FIRSTNAME.' '.$line->LASTNAME;
$tmp['clause']= "( ( STATUS='NEW' or STATUS='COU' ) AND DEST_USER ='".$line->USER_ABS."' )";
$tmp['can_insert']=1;
$tmp['can_modify']=1;
$tmp['can_delete'] = 1;
$tmp['can_redirect'] = "Y";
array_push ($_SESSION['user']['baskets'], $tmp);
}
}
/**
* Loads status from users and create var when he's missing.
*
*/
private function load_activity_user()
{
$the_user = $_SESSION['user']['UserId'];
$this->query("SELECT count(*) as TOTAL from ".$_SESSION['tablename']['missing_user']." where USER_ABS='".$the_user."'");
//$this->show();
$line = $this-> fetch_object();
if ($line-> TOTAL == 1)
{
$_SESSION['abs_user_status'] = "true";
}
else
{
$_SESSION['abs_user_status'] = "";
}
}
/**
* Loads the dpartment datas into session variables
*
*/
private function load_services()
{
$this->connect();
$_SESSION['user']['services'] = array();
$tab_services = array();
for($i=0; $i < count($_SESSION['user']['groups']); $i++)
{
if($_SESSION['user']['groups'][$i]['CONSULT_GROUP'] == 'Y')
{
$this->query("select WHERE_CLAUSE from ".$_SESSION['tablename']['security']." where GROUP_ID = '".$_SESSION['user']['groups'][$i]['GROUP_ID']."' and RES_TABLE = '".$_SESSION['ressources'][0]['tablename']."' and WHERE_CLAUSE like '%DESTINATION IN%' ");
//$this->show();
$line = $this->fetch_object();
$tmp = trim($line->WHERE_CLAUSE);
$tmp = str_replace("DESTINATION IN (", "", $tmp);
$tmp = str_replace(")", "", $tmp);
$tmp = str_replace("'", "", $tmp);
if(ereg(",",$tmp))
{
$tab = array();
$tab = explode(",", $tmp);
for($j=0; $j< count($tab); $j++)
{
if(!in_array(trim($tab[$j]), $tab_services))
{
array_push($tab_services, trim($tab[$j]));
}
}
}
else
{
if(!in_array(trim($tmp), $tab_services) && !empty($tmp))
{
array_push($tab_services, trim($tmp));
}
}
}
}
for($i=0; $i < count($tab_services); $i++)
{
$this->query("select * from ".$_SESSION['tablename']['services']." where ID = '".$tab_services[$i]."'");
//$this->show();
if($this->nb_result() > 0)
{
$line = $this->fetch_object();
array_push($_SESSION['user']['services'], array( 'ID' => $tab_services[$i], 'LABEL' => $line->SERVICE));
}
}
}
/**
* To log a user
*
* @param string $s_login user login
* @param string $pass user password
*/
public function login($s_login,$pass)
{
// To log a user
$this->connect();
$this->query("select * from ".$_SESSION['tablename']['users']." where User_Id = '".$s_login."' and password = '".$pass."' and STATUS <> 'DEL'");
if($this->nb_result() > 0)
{
$line = $this->fetch_object();
if($line->ENABLED == "Y")
{
$_SESSION['user']['change_pass'] = $line->CHANGE_PASSWORD;
$_SESSION['user']['UserId'] = $line->USER_ID;
$_SESSION['user']['FirstName'] = $line->FIRSTNAME;
$_SESSION['user']['LastName'] = $line->LASTNAME;
$_SESSION['user']['Phone'] = $line->PHONE;
$_SESSION['user']['Mail'] = $line->MAIL;
$_SESSION['user']['department'] = $line->DEPARTMENT;
$_SESSION['user']['Fonction'] = $line->FONCTION;
$_SESSION['error'] = "";
setcookie("maarch", "UserId=".$_SESSION['user']['UserId']."&key=".$line->COOKIE_KEY,time()-3600000);
$key = md5(time()."%".$_SESSION['user']['FirstName']."%".$_SESSION['user']['UserId']."%".$_SESSION['user']['UserId']."%".date("dmYHmi")."%");
$this->query("update ".$_SESSION['tablename']['users']." set cookie_key = '".$key."', cookie_date = '".date("Y-m-d")." ".date("H:m:i")."' where User_Id = '".$_SESSION['user']['UserId']."' and Mail = '".$_SESSION['user']['Mail']."'");
setcookie("maarch", "UserId=".$_SESSION['user']['UserId']."&key=".$key,time()+3600000);
$this->query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$_SESSION['user']['department']."'");
$res = $this->fetch_object();
$_SESSION['user']['department_label'] = $res->SERVICE;
$this->load_groups();
$this->query("SELECT u.ADMINISTRATOR FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.ADMINISTRATOR ='Y' ");
$_SESSION['user']['admin'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['admin'] = true;
}
$this->query("SELECT u.EXPORT FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.EXPORT ='Y' ");
$_SESSION['user']['export'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['export'] = true;
}
$this->query("SELECT u.VIEW_RELANCE FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.VIEW_RELANCE='Y' ");
$_SESSION['user']['view_relance'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['view_relance'] = true;
}
$this->query("SELECT u.VIEW_STATS FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.VIEW_STATS='Y' ");
$_SESSION['user']['view_stats'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['view_stats'] = true;
}
$this->query("SELECT u.MODIF_RIGHTS FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.MODIF_RIGHTS='Y' ");
$_SESSION['user']['modif_rights'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['modif_rights'] = true;
}
$this->load_security();
$this->load_activity_user();
$this->load_basket();
$this->load_basket_abs();
$this->load_services();
$this->load_emet();
/****************************/
/* $ip = $_SERVER['REMOTE_ADDR'];
$navigateur = addslashes($_SERVER['HTTP_USER_AGENT']);
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$this->query("INSERT into connexion_history (IP, BROWSER, HOST, DATE) VALUES ('".$ip."', '".$navigateur."', '".$host."', now())");*/
/***************************/
if($_SESSION['user']['change_pass'] == 'Y')
{
header("location: change_pass.php");
exit;
}
if($_SESSION['req_type'] == "scan")
{
header("location: index_scansnap.php");
exit;
}
elseif($_SESSION['req_type'] == "files")
{
header("location: file_index.php");
exit;
}
else
{
header("location: index.php?page=".$_SESSION["config"]["defaultPage"].".php");
exit;
}
}
else
{
$_SESSION['error'] = _SUSPENDED_ACCOUNT.'. '._MORE_INFOS." ".$_SESSION['config']['adminname']."";
header("location: login.php");
exit;
}
}
else
{
$_SESSION['error'] = _BAD_LOGIN_OR_PSW."...";
header("location: login.php");
exit;
}
}
/**
* To log a user
*
* @param string $s_login user login
* @param string $pass user password
*/
public function login_gdi($s_login,$pass, $gdi_id)
{
// To log a user
$this->connect();
$this->query("select * from ".$_SESSION['tablename']['users']." where User_Id = '".$s_login."' and password = '".$pass."' and STATUS <> 'DEL'");
//echo "test"; exit();
if($this->nb_result() > 0)
{
$line = $this->fetch_object();
if($line->ENABLED == "Y")
{
$_SESSION['user']['change_pass'] = $line->CHANGE_PASSWORD;
$_SESSION['user']['UserId'] = $line->USER_ID;
$_SESSION['user']['FirstName'] = $line->FIRSTNAME;
$_SESSION['user']['LastName'] = $line->LASTNAME;
$_SESSION['user']['Phone'] = $line->PHONE;
$_SESSION['user']['Mail'] = $line->MAIL;
$_SESSION['user']['department'] = $line->DEPARTMENT;
$_SESSION['user']['Fonction'] = $line->FONCTION;
$_SESSION['error'] = "";
setcookie("maarch", "UserId=".$_SESSION['user']['UserId']."&key=".$line->COOKIE_KEY,time()-3600000);
$key = md5(time()."%".$_SESSION['user']['FirstName']."%".$_SESSION['user']['UserId']."%".$_SESSION['user']['UserId']."%".date("dmYHmi")."%");
$this->query("update ".$_SESSION['tablename']['users']." set cookie_key = '".$key."', cookie_date = '".date("Y-m-d")." ".date("H:m:i")."' where User_Id = '".$_SESSION['user']['UserId']."' and Mail = '".$_SESSION['user']['Mail']."'");
setcookie("maarch", "UserId=".$_SESSION['user']['UserId']."&key=".$key,time()+3600000);
$this->query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$_SESSION['user']['department']."'");
$res = $this->fetch_object();
$_SESSION['user']['department_label'] = $res->SERVICE;
$this->load_groups();
$this->query("SELECT u.ADMINISTRATOR FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.ADMINISTRATOR ='Y' ");
$_SESSION['user']['admin'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['admin'] = true;
}
$this->query("SELECT u.EXPORT FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.EXPORT ='Y' ");
$_SESSION['user']['export'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['export'] = true;
}
$this->query("SELECT u.VIEW_RELANCE FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.VIEW_RELANCE='Y' ");
$_SESSION['user']['view_relance'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['view_relance'] = true;
}
$this->query("SELECT u.VIEW_STATS FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.VIEW_STATS='Y' ");
$_SESSION['user']['view_stats'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['view_stats'] = true;
}
$this->query("SELECT u.MODIF_RIGHTS FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.MODIF_RIGHTS='Y' ");
$_SESSION['user']['modif_rights'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['modif_rights'] = true;
}
$this->load_security();
$this->load_activity_user();
$this->load_basket();
$this->load_basket_abs();
$this->load_services();
$this->load_emet();
/****************************/
/* $ip = $_SERVER['REMOTE_ADDR'];
$navigateur = addslashes($_SERVER['HTTP_USER_AGENT']);
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$this->query("INSERT into connexion_history (IP, BROWSER, HOST, DATE) VALUES ('".$ip."', '".$navigateur."', '".$host."', now())");*/
/***************************/
$this->query("SELECT * FROM res_x WHERE GID_ID = '".$gdi_id."' ");
$res_gdi = $this->fetch_object();
header("location: view_gdi.php?id=".$res_gdi->RES_ID);
exit;
}
else
{
$_SESSION['error'] = _SUSPENDED_ACCOUNT.'. '._MORE_INFOS." ".$_SESSION['config']['adminname']."";
header("location: login.php");
exit;
}
}
else
{
$_SESSION['error'] = _BAD_LOGIN_OR_PSW."...";
header("location: login.php");
exit;
}
}
/**
* Load the shipper in session
*
*/
public function load_emet()
{
$db = new dbquery();
$db->connect();
$db->query("SELECT * FROM ".$_SESSION['tablename']['senders']." order by LASTNAME");
$_SESSION['emetteur'] = array();
while ($emet_res = $db->fetch_object())
{
array_push($_SESSION['emetteur'], array('NOM' => $emet_res->LASTNAME, 'PRENOM' =>$emet_res->FIRSTNAME, 'SOCIETE' => $emet_res->SOCIETY) );
}
}
/**
* To reopen a session with the user's cookie
*
* @param string $s_UserId user identifier
* @param string $s_key cookie key
*/
public function reopen($s_UserId,$s_key)
{
// to reopen a session with the user's cookie
$this->connect();
$this->query("select * from ".$_SESSION['tablename']['users']." where User_Id = '".$s_UserId."' and cookie_key = '".$s_key."' and STATUS <> 'DEL'");
if($this->nb_result() > 0)
{
$line = $this->fetch_object();
if($line->ENABLED == "Y")
{
$_SESSION['user']['UserId'] = $line->USER_ID;
$_SESSION['user']['FirstName'] = $line->FIRSTNAME;
$_SESSION['user']['LastName'] = $line->LASTNAME;
$_SESSION['user']['Phone'] = $line->PHONE;
$_SESSION['user']['Mail'] = $line->MAIL;
$_SESSION['user']['department'] = $line->DEPARTMENT;
$_SESSION['user']['Fonction'] = $line->FONCTION;
$_SESSION['error'] = "";
setcookie("maarch", "UserId=".$_SESSION['user']['UserId']."&key=".$line->COOKIE_KEY,time()-3600000);
$key = md5(time()."%".$_SESSION['user']['FirstName']."%".$_SESSION['user']['UserId']."%".$_SESSION['user']['UserId']."%".date("dmYHmi")."%");
$this->query("update ".$_SESSION['tablename']['users']." set cookie_key = '".$key."', cookie_date = '".date("Y-m-d")." ".date("H:m:i")."' where User_Id = '".$_SESSION['user']['UserId']."' and Mail = '".$_SESSION['user']['Mail']."'");
setcookie("maarch", "UserId=".$_SESSION['user']['UserId']."&key=".$key,time()+3600000);
$this->query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$_SESSION['user']['department']."'");
$res = $this->fetch_object();
$_SESSION['user']['department_label'] = $res->SERVICE;
$this->load_groups();
$this->query("SELECT u.ADMINISTRATOR FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.ADMINISTRATOR ='Y' ");
$_SESSION['user']['admin'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['admin'] = true;
}
$this->query("SELECT u.VIEW_RELANCE FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.VIEW_RELANCE='Y' ");
$_SESSION['user']['view_relance'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['view_relance'] = true;
}
$this->query("SELECT u.VIEW_STATS FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.VIEW_STATS='Y' ");
$_SESSION['user']['view_stats'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['view_stats'] = true;
}
$this->query("SELECT u.EXPORT FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.EXPORT ='Y' ");
$_SESSION['user']['export'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['export'] = true;
}
$this->query("SELECT u.MODIF_RIGHTS FROM ".$_SESSION['tablename']['usergroup_content']." ugc, ".$_SESSION['tablename']['usergroups']." u where ugc.user_id = '".$_SESSION['user']['UserId']."' and ugc.group_id = u.group_id and u.enabled ='Y' and u.MODIF_RIGHTS='Y' ");
$_SESSION['user']['modif_rights'] = false;
if($this->nb_result() > 0)
{
$_SESSION['user']['modif_rights'] = true;
}
$this->load_security();
$this->load_activity_user();
$this->load_basket();
$this->load_basket_abs();
$this->load_services();
$this->load_emet();
/****************************/
/*
$ip = $_SERVER['REMOTE_ADDR'];
$navigateur = addslashes($_SERVER['HTTP_USER_AGENT']);
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$this->query("INSERT into connexion_history (IP, BROWSER, HOST, DATE) VALUES ('".$ip."', '".$navigateur."', '".$host."', now())");*/
/***************************/
if($_SESSION['user']['change_pass'] == 'Y')
{
header("location: change_pass.php");
exit;
}
if($_SESSION['req_type'] == "scan")
{
header("location: index_scansnap.php");
exit;
}
elseif($_SESSION['req_type'] == "files")
{
header("location: file_index.php");
exit;
}
else
{
header("location: index.php?page=".$_SESSION["config"]["defaultPage"].".php");
exit;
}
}
else
{
$_SESSION['error'] = _SUSPENDED_ACCOUNT.'. '._MORE_INFOS." ".$_SESSION['config']['adminname']."";
header("location: login.php");
exit;
}
}
else
{
header("location: login.php");
exit;
}
}
/**
* Build Maarch configuration into sessions vars with an xml configuration file
*/
public function build_config()
{
// build Maarch configuration into sessions vars
$xmlconfig = simplexml_load_file('xml/config.xml');
$initLB= new LetterBox();
$initLB->xmltosessionletterbox();
foreach($xmlconfig->CONFIG as $CONFIG)
{
$_SESSION['config']['databaseserver'] = utf8_decode((string) $CONFIG->databaseserver);
$_SESSION['config']['databasename'] = utf8_decode((string) $CONFIG->databasename);
$_SESSION['config']['databaseuser'] = utf8_decode((string) $CONFIG->databaseuser);
$_SESSION['config']['databasepassword'] = utf8_decode((string) $CONFIG->databasepassword);
$_SESSION['config']['ftpserver'] = utf8_decode((string) $CONFIG->ftpserver);
$_SESSION['config']['ftpport'] = utf8_decode((string) $CONFIG->ftpport);
$_SESSION['config']['ftpuser'] = utf8_decode((string) $CONFIG->ftpuser);
$_SESSION['config']['ftppassword'] = utf8_decode((string) $CONFIG->ftppassword);
$_SESSION['config']['ftphomedir'] = utf8_decode((string) $CONFIG->ftphomedir);
$_SESSION['config']['nblinetoshow'] = utf8_decode((string) $CONFIG->nblinetoshow);
$_SESSION['config']['limitcharsearch'] = utf8_decode((string) $CONFIG->limitcharsearch);
$_SESSION['config']['lang'] = utf8_decode((string) $CONFIG->lang);
$_SESSION['config']['adminmail'] = utf8_decode((string) $CONFIG->adminmail);
$_SESSION['config']['adminname'] = utf8_decode((string) $CONFIG->adminname);
$_SESSION['config']['enabledadvsearch'] = utf8_decode((string) $CONFIG->enabledadvsearch);
$_SESSION['config']['enabledquicksearch'] = utf8_decode((string) $CONFIG->enabledquicksearch);
$_SESSION['config']['enabledindexfile'] = utf8_decode((string) $CONFIG->enabledindexfile);
$_SESSION['config']['enabledvideo'] = utf8_decode((string) $CONFIG->enabledvideo);
$_SESSION['config']['enableddir'] = utf8_decode((string) $CONFIG->enableddir);
$_SESSION['config']['enabledvalidation'] = utf8_decode((string) $CONFIG->enabledvalidation);
$_SESSION['config']['enabledprocess'] = utf8_decode((string) $CONFIG->enabledprocess);
$_SESSION['config']['enablestats'] = utf8_decode((string) $CONFIG->enablestats);
$_SESSION['config']['enablechangenotif'] = utf8_decode((string) $CONFIG->enablechangenotif);
$_SESSION['config']['shortcut'] = utf8_decode((string) $CONFIG->shortcut);
$_SESSION['config']['xmlpath'] = utf8_decode((string) $CONFIG->xmlpath);
$_SESSION['config']['debug'] = utf8_decode((string) $CONFIG->debug);
$_SESSION['config']['applicationname'] = utf8_decode((string) $CONFIG->applicationname);
$_SESSION['config']['css'] = utf8_decode((string) $CONFIG->css);
$_SESSION['config']['css_IE'] = utf8_decode((string) $CONFIG->css_ie);
$_SESSION['config']['css_IE7'] = utf8_decode((string) $CONFIG->css_ie7);
$_SESSION['config']['img'] = utf8_decode((string) $CONFIG->img);
$_SESSION['config']['system'] = utf8_decode((string) $CONFIG->UNIXserver);
$_SESSION['config']['MaarchURL'] = utf8_decode((string) $CONFIG->MaarchURL);
$_SESSION['config']['url'] = utf8_decode((string) $CONFIG->URL);
$_SESSION['config']['defaultPage'] = utf8_decode((string) $CONFIG->defaultPage);
$_SESSION['config']['exportlist'] = utf8_decode((string) $CONFIG->exportlist);
$_SESSION['config']['corporate'] = utf8_decode((string) $CONFIG->corporate);
$_SESSION['config']['cookietime'] = utf8_decode((string) $CONFIG->CookieTime);
}
foreach($xmlconfig->TABLENAME as $TABLENAME)
{
$_SESSION['tablename']['arboxes'] = utf8_decode((string) $TABLENAME->arboxes);
$_SESSION['tablename']['arcontainers'] = utf8_decode((string) $TABLENAME->arcontainers);
$_SESSION['tablename']['authors'] = utf8_decode((string) $TABLENAME->authors);
$_SESSION['tablename']['baskets'] = utf8_decode((string) $TABLENAME->baskets);
$_SESSION['tablename']['docservers'] = utf8_decode((string) $TABLENAME->docservers);
$_SESSION['tablename']['doctypes'] = utf8_decode((string) $TABLENAME->doctypes);
$_SESSION['tablename']['ext_docserver'] = utf8_decode((string) $TABLENAME->extdocserver);
$_SESSION['tablename']['fulltext'] = utf8_decode((string) $TABLENAME->fulltext);
$_SESSION['tablename']['groupbasket'] = utf8_decode((string) $TABLENAME->groupbaskets);
$_SESSION['tablename']['groupsecurity'] = utf8_decode((string) $TABLENAME->groupsecurity);
$_SESSION['tablename']['history'] = utf8_decode((string) $TABLENAME->history);
$_SESSION['tablename']['listinstance'] = utf8_decode((string) $TABLENAME->listinstance);
$_SESSION['tablename']['listmodel'] = utf8_decode((string) $TABLENAME->listmodel);
$_SESSION['tablename']['models'] = utf8_decode((string) $TABLENAME->models);
$_SESSION['tablename']['model_service'] = utf8_decode((string) $TABLENAME->model_service);
$_SESSION['tablename']['param'] = utf8_decode((string) $TABLENAME->param);
$_SESSION['tablename']['resgroups'] = utf8_decode((string) $TABLENAME->resgroups);
$_SESSION['tablename']['resgroup_content'] = utf8_decode((string) $TABLENAME->resgroup_content);
$_SESSION['tablename']['security'] = utf8_decode((string) $TABLENAME->security);
$_SESSION['tablename']['usergroups'] = utf8_decode((string) $TABLENAME->usergroups);
$_SESSION['tablename']['usergroup_content'] = utf8_decode((string) $TABLENAME->usergroupcontent);
$_SESSION['tablename']['users'] = utf8_decode((string) $TABLENAME->users);
$_SESSION['tablename']['services'] = utf8_decode((string) $TABLENAME->services);
$_SESSION['tablename']['missing_user'] = utf8_decode((string) $TABLENAME->missing_user);
$_SESSION['tablename']['senders'] = utf8_decode((string) $TABLENAME->sender);
$_SESSION['tablename']['notes'] = utf8_decode((string) $TABLENAME->notes);
}
$i=0;
foreach($xmlconfig->RESOURCES as $RESOURCES)
{
$_SESSION['ressources'][$i] = array("tablename" => utf8_decode((string) $RESOURCES->tablename),
"comment" => utf8_decode((string) $RESOURCES->comment));
$i++;
}
$_SESSION['nb_columnsresults']=0;
$_SESSION['nb_columnsdetails']=0;
foreach($xmlconfig->COLUMNSRESULTS as $COLUMNSRESULTS)
{
$_SESSION['columnsresults'][$_SESSION['nb_columnsresults']] = array("name" => utf8_decode((string) $COLUMNSRESULTS->name),
"tablename" => utf8_decode((string) $COLUMNSRESULTS->tablename));
$_SESSION['nb_columnsresults']=($_SESSION['nb_columnsresults']+1);
}
foreach($xmlconfig->COLUMNSDETAILS as $COLUMNSDETAILS)
{
$_SESSION['columnsdetails'][$_SESSION['nb_columnsdetails']] = array("name" => utf8_decode((string) $COLUMNSDETAILS->name),
"tablename" => utf8_decode((string) $COLUMNSDETAILS->tablename));
$_SESSION['nb_columnsdetails']=($_SESSION['nb_columnsdetails']+1);
}
foreach($xmlconfig->HISTORY as $HISTORY)
{
$_SESSION['history']['usersdel'] = utf8_decode((string) $HISTORY->usersdel);
$_SESSION['history']['usersban'] = utf8_decode((string) $HISTORY->usersban);
$_SESSION['history']['usersadd'] = utf8_decode((string) $HISTORY->usersadd);
$_SESSION['history']['usersup'] = utf8_decode((string) $HISTORY->usersup);
$_SESSION['history']['usersval'] = utf8_decode((string) $HISTORY->usersval);
$_SESSION['history']['doctypesdel'] = utf8_decode((string) $HISTORY->doctypesdel);
$_SESSION['history']['doctypesadd'] = utf8_decode((string) $HISTORY->doctypesadd);
$_SESSION['history']['doctypesup'] = utf8_decode((string) $HISTORY->doctypesup);
$_SESSION['history']['doctypesval'] = utf8_decode((string) $HISTORY->doctypesval);
$_SESSION['history']['doctypesprop'] = utf8_decode((string) $HISTORY->doctypesprop);
$_SESSION['history']['resadd'] = utf8_decode((string) $HISTORY->resadd);
$_SESSION['history']['resup'] = utf8_decode((string) $HISTORY->resup);
$_SESSION['history']['resdel'] = utf8_decode((string) $HISTORY->resdel);
$_SESSION['history']['usergroupsdel'] = utf8_decode((string) $HISTORY->usergroupsdel);
$_SESSION['history']['usergroupsban'] = utf8_decode((string) $HISTORY->usergroupsban);
$_SESSION['history']['usergroupsadd'] = utf8_decode((string) $HISTORY->usergroupsadd);
$_SESSION['history']['usergroupsup'] = utf8_decode((string) $HISTORY->usergroupsup);
$_SESSION['history']['usergroupsval'] = utf8_decode((string) $HISTORY->usergroupsval);
$_SESSION['history']['diffusion'] = utf8_decode((string) $HISTORY->diffusion);
$_SESSION['history']['redirection'] = utf8_decode((string) $HISTORY->redirection);
$_SESSION['history']['userabs'] = utf8_decode((string) $HISTORY->userabs);
$_SESSION['history']['modelsadd'] = utf8_decode((string) $HISTORY->modelsadd);
$_SESSION['history']['modelsup'] = utf8_decode((string) $HISTORY->modelsup);
$_SESSION['history']['modelsdel'] = utf8_decode((string) $HISTORY->modelsdel);
$_SESSION['history']['notesadd'] = utf8_decode((string) $HISTORY->notesadd);
$_SESSION['history']['notesup'] = utf8_decode((string) $HISTORY->notesup);
$_SESSION['history']['notesdel'] = utf8_decode((string) $HISTORY->notesdel);
}
}
/**
* Build the alphabetic list of users letters
*/
public function userslistletters()
{
// build the alphabetic list of users letters
?>
connect();
$db_abs->query("select distinct USER_ABS from ".$_SESSION['tablename']['missing_user']);
//$db_abs->show();
$j=0;
while($line = $db_abs->fetch_object())
{
$user_abs[$j] = $line->USER_ABS;
$j++;
}
$this->connect();
$this->query("select count(*) as total from ".$table_name." where STATUS <> 'DEL'");
$nb_total_1 = $this->fetch_object();
$nb_total = $nb_total_1->total;
// define the defaults values
$nb_pages = ceil($nb_total/$nb_show);
$link = "index.php?page=".$page_name."&start=".$this->the_start."&order=".$this->orderby.$what;
if($nb_pages > 1)
{
$next_start = 0;
$page_list1 = '';
$page_list2 .= $previous." ".$next.'
echo _DEPARTMENT; ?> | |||||||
---|---|---|---|---|---|---|---|
USER_ID.""; $is_abs = false; for ($n=0; $n<=count($user_abs); $n++) { if ($line->USER_ID == $user_abs[$n]) { $is_abs = true; } } if ($is_abs==true) { echo "("._MISSING.")"; } ?> | show($line->LASTNAME); ?> | show($line->FIRSTNAME); ?> | ENABLED == "N") {
?>
![]() ![]() |
query("select SERVICE from ".$_SESSION['tablename']['services']. " where ID = '".$line->DEPARTMENT."'"); $res = $db->fetch_object(); echo $res->SERVICE; ?> | ENABLED == "Y") { echo ''._MODIFY.''; } ?> | ENABLED == "N" ) { echo ''._AUTHORIZE.''; } else { echo ''._SUSPEND.''; } ?> | echo ''._DELETE.''; ?> |
echo _MY_ABS_TXT; ?>
} else { $this->query("SELECT NEW_USER from ".$_SESSION['tablename']['missing_user']." WHERE USER_ABS='".$_SESSION['user']['UserId']."'"); $line2 = $this->fetch_object(); $this->query("SELECT FIRSTNAME, LASTNAME from ".$_SESSION['tablename']['users']." WHERE USER_ID ='".$line2->NEW_USER."'"); //$this->show(); $line3 = $this->fetch_object(); ?>show($_SESSION['m_admin']['users']['UserId']); } ?>hidden } elseif($mode == "add") { ?>text" id="UserId" value="show($_SESSION['m_admin']['users']['UserId']); ?>" />*
*
*
*
*
/>
/>
echo _ADMIN_ABS_TXT; ?>
} else { $this->query("SELECT NEW_USER from ".$_SESSION['tablename']['missing_user']." WHERE USER_ABS='".$_GET['id']."'"); $line2 = $this->fetch_object(); $this->query("SELECT FIRSTNAME, LASTNAME from ".$_SESSION['tablename']['users']." WHERE USER_ID ='".$line2->NEW_USER."'"); //$this->show(); $line3 = $this->fetch_object(); ?>echo _ADMIN_ABS_FIRST_PART." ".$_GET['id']; ?> echo _ADMIN_ABS_SECOND_PART; ?> echo $line3->FIRSTNAME." ".$line3->LASTNAME; ?> echo _ADMIN_ABS_THIRD_PART; ?>
} ?>