Rev 1086 | Rev 1116 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1086 | Rev 1114 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | 32 | ||
33 | public static function log($event, $users, $objects)/*: bool*/ { |
33 | public static function log($event, $users, $objects)/*: bool*/ { |
34 | $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; |
34 | $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; |
35 | OIDplus::dbIsolated()->query("insert into ###log (addr, unix_ts, event) values (?, ?, ?)", array($addr, time(), $event)); |
35 | OIDplus::dbIsolated()->query("insert into ###log (addr, unix_ts, event) values (?, ?, ?)", array($addr, time(), $event)); |
36 | $log_id = OIDplus::dbIsolated()->insert_id(); |
36 | $log_id = OIDplus::dbIsolated()->insert_id(); |
37 | if ($log_id === false) { |
37 | if ($log_id == 0) { |
38 | $res = OIDplus::dbIsolated()->query("select max(id) as last_id from ###log"); |
38 | $res = OIDplus::dbIsolated()->query("select max(id) as last_id from ###log"); |
39 | if (!$res->any()) throw new OIDplusException(_L('Could not log event')); |
39 | if (!$res->any()) throw new OIDplusException(_L('Could not log event')); |
40 | $row = $res->fetch_array(); |
40 | $row = $res->fetch_array(); |
41 | $log_id = $row['last_id']; |
41 | $log_id = $row['last_id']; |
42 | if ($log_id == 0) throw new OIDplusException(_L('Could not log event')); |
42 | if ($log_id == 0) throw new OIDplusException(_L('Could not log event')); |