summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2008-02-04 13:47:26 +0000
committerUrban Müller2008-02-04 13:47:26 +0000
commit258822f10abfe3ce6278487424b682cf029ee77f (patch)
tree677640f46f145d4285445065c01289d91c73a7de /it.class
parent02f6299ec3ce723f2cb15ce3b62ee578ded5a7d1 (diff)
downloaditools-258822f10abfe3ce6278487424b682cf029ee77f.tar.gz
itools-258822f10abfe3ce6278487424b682cf029ee77f.tar.bz2
itools-258822f10abfe3ce6278487424b682cf029ee77f.zip
debug code for lastsent
Diffstat (limited to 'it.class')
-rw-r--r--it.class7
1 files changed, 6 insertions, 1 deletions
diff --git a/it.class b/it.class
index 10cede4..083ca51 100644
--- a/it.class
+++ b/it.class
@@ -173,7 +173,11 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate
if ($sendmail)
{
$lastsentfn = "/tmp/alertdata/lastsent_" . getmyuid() . "." . md5($p['to']);
- if (($sendmail = time() - @filemtime($lastsentfn) > $p['blockmail']))
+ $now = time();
+ $lastsenttime = @filemtime($lastsentfn);
+ $sendmail = $now - $lastsenttime > $p['blockmail'];
+ $lastsentdebug = "Lastsent: lastsentfn=$lastsentfn now=$now lastsenttime=$lastsenttime blockmail={$p['blockmail']} sendmail=$sendmail\n\n";
+ if ($sendmail)
{
@unlink($lastsentfn);
@touch($lastsentfn);
@@ -200,6 +204,7 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate
$body .= "Host: " . getenv('HOSTNAME') . "\n\n";
$body .= $p['locals'] && strlen($locals) < 100000 ? "Locals: $locals\n\n" : "";
$body .= $p['id'] ? "Filter: graceperiod={$p['graceperiod']} timewindow={$p['timewindow']}\n\n" : "";
+ $body .= $lastsentdebug;
$body .= $_GET ? "\$_GET: " . print_r($_GET, true) . "\n\n" : "";
$body .= $_POST ? "\$_POST: " . print_r($_POST, true) . "\n\n" : "";
$body .= $_COOKIE ? "\$_COOKIE: " . print_r($_COOKIE, true) . "\n\n" : "";