summaryrefslogtreecommitdiff
path: root/modules/watchdog.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/watchdog.module')
-rw-r--r--modules/watchdog.module36
1 files changed, 23 insertions, 13 deletions
diff --git a/modules/watchdog.module b/modules/watchdog.module
index 02c7c23ca..23d4c8d28 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -7,6 +7,10 @@ function watchdog_help() {
<?php
}
+function watchdog_perm() {
+ return array("access watchdog");
+}
+
function watchdog_conf_options() {
$period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => t("Never"));
$output .= form_select(t("Discard entries older than"), "watchdog_clear", variable_get("watchdog_clear", 604800), $period, t("The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab."));
@@ -53,19 +57,25 @@ function watchdog_view($id) {
}
function watchdog_admin() {
- global $op, $id, $type, $order;
-
- print "<SMALL><A HREF=\"admin.php?mod=watchdog&type=account\">account messages</A> | <A HREF=\"admin.php?mod=watchdog&type=regular\">regular messages</A> | <A HREF=\"admin.php?mod=watchdog&type=special\">special messages</A> | <A HREF=\"admin.php?mod=watchdog&type=warning\">warning messages</A> | <A HREF=\"admin.php?mod=watchdog&type=error\">error messages</A> | <A HREF=\"admin.php?mod=watchdog&type=httpd\">httpd messages</A> | <A HREF=\"admin.php?mod=watchdog\">overview</A> | <A HREF=\"admin.php?mod=watchdog&op=help\">help</A></SMALL><HR>\n";
-
- switch ($op) {
- case "help":
- watchdog_help();
- break;
- case "view":
- print watchdog_view(check_input($id));
- break;
- default:
- print watchdog_overview($type);
+ global $user, $op, $id, $type, $order;
+
+ if (user_access($user, "access watchdog")) {
+
+ print "<SMALL><A HREF=\"admin.php?mod=watchdog&type=account\">account messages</A> | <A HREF=\"admin.php?mod=watchdog&type=regular\">regular messages</A> | <A HREF=\"admin.php?mod=watchdog&type=special\">special messages</A> | <A HREF=\"admin.php?mod=watchdog&type=warning\">warning messages</A> | <A HREF=\"admin.php?mod=watchdog&type=error\">error messages</A> | <A HREF=\"admin.php?mod=watchdog&type=httpd\">httpd messages</A> | <A HREF=\"admin.php?mod=watchdog\">overview</A> | <A HREF=\"admin.php?mod=watchdog&op=help\">help</A></SMALL><HR>\n";
+
+ switch ($op) {
+ case "help":
+ watchdog_help();
+ break;
+ case "view":
+ print watchdog_view(check_input($id));
+ break;
+ default:
+ print watchdog_overview($type);
+ }
+ }
+ else {
+ print message_access();
}
}