25 require
'../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 $langs->loadLangs(array(
"companies",
"install",
"users",
"other"));
34 $action =
GETPOST(
'action',
'aZ09');
35 $confirm =
GETPOST(
'confirm',
'alpha');
41 $socid = $user->socid;
44 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
45 $sortfield =
GETPOST(
"sortfield",
'alpha');
46 $sortorder =
GETPOST(
"sortorder",
'alpha');
48 if (empty($page) || $page == -1) { $page = 0; }
49 $offset = $limit * $page;
50 $pageprev = $page - 1;
51 $pagenext = $page + 1;
52 if (!$sortorder) $sortorder =
"DESC";
53 if (!$sortfield) $sortfield =
"dateevent";
61 if ($action ==
'confirm_purge' && $confirm ==
'yes' && $user->admin)
67 if ($action ==
'confirm_lock' && $confirm ==
'yes' && $user->admin)
69 if (
dolibarr_set_const($db,
'MAIN_ONLY_LOGIN_ALLOWED', $user->login,
'text', 1,
'Logon is restricted to a particular user', 0) < 0)
76 if ($action ==
'confirm_unlock' && $user->admin)
92 $form =
new Form($db);
94 $userstatic =
new User($db);
98 $num = count($listofsessions);
100 print_barre_liste($langs->trans(
"Sessions"), $page,
$_SERVER[
"PHP_SELF"],
"", $sortfield, $sortorder,
'', $num, ($num ? $num :
''),
'setup');
102 $savehandler = ini_get(
"session.save_handler");
103 $savepath = ini_get(
"session.save_path");
104 $openbasedir = ini_get(
"open_basedir");
106 $suhosin = empty($phparray[
'suhosin'][
"suhosin.session.encrypt"][
"local"]) ?
'' : $phparray[
'suhosin'][
"suhosin.session.encrypt"][
"local"];
108 print '<b>'.$langs->trans(
"SessionSaveHandler").
'</b>: '.$savehandler.
'<br>';
109 print '<b>'.$langs->trans(
"SessionSavePath").
'</b>: '.$savepath.
'<br>';
110 if ($openbasedir)
print '<b>'.$langs->trans(
"OpenBaseDir").
'</b>: '.$openbasedir.
'<br>';
111 if ($suhosin)
print '<b>'.$langs->trans(
"SuhosinSessionEncrypt").
'</b>: '.$suhosin.
'<br>';
114 if ($action ==
'purge')
116 $formquestion = array();
117 print $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?noparam=noparam', $langs->trans(
'PurgeSessions'), $langs->trans(
'ConfirmPurgeSessions'),
'confirm_purge', $formquestion,
'no', 2);
118 } elseif ($action ==
'lock')
120 $formquestion = array();
121 print $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?noparam=noparam', $langs->trans(
'LockNewSessions'), $langs->trans(
'ConfirmLockNewSessions', $user->login),
'confirm_lock', $formquestion,
'no', 1);
124 if ($savehandler ==
'files')
126 print '<table class="liste centpercent">';
127 print '<tr class="liste_titre">';
137 foreach ($listofsessions as $key => $sessionentry)
139 print '<tr class="oddeven">';
142 print '<td>'.$sessionentry[
'login'].
'</td>';
145 print '<td class="nowrap left">';
146 if (
"$key" == session_id())
print $form->textwithpicto($key, $langs->trans(
"YourSession"));
151 print '<td class="nowrap left">'.dol_print_date($sessionentry[
'creation'],
'%Y-%m-%d %H:%M:%S').
'</td>';
154 print '<td class="nowrap left">'.dol_print_date($sessionentry[
'modification'],
'%Y-%m-%d %H:%M:%S').
'</td>';
157 print '<td>'.$sessionentry[
'age'].
'</td>';
160 print '<td>'.dol_trunc($sessionentry[
'raw'], 40,
'middle').
'</td>';
162 print '<td> </td>';
168 if (count($listofsessions) == 0)
170 print '<tr class="oddeven"><td colspan="7">'.$langs->trans(
"NoSessionFound", $savepath, $openbasedir).
'</td></tr>';
174 print $langs->trans(
"NoSessionListWithThisHandler");
181 print '<div class="tabsAction">';
184 if (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
186 print '<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=lock">'.$langs->trans(
"LockNewSessions").
'</a>';
188 print '<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=confirm_unlock">'.$langs->trans(
"UnlockNewSessions").
'</a>';
191 if ($savehandler ==
'files')
193 if (count($listofsessions))
195 print '<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=purge">'.$langs->trans(
"PurgeSessions").
'</a>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
listOfSessions()
Return list of session.
purgeSessions($mysessionid)
Purge existing sessions.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Class to manage Dolibarr users.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
phpinfo_array()
Return the php_info into an array.
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...