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