27if (! defined(
'CSRFCHECK_WITH_TOKEN')) {
28 define(
'CSRFCHECK_WITH_TOKEN',
'1');
32require
'../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
45$langs->loadLangs(array(
"companies",
"install",
"users",
"other"));
51$action =
GETPOST(
'action',
'aZ09');
52$confirm =
GETPOST(
'confirm',
'alpha');
55if ($user->socid > 0) {
57 $socid = $user->socid;
61$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
62$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
64if (empty($page) || $page == -1) {
67$offset = $limit * $page;
74 $sortfield =
"dateevent";
83if ($action ==
'confirm_purge' && $confirm ==
'yes' && $user->admin) {
88if ($action ==
'confirm_lock' && $confirm ==
'yes' && $user->admin) {
89 if (
dolibarr_set_const($db,
'MAIN_ONLY_LOGIN_ALLOWED', $user->login,
'text', 1,
'Logon is restricted to a particular user', 0) < 0) {
95if ($action ==
'confirm_unlock' && $user->admin) {
107llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-tools_listsessions');
109$form =
new Form($db);
111$userstatic =
new User($db);
115$num = count($listofsessions);
117print_barre_liste($langs->trans(
"Sessions"), $page, $_SERVER[
"PHP_SELF"],
"", $sortfield, $sortorder,
'', $num, ($num ? $num :
''),
'setup');
119$savehandler = ini_get(
"session.save_handler");
120$savepath = ini_get(
"session.save_path");
121$openbasedir = ini_get(
"open_basedir");
123$suhosin = empty($phparray[
'suhosin'][
"suhosin.session.encrypt"][
"local"]) ?
'' : $phparray[
'suhosin'][
"suhosin.session.encrypt"][
"local"];
125print
'<b>'.$langs->trans(
"SessionSaveHandler").
'</b>: '.$savehandler.
'<br>';
126print
'<b>'.$langs->trans(
"SessionSavePath").
'</b>: '.$savepath.
'<br>';
128 print
'<b>'.$langs->trans(
"OpenBaseDir").
'</b>: '.$openbasedir.
'<br>';
131 print
'<b>'.$langs->trans(
"SuhosinSessionEncrypt").
'</b>: '.$suhosin.
'<br>';
135if ($action ==
'purge') {
136 $formquestion = array();
137 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?noparam=noparam', $langs->trans(
'PurgeSessions'), $langs->trans(
'ConfirmPurgeSessions'),
'confirm_purge', $formquestion,
'no', 2);
138} elseif ($action ==
'lock') {
139 $formquestion = array();
140 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?noparam=noparam', $langs->trans(
'LockNewSessions'), $langs->trans(
'ConfirmLockNewSessions', $user->login),
'confirm_lock', $formquestion,
'no', 1);
143if ($savehandler ==
'files') {
144 print
'<table class="liste centpercent">';
145 print
'<tr class="liste_titre">';
146 print_liste_field_titre(
"Login", $_SERVER[
"PHP_SELF"],
"login",
"",
"",
'align="left"', $sortfield, $sortorder);
147 print_liste_field_titre(
"SessionId", $_SERVER[
"PHP_SELF"],
"id",
"",
"",
'align="left"', $sortfield, $sortorder);
148 print_liste_field_titre(
"DateCreation", $_SERVER[
"PHP_SELF"],
"datec",
"",
"",
'align="left"', $sortfield, $sortorder);
149 print_liste_field_titre(
"DateModification", $_SERVER[
"PHP_SELF"],
"datem",
"",
"",
'align="left"', $sortfield, $sortorder);
156 foreach ($listofsessions as $key => $sessionentry) {
157 print
'<tr class="oddeven">';
160 print
'<td>'.$sessionentry[
'login'].
'</td>';
163 print
'<td class="nowrap left">';
164 if (
"$key" == session_id()) {
165 print $form->textwithpicto($key, $langs->trans(
"YourSession"));
172 print
'<td class="nowrap left">'.dol_print_date($sessionentry[
'creation'],
'%Y-%m-%d %H:%M:%S').
'</td>';
175 print
'<td class="nowrap left">'.dol_print_date($sessionentry[
'modification'],
'%Y-%m-%d %H:%M:%S').
'</td>';
178 print
'<td>'.$sessionentry[
'age'].
'</td>';
181 print
'<td>'.dol_trunc($sessionentry[
'raw'], 40,
'middle').
'</td>';
183 print
'<td> </td>';
189 if (count($listofsessions) == 0) {
190 print
'<tr class="oddeven"><td colspan="7">'.$langs->trans(
"NoSessionFound", $savepath, $openbasedir).
'</td></tr>';
194 print $langs->trans(
"NoSessionListWithThisHandler");
201print
'<div class="tabsAction">';
205 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=lock&token='.
newToken().
'">'.$langs->trans(
"LockNewSessions").
'</a>';
207 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=confirm_unlock&token='.
newToken().
'">'.$langs->trans(
"UnlockNewSessions").
'</a>';
210if ($savehandler ==
'files') {
211 if (count($listofsessions)) {
212 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=purge&token='.
newToken().
'">'.$langs->trans(
"PurgeSessions").
'</a>';
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).
purgeSessions($mysessionid)
Purge existing sessions.
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
listOfSessions()
Return list of session.
phpinfo_array()
Return the php_info into an array.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage Dolibarr users.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.