From: Michael Rasmussen Date: Tue, 2 Jun 2015 23:15:04 +0000 (+0200) Subject: Handle multi action button X-Git-Url: http://git.datanom.net/qtadmin.git/commitdiff_plain/ebed93329759e2584eee3c4e2aa1deddc1c32bf8 Handle multi action button --- diff --git a/index.php b/index.php index 29ad11e..1dc0606 100644 --- a/index.php +++ b/index.php @@ -92,8 +92,10 @@ $_SESSION['marked'] = serialize($marked); echo ''; - echo ''; + echo ''; + echo ''; echo "

$first$prev Showing page $pageNum of $maxPage pages $next$last

"; diff --git a/js/checkbox.js b/js/checkbox.js index d2d516c..da738c2 100644 --- a/js/checkbox.js +++ b/js/checkbox.js @@ -1,6 +1,6 @@ /* vim: set ts=4 tw=4 sw=4 noet: */ -function checkAction() { +function checkAction(action) { var ids = ''; var c = document.getElementsByName('action'); for (var i = 0; i < c.length; i++) { @@ -12,6 +12,6 @@ function checkAction() { } } } - var url = 'quarantine.php?op=release&id=' + ids; + var url = 'quarantine.php?op=' + action + '&id=' + ids; location.href=url; } diff --git a/quarantine.php b/quarantine.php index 2552995..3a75701 100644 --- a/quarantine.php +++ b/quarantine.php @@ -21,8 +21,8 @@ $mail = unserialize($_SESSION['mailInfo']["$mail_id"]); $secret_id = $mail->secret_id; $recipient = $mail->recipient; - echo "$mail_id $secret_id $recipient"; -/* + //echo "$mail_id $secret_id $recipient"; + if ($request == 'release') { $amavisserver = $CFG->amavisd_db_host; $policy_port = $CFG->amavis_policy_port; @@ -56,8 +56,9 @@ error("Unknown operation [$request]"); exit; } -*/ } + + return $query; } $util = Utils::getInstance(); @@ -66,8 +67,8 @@ if ($loggedIn && isset($_GET['id'])) { $ids = explode(',', $_GET['id']); $query = handleRequest($request, $ids); - exit; -/* $mail_id = urldecode($_GET['id']); +/* exit; + $mail_id = urldecode($_GET['id']); $mail = unserialize($_SESSION['mailInfo']["$mail_id"]); $secret_id = $mail->secret_id; $recipient = $mail->recipient; @@ -106,6 +107,8 @@ error("Unknown operation [$request]"); exit; }*/ + print_r($query); + exit; $success = $DB->update($query); if (! $success) { error("Message not released, contact administrator [$query]");