Subversion Repositories oidplus

Rev

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

Rev 256 Rev 261
Line 53... Line 53...
53
                                $out['icon'] = 'img/error_big.png';
53
                                $out['icon'] = 'img/error_big.png';
54
                                $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
54
                                $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
55
                                return $out;
55
                                return $out;
56
                        }
56
                        }
57
 
57
 
58
                        $res = OIDplus::db()->query("select lo.id, lo.unix_ts, lo.addr, lo.event from ".OIDPLUS_TABLENAME_PREFIX."log lo ".
58
                        $res = OIDplus::db()->query("select lo.id, lo.unix_ts, lo.addr, lo.event from ###log lo ".
59
                                                    "left join ".OIDPLUS_TABLENAME_PREFIX."log_user lu on lu.log_id = lo.id ".
59
                                                    "left join ###log_user lu on lu.log_id = lo.id ".
60
                                                    //"where lu.username = 'admin' " .
60
                                                    //"where lu.username = 'admin' " .
61
                                                    "order by lo.unix_ts desc");
61
                                                    "order by lo.unix_ts desc");
62
                        if ($res->num_rows() > 0) {
62
                        if ($res->num_rows() > 0) {
63
                                $out['text'] = '<pre>';
63
                                $out['text'] = '<pre>';
64
                                while ($row = $res->fetch_array()) {
64
                                while ($row = $res->fetch_array()) {
65
                                        $users = array();
65
                                        $users = array();
66
                                        $res2 = OIDplus::db()->query("select username from ".OIDPLUS_TABLENAME_PREFIX."log_user ".
66
                                        $res2 = OIDplus::db()->query("select username from ###log_user ".
67
                                                                     "where log_id = ?", array($row['id']));
67
                                                                     "where log_id = ?", array($row['id']));
68
                                        while ($row2 = $res2->fetch_array()) {
68
                                        while ($row2 = $res2->fetch_array()) {
69
                                                $users[] = $row2['username'];
69
                                                $users[] = $row2['username'];
70
                                        }
70
                                        }
71
                                        $users = count($users) > 0 ? ", ".implode('/',$users) : '';
71
                                        $users = count($users) > 0 ? ", ".implode('/',$users) : '';