Merge pull request #3191 from geordish/issue-3183

The SQL query that was being generated was messed up. I've attempted …
This commit is contained in:
Neil Lathwood
2016-03-09 21:36:00 +00:00
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -90,6 +90,7 @@ LibreNMS contributors:
- Georges Dick <georges.dick@gmail.com> (GeorgesDick)
- Richard Lawley <richard@richardlawley.com> (richardlawley)
- Marco Di Cerbo <marco@dottoremoe.com> (marcodc)
- David Bell <me@geordish.org> (geordish)
[1]: http://observium.org/ "Observium web site"
Observium was written by:
+3 -2
View File
@@ -1,6 +1,7 @@
<?php
$where = '1';
$param = array();
if (!empty($_POST['searchPhrase'])) {
$where .= ' AND S.msg LIKE "%'.mres($_POST['searchPhrase']).'%"';
@@ -31,8 +32,8 @@ if ($_SESSION['userlevel'] >= '5') {
$sql .= ' WHERE '.$where;
}
else {
$sql = 'FROM syslog AS S, devices_perms AS P';
$sql .= 'WHERE S.device_id = P.device_id AND P.user_id = ?';
$sql = 'FROM syslog AS S, devices_perms AS P ';
$sql .= 'WHERE S.device_id = P.device_id AND P.user_id = ? AND ';
$sql .= $where;
$param = array_merge(array($_SESSION['user_id']), $param);
}