summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-07-29 04:12:19 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-07-29 04:12:19 +0000
commit354e0c1f83c83bd134cd5d682f5ddcb2316f7c75 (patch)
tree83b60a5a709427c5a682771e63f2ec7b614d9f3f
parent515f7b41f16af341b345f553ec5409f973edd581 (diff)
downloadbrdo-354e0c1f83c83bd134cd5d682f5ddcb2316f7c75.tar.gz
brdo-354e0c1f83c83bd134cd5d682f5ddcb2316f7c75.tar.bz2
- #23651: Display referrer info with watchdog messages.
-rw-r--r--database/database.mysql1
-rw-r--r--database/database.pgsql1
-rw-r--r--database/updates.inc9
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--modules/watchdog.module1
-rw-r--r--modules/watchdog/watchdog.module1
6 files changed, 13 insertions, 2 deletions
diff --git a/database/database.mysql b/database/database.mysql
index 334561860..70bfb5231 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -768,6 +768,7 @@ CREATE TABLE watchdog (
severity tinyint(3) unsigned NOT NULL default '0',
link varchar(255) NOT NULL default '',
location varchar(128) NOT NULL default '',
+ referer varchar(128) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
PRIMARY KEY (wid)
diff --git a/database/database.pgsql b/database/database.pgsql
index 31c4fcd0d..5aab7c4ed 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -762,6 +762,7 @@ CREATE TABLE watchdog (
severity smallint NOT NULL default '0',
link varchar(255) NOT NULL default '',
location varchar(128) NOT NULL default '',
+ referer varchar(128) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp integer NOT NULL default '0',
PRIMARY KEY (wid)
diff --git a/database/updates.inc b/database/updates.inc
index fa63b67e2..5427e9674 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -117,7 +117,8 @@ $sql_updates = array(
"2005-05-10" => "update_138",
"2005-05-11" => "update_139",
"2005-05-12" => "update_140",
- "2005-05-22" => "update_141"
+ "2005-05-22" => "update_141",
+ "2005-07-29" => "update_142"
);
function update_32() {
@@ -2511,6 +2512,12 @@ function update_141() {
return $ret;
}
+function update_142() {
+ $ret = array();
+ $ret[] = update_sql("ALTER TABLE {watchdog} ADD COLUMN referer varchar(128) NOT NULL");
+ return $ret;
+}
+
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 8354520e6..b307ab910 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -739,7 +739,7 @@ function request_uri() {
*/
function watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL) {
global $user;
- db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, request_uri(), $_SERVER['REMOTE_ADDR'], time());
+ db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, request_uri(), referer_uri(), $_SERVER['REMOTE_ADDR'], time());
}
/**
diff --git a/modules/watchdog.module b/modules/watchdog.module
index 64a580fef..68f460c35 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -141,6 +141,7 @@ function watchdog_event($id) {
$output .= ' <tr><th>'. t('Date') .'</th><td>'. format_date($watchdog->timestamp, 'large') .'</td></tr>';
$output .= ' <tr><th>'. t('User') .'</th><td>'. format_name($watchdog) .'</td></tr>';
$output .= ' <tr><th>'. t('Location') ."</th><td>". l($watchdog->location, $watchdog->location) ."</td></tr>";
+ $output .= ' <tr><th>'. t('Referrer') ."</th><td>". l($watchdog->referer, $watchdog->referer) ."</td></tr>";
$output .= ' <tr><th>'. t('Message') ."</th><td>$watchdog->message</td></tr>";
$output .= ' <tr><th>'. t('Severity') .'</th><td>'. $severity[$watchdog->severity] .'</td></tr>';
$output .= ' <tr><th>'. t('Hostname') ."</th><td>$watchdog->hostname</td></tr>";
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index 64a580fef..68f460c35 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -141,6 +141,7 @@ function watchdog_event($id) {
$output .= ' <tr><th>'. t('Date') .'</th><td>'. format_date($watchdog->timestamp, 'large') .'</td></tr>';
$output .= ' <tr><th>'. t('User') .'</th><td>'. format_name($watchdog) .'</td></tr>';
$output .= ' <tr><th>'. t('Location') ."</th><td>". l($watchdog->location, $watchdog->location) ."</td></tr>";
+ $output .= ' <tr><th>'. t('Referrer') ."</th><td>". l($watchdog->referer, $watchdog->referer) ."</td></tr>";
$output .= ' <tr><th>'. t('Message') ."</th><td>$watchdog->message</td></tr>";
$output .= ' <tr><th>'. t('Severity') .'</th><td>'. $severity[$watchdog->severity] .'</td></tr>';
$output .= ' <tr><th>'. t('Hostname') ."</th><td>$watchdog->hostname</td></tr>";