Rev 325 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 325 | Rev 360 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; |
28 | $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; |
29 | OIDplus::dbIsolated()->query("insert into ###log (addr, unix_ts, event) values (?, ?, ?)", array($addr, time(), $event)); |
29 | OIDplus::dbIsolated()->query("insert into ###log (addr, unix_ts, event) values (?, ?, ?)", array($addr, time(), $event)); |
30 | $log_id = OIDplus::dbIsolated()->insert_id(); |
30 | $log_id = OIDplus::dbIsolated()->insert_id(); |
31 | if ($log_id === false) { |
31 | if ($log_id === false) { |
32 | $res = OIDplus::dbIsolated()->query("select max(id) as last_id from ###log"); |
32 | $res = OIDplus::dbIsolated()->query("select max(id) as last_id from ###log"); |
33 | if ($res->num_rows() == 0) throw new OIDplusException("Could not log event"); |
33 | if ($res->num_rows() == 0) throw new OIDplusException(_L('Could not log event')); |
34 | $row = $res->fetch_array(); |
34 | $row = $res->fetch_array(); |
35 | $log_id = $row['last_id']; |
35 | $log_id = $row['last_id']; |
36 | if ($log_id == 0) throw new OIDplusException("Could not log event"); |
36 | if ($log_id == 0) throw new OIDplusException(_L('Could not log event')); |
37 | } |
37 | } |
38 | 38 | ||
39 | $object_dupe_check = array(); |
39 | $object_dupe_check = array(); |
40 | foreach ($objects as list($severity, $object)) { |
40 | foreach ($objects as list($severity, $object)) { |
41 | if (in_array($object, $object_dupe_check)) continue; |
41 | if (in_array($object, $object_dupe_check)) continue; |