]>
Commit | Line | Data |
---|---|---|
2cbdc95b AD |
1 | <?php |
2 | ||
3 | class Pref_System extends Handler_Protected { | |
4 | ||
5 | function __construct($link, $args) { | |
6 | parent::__construct($link, $args); | |
7 | } | |
8 | ||
9 | function before($method) { | |
10 | if (parent::before($method)) { | |
11 | if ($_SESSION["access_level"] < 10) { | |
12 | print __("Your access level is insufficient to open this tab."); | |
13 | return false; | |
14 | } | |
15 | return true; | |
16 | } | |
17 | return false; | |
18 | } | |
19 | ||
20 | function csrf_ignore($method) { | |
21 | $csrf_ignored = array("index"); | |
22 | ||
23 | return array_search($method, $csrf_ignored) !== false; | |
24 | } | |
25 | ||
26 | function index() { | |
27 | ||
28 | print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">"; | |
29 | print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Error Log')."\">"; | |
30 | ||
31 | $result = db_query($this->link, "SELECT errno, errstr, filename, lineno, | |
32 | created_at, login FROM ttrss_error_log | |
33 | LEFT JOIN ttrss_users ON (owner_uid = ttrss_users.id) | |
34 | ORDER BY ttrss_error_log.id DESC | |
35 | LIMIT 100"); | |
36 | ||
37 | print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">"; | |
38 | ||
39 | print "<tr class=\"title\"> | |
40 | <td width='5%'>".__("Error")."</td> | |
41 | <td>".__("Filename")."</td> | |
42 | <td>".__("Message")."</td> | |
43 | <td width='5%'>".__("User")."</td> | |
44 | <td width='5%'>".__("Date")."</td> | |
45 | </tr>"; | |
46 | ||
47 | while ($line = db_fetch_assoc($result)) { | |
48 | print "<tr class=\"errrow\">"; | |
49 | ||
50 | foreach ($line as $k => $v) { | |
51 | $line[$k] = htmlspecialchars($v); | |
52 | } | |
53 | ||
54 | print "<td class='errno'>" . Logger::$errornames[$line["errno"]] . " (" . $line["errno"] . ")</td>"; | |
55 | print "<td class='filename'>" . $line["filename"] . ":" . $line["lineno"] . "</td>"; | |
56 | print "<td class='errstr'>" . $line["errstr"] . "</td>"; | |
57 | print "<td class='login'>" . $line["login"] . "</td>"; | |
58 | ||
59 | print "<td class='timestamp'>" . | |
60 | make_local_datetime($this->link, | |
61 | $line["created_at"], false) . "</td>"; | |
62 | ||
63 | print "</tr>"; | |
64 | } | |
65 | ||
66 | print "</table>"; | |
67 | ||
68 | print "</div>"; | |
69 | ||
70 | global $pluginhost; | |
71 | $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB, | |
72 | "hook_prefs_tab", "prefSystem"); | |
73 | ||
74 | print "</div>"; #container | |
75 | } | |
76 | ||
77 | } | |
78 | ?> |