[svn r12568] minor - Fix a bug with the session status (was "past" for sessions without time limits)

skala
Julian Prud'homme 18 years ago
parent 9c6691dd13
commit 5421bda64a
  1. 15
      main/inc/lib/tracking.lib.php

@ -544,22 +544,27 @@ class Tracking {
} }
foreach ($a_sessions as & $session) { foreach ($a_sessions as & $session) {
if ($row['date_start'] == '0000-00-00') { if ($session['date_start'] == '0000-00-00') {
$session['status'] = get_lang('Active'); $session['status'] = get_lang('SessionActive');
} else { }
else {
$date_start = explode('-', $session['date_start']); $date_start = explode('-', $session['date_start']);
$time_start = mktime(0, 0, 0, $date_start[1], $date_start[2], $date_start[0]); $time_start = mktime(0, 0, 0, $date_start[1], $date_start[2], $date_start[0]);
$date_end = explode('-', $session['date_end']); $date_end = explode('-', $session['date_end']);
$time_end = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]); $time_end = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]);
if ($time_start < time() && time() < $time_end) { if ($time_start < time() && time() < $time_end) {
$session['status'] = get_lang('SessionActive'); $session['status'] = get_lang('SessionActive');
} else }
else{
if (time() < $time_start) { if (time() < $time_start) {
$session['status'] = get_lang('SessionFuture'); $session['status'] = get_lang('SessionFuture');
} else }
else{
if (time() > $time_end) { if (time() > $time_end) {
$session['status'] = get_lang('SessionPast'); $session['status'] = get_lang('SessionPast');
} }
}
}
} }
} }

Loading…
Cancel
Save