Subversion Repositories oidplus

Rev

Rev 786 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 786 Rev 790
Line 30... Line 30...
30
                $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
30
                $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
31
                OIDplus::dbIsolated()->query("insert into ###log (addr, unix_ts, event) values (?, ?, ?)", array($addr, time(), $event));
31
                OIDplus::dbIsolated()->query("insert into ###log (addr, unix_ts, event) values (?, ?, ?)", array($addr, time(), $event));
32
                $log_id = OIDplus::dbIsolated()->insert_id();
32
                $log_id = OIDplus::dbIsolated()->insert_id();
33
                if ($log_id === false) {
33
                if ($log_id === false) {
34
                        $res = OIDplus::dbIsolated()->query("select max(id) as last_id from ###log");
34
                        $res = OIDplus::dbIsolated()->query("select max(id) as last_id from ###log");
35
                        if ($res->num_rows() == 0) throw new OIDplusException(_L('Could not log event'));
35
                        if (!$res->any()) throw new OIDplusException(_L('Could not log event'));
36
                        $row = $res->fetch_array();
36
                        $row = $res->fetch_array();
37
                        $log_id = $row['last_id'];
37
                        $log_id = $row['last_id'];
38
                        if ($log_id == 0) throw new OIDplusException(_L('Could not log event'));
38
                        if ($log_id == 0) throw new OIDplusException(_L('Could not log event'));
39
                }
39
                }
40
 
40