diff options
-rw-r--r-- | it.class | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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" : ""; |