mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix pages/syslog search
git-svn-id: http://www.observium.org/svn/observer/trunk@2343 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -59,19 +59,29 @@ if ($_POST['program'])
|
||||
$array[] = $_POST['program'];
|
||||
}
|
||||
|
||||
if ($_POST['device'])
|
||||
if (is_numeric($_POST['device']))
|
||||
{
|
||||
$where .= " AND D.device_id = ?";
|
||||
$where .= " AND S.device_id = ?";
|
||||
$array[] = $_POST['device'];
|
||||
}
|
||||
|
||||
if ($_SESSION['userlevel'] >= '5')
|
||||
{
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog AS S
|
||||
WHERE 1 $where ORDER BY timestamp DESC LIMIT 1000";
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog AS S";
|
||||
if(count($array))
|
||||
{
|
||||
$sql .= " WHERE 1 ".$where;
|
||||
}
|
||||
$sql .= " ORDER BY timestamp DESC LIMIT 1000";
|
||||
} else {
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog AS S, devices_perms AS P
|
||||
WHERE S.device_id = P.device_id AND P.user_id = ? $where ORDER BY timestamp DESC LIMIT 1000";
|
||||
$sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog AS S, devices_perms AS P";
|
||||
$sql .= "WHERE S.device_id = P.device_id AND P.user_id = ?";
|
||||
if(count($array))
|
||||
{
|
||||
$sql .= " WHERE 1 ".$where;
|
||||
}
|
||||
$sql .= " ORDER BY timestamp DESC LIMIT 1000";
|
||||
|
||||
$array = array_merge(array($_SESSION['user_id']), $array);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user