Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions web/ajax/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function createRequest() {

function queryRequest() {
// Offset specifies the starting row to return, used for pagination
$newSessionValue = [];
$offset = 0;
if (isset($_REQUEST['offset'])) {
if ((!is_int($_REQUEST['offset']) and !ctype_digit($_REQUEST['offset']))) {
Expand Down Expand Up @@ -162,9 +163,7 @@ function queryRequest() {
$where .= 'Component = ?';
$query['values'][] = $_REQUEST['Component'];
}
zm_session_start();
$_SESSION['zmLogComponent'] = !empty($_REQUEST['Component']) ? $_REQUEST['Component'] : '';
session_write_close();
$newSessionValue['zmLogComponent'] = !empty($_REQUEST['Component']) ? $_REQUEST['Component'] : '';

if (!empty($_REQUEST['ServerId'])) {
if ($where) $where .= ' AND ';
Expand All @@ -185,6 +184,8 @@ function queryRequest() {
$where .= ' Level = ?';
$query['values'][] = $level_codes[$L];
}
$newSessionValue['zmLogFilterLevel'] = isset($level_codes[$L]) ? $L : '';

if (!empty($_REQUEST['StartDateTime'])) {
$start_time = strtotime($_REQUEST['StartDateTime']);
if ($start_time) {
Expand All @@ -205,6 +206,13 @@ function queryRequest() {
ZM\Warning("Unable to parse EndDateTime ".$_REQUEST['EndDateTime']. " into a timestamp");
}
}

zm_session_start();
foreach ($newSessionValue as $name => $value) {
$_SESSION[$name] = $value;
}
session_write_close();

if ($where) $where = ' WHERE '.$where;

$data['totalNotFiltered'] = dbFetchOne('SELECT count(*) AS Total FROM `' .$table.'`', 'Total');
Expand Down
2 changes: 1 addition & 1 deletion web/skins/classic/views/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
}
echo '<span class="term-value-wrapper">';
echo htmlSelect('filterLevel', $levels,
(isset($_SESSION['ZM_LOG_FILTER_LEVEL']) ? $_SESSION['ZM_LOG_FILTER_LEVEL'] : ''),
(isset($_SESSION['zmLogFilterLevel']) ? $_SESSION['zmLogFilterLevel'] : ''),
array('data-on-change'=>'filterLog', 'id'=>'filterLevel', 'class'=>'chosen'));
#array('class'=>'form-control chosen', 'data-on-change'=>'filterLog'));
echo '</span>';
Expand Down
Loading