Commit 16e6b6f1 authored by Dries's avatar Dries

code revision:
   - fixed a "visual-quote-glitch", i.e. a missing stripslashes()
parent 87cfda72
......@@ -10,6 +10,7 @@
function watchdog($id, $message) {
global $user, $watchdog, $watchdog_history;
// flood protection:
if ($watchdog[$id][1] && !user_access($user, "watchdog")) {
if ($log = db_fetch_object(db_query("SELECT * FROM watchdog WHERE hostname = '". getenv("REMOTE_ADDR") ."' AND level = '". $watchdog[$id][0] ."'"))) {
if (time() - $log->timestamp < $watchdog[$id][1]) {
......@@ -20,7 +21,7 @@ function watchdog($id, $message) {
}
}
// Perform query to add new watchdog entry:
// perform query to add new watchdog entry:
db_query("INSERT INTO watchdog (level, timestamp, user, message, location, hostname) VALUES ('". $watchdog[$id][0] ."', '". time() ."', '". check_input($user->id) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."')");
}
......
......@@ -57,12 +57,12 @@ function watchdog_view($id) {
if ($watchdog = db_fetch_object($result)) {
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TH>Level:</TH><TD>$watchdog->level</TD></TR>\n";
$output .= " <TR><TH>Level:</TH><TD>". check_output($watchdog->level) ."</TD></TR>\n";
$output .= " <TR><TH>Date:</TH><TD>". format_date($watchdog->timestamp, "large") ."</TD></TR>\n";
$output .= " <TR><TH>User:</TH><TD>". format_username($watchdog->userid) ."</TD></TR>\n";
$output .= " <TR><TH>Location:</TH><TD>$watchdog->location</TD></TR>\n";
$output .= " <TR><TH>Message:</TH><TD>$watchdog->message</TD></TR>\n";
$output .= " <TR><TH>Hostname:</TH><TD>$watchdog->hostname</TD></TR>\n";
$output .= " <TR><TH>Location:</TH><TD>". check_output($watchdog->location). "</TD></TR>\n";
$output .= " <TR><TH>Message:</TH><TD>". check_output($watchdog->message) ."</TD></TR>\n";
$output .= " <TR><TH>Hostname:</TH><TD>". check_output($watchdog->hostname) ."</TD></TR>\n";
$output .= "</TABLE>\n";
print $output;
}
......
......@@ -57,12 +57,12 @@ function watchdog_view($id) {
if ($watchdog = db_fetch_object($result)) {
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TH>Level:</TH><TD>$watchdog->level</TD></TR>\n";
$output .= " <TR><TH>Level:</TH><TD>". check_output($watchdog->level) ."</TD></TR>\n";
$output .= " <TR><TH>Date:</TH><TD>". format_date($watchdog->timestamp, "large") ."</TD></TR>\n";
$output .= " <TR><TH>User:</TH><TD>". format_username($watchdog->userid) ."</TD></TR>\n";
$output .= " <TR><TH>Location:</TH><TD>$watchdog->location</TD></TR>\n";
$output .= " <TR><TH>Message:</TH><TD>$watchdog->message</TD></TR>\n";
$output .= " <TR><TH>Hostname:</TH><TD>$watchdog->hostname</TD></TR>\n";
$output .= " <TR><TH>Location:</TH><TD>". check_output($watchdog->location). "</TD></TR>\n";
$output .= " <TR><TH>Message:</TH><TD>". check_output($watchdog->message) ."</TD></TR>\n";
$output .= " <TR><TH>Hostname:</TH><TD>". check_output($watchdog->hostname) ."</TD></TR>\n";
$output .= "</TABLE>\n";
print $output;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment