From ebe66f656fad45145e93c5be447ff598393d2ca0 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 29 Jan 2006 22:24:08 +0000 Subject: Add AJAX button indicator support during AJAX operations. --- packages/spamd_db.php | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'packages/spamd_db.php') diff --git a/packages/spamd_db.php b/packages/spamd_db.php index 80676c78..03658935 100644 --- a/packages/spamd_db.php +++ b/packages/spamd_db.php @@ -34,6 +34,10 @@ if($_POST['filter']) /* handle AJAX operations */ if($_GET['action'] or $_POST['action']) { + /* echo back buttonid so it can be turned + * back off when request is completed. + */ + echo $_GET['buttonid'] . "|"; if($_GET['action']) $action = $_GET['action']; if($_POST['action']) @@ -43,6 +47,7 @@ if($_GET['action'] or $_POST['action']) { if($_POST['srcip']) $srcip = $_POST['srcip']; $pkgdb = split("\n", `/usr/local/sbin/spamdb`); + /* execute spamdb command */ if($action == "whitelist") { exec("/usr/local/sbin/spamdb -a {$srcip}"); } else if($action == "delete") { @@ -52,6 +57,7 @@ if($_GET['action'] or $_POST['action']) { } else if($action == "trapped") { exec("/usr/local/sbin/spamdb -a {$srcip} -t"); } + /* signal a reload for real time effect. */ mwexec("killall -HUP spamlogd"); exit; } @@ -77,9 +83,28 @@ include("head.inc");