Просмотр исходного кода

added dns&mail bulk operation support

Serghey Rodin 13 лет назад
Родитель
Сommit
daea2394cc

+ 79 - 0
web/bulk/dns/index.php

@@ -0,0 +1,79 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+$domain = $_POST['domain'];
+$record = $_POST['record'];
+$action = $_POST['action'];
+
+if ($_SESSION['user'] == 'admin') {
+    if (empty($record)) {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_dns_domain';
+                break;
+            case 'suspend': $cmd='v_suspend_dns_domain';
+                break;
+            case 'unsuspend': $cmd='v_unsuspend_dns_domain';
+                break;
+            default: header("Location: /list/dns/"); exit;
+        }
+    } else {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_dns_domain_record';
+                break;
+            case 'suspend': $cmd='v_suspend_dns_domain_record';
+                break;
+            case 'unsuspend': $cmd='v_unsuspend_dns_domain_record';
+                break;
+            default: header("Location: /list/dns/?domain=".$domain); exit;
+        }
+    }
+} else {
+    if (empty($record)) {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_dns_domain';
+                break;
+            default: header("Location: /list/dns/"); exit;
+        }
+    } else {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_dns_domain_record';
+                break;
+            default: header("Location: /list/dns/?domain=".$domain); exit;
+        }
+    }
+}
+
+
+if (empty($record)) {
+    foreach ($domain as $value) {
+        // DNS
+        $value = escapeshellarg($value);
+        exec (VESTA_CMD.$cmd." ".$user." ".$value." no", $output, $return_var);
+        $restart = 'yes';
+    }
+} else {
+    foreach ($record as $value) {
+        // DNS Record
+        $value = escapeshellarg($value);
+        $dom = escapeshellarg($domain);
+        exec (VESTA_CMD.$cmd." ".$user." ".$dom." ".$value." no", $output, $return_var);
+        $restart = 'yes';
+    }
+}
+
+if (!empty($restart)) {
+    exec (VESTA_CMD."v_restart_dns", $output, $return_var);
+}
+
+if (empty($record)) { 
+    header("Location: /list/dns/");
+    exit;
+} else {
+    header("Location: /list/dns/?domain=".$domain);
+    exit;
+}

+ 75 - 0
web/bulk/mail/index.php

@@ -0,0 +1,75 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+$domain = $_POST['domain'];
+$account = $_POST['account'];
+$action = $_POST['action'];
+
+if ($_SESSION['user'] == 'admin') {
+    if (empty($account)) {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_mail_domain';
+                break;
+            case 'suspend': $cmd='v_suspend_mail_domain';
+                break;
+            case 'unsuspend': $cmd='v_unsuspend_mail_domain';
+                break;
+            default: header("Location: /list/mail/"); exit;
+        }
+    } else {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_mail_account';
+                break;
+            case 'suspend': $cmd='v_suspend_mail_account';
+                break;
+            case 'unsuspend': $cmd='v_unsuspend_mail_account';
+                break;
+            default: header("Location: /list/mail/?domain=".$domain); exit;
+        }
+    }
+} else {
+    if (empty($account)) {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_mail_domain';
+                break;
+            default: header("Location: /list/mail/"); exit;
+        }
+    } else {
+        switch ($action) {
+            case 'delete': $cmd='v_delete_mail_account';
+                break;
+            default: header("Location: /list/mail/?domain=".$domain); exit;
+        }
+    }
+}
+
+
+if (empty($account)) {
+    foreach ($domain as $value) {
+        // Mail
+        $value = escapeshellarg($value);
+        exec (VESTA_CMD.$cmd." ".$user." ".$value." no", $output, $return_var);
+        $restart = 'yes';
+    }
+} else {
+    foreach ($account as $value) {
+        // Mail Account
+        $value = escapeshellarg($value);
+        $dom = escapeshellarg($domain);
+        exec (VESTA_CMD.$cmd." ".$user." ".$dom." ".$value." no", $output, $return_var);
+        $restart = 'yes';
+    }
+}
+
+if (empty($account)) { 
+    header("Location: /list/mail/");
+    exit;
+} else {
+    header("Location: /list/mail/?domain=".$domain);
+    exit;
+}

+ 13 - 11
web/templates/admin/list_dns.html

@@ -1,24 +1,25 @@
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/'"> Add DNS Domain </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get">
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/dns/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
                                                     <option>suspend</option>
                                                     <option>unsuspend</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -27,7 +28,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 foreach ($data as $key => $value) {
@@ -83,7 +84,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="domain[]" value="<?php echo "$key" ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -163,6 +164,7 @@
                                 }
                             ?>
                         </table>
+                        </form>
 
                         <table class="data-count">
                             <tr>
@@ -178,5 +180,5 @@
                                 </td>
                             </tr>
                         </table>
-                    </form>
+                    </div>
 

+ 13 - 11
web/templates/admin/list_dns_rec.html

@@ -1,25 +1,26 @@
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'"> Add DNS Record </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get">
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/dns/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
                                                     <option>suspend</option>
                                                     <option>unsuspend</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -28,7 +29,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 foreach ($data as $key => $value) {
@@ -84,7 +85,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="record[]" value="<?php echo $data[$key]['ID']?>" > <input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -124,6 +125,7 @@
                             }
                         ?> 
                     </table>
+                    </form>
 
                     <table class="data-count">
                         <tr>
@@ -139,4 +141,4 @@
                             </td>
                         </tr>
                     </table>
-                </form>
+                </div>

+ 13 - 11
web/templates/admin/list_mail.html

@@ -1,24 +1,25 @@
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/'"> Add Mail Domain </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get" >
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/mail/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
                                                     <option>suspend</option>
                                                     <option>unsuspend</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -27,7 +28,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
@@ -87,7 +88,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="domain[]" value="<?php echo "$key" ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -190,6 +191,7 @@
                                 }
                             ?>
                         </table>
+                        </form>
 
                         <table class="data-count">
                             <tr>
@@ -205,4 +207,4 @@
                                 </td>
                             </tr>
                         </table>
-                    </form>
+                    </div>

+ 13 - 11
web/templates/admin/list_mail_acc.html

@@ -1,25 +1,26 @@
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'"> Add Mail Account </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get">
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/mail/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
                                                     <option>suspend</option>
                                                     <option>unsuspend</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -28,7 +29,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 foreach ($data as $key => $value) {
@@ -85,7 +86,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="account[]" value="<?php echo $key?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -172,6 +173,7 @@
                             }
                         ?>
                     </table>
+                    </form>
 
                     <table class="data-count">
                         <tr>
@@ -187,5 +189,5 @@
                             </td>
                         </tr>
                     </table>
-                </form>
+                </div>
 

+ 13 - 12
web/templates/user/list_dns.html

@@ -1,23 +1,23 @@
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/'"> Add DNS Domain </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get" >
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/dns/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
-                                                    <option>unsuspend</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -26,7 +26,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 foreach ($data as $key => $value) {
@@ -65,7 +65,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="domain[]" value="<?php echo "$key" ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -138,6 +138,7 @@
                                 }
                             ?>
                         </table>
+                        </form>
 
                         <table class="data-count">
                             <tr>
@@ -153,5 +154,5 @@
                                 </td>
                             </tr>
                         </table>
-                    </form>
+                    </dim>
 

+ 13 - 13
web/templates/user/list_dns_rec.html

@@ -1,25 +1,24 @@
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'"> Add DNS Record </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get">
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/dns/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
-                                                    <option>suspend</option>
-                                                    <option>unsuspend</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -28,7 +27,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 foreach ($data as $key => $value) {
@@ -67,7 +66,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="record[]" value="<?php echo $data[$key]['ID']?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -100,6 +99,7 @@
                                 }
                             ?>
                         </table>
+                        </form>
 
                         <table class="data-count">
                             <tr>
@@ -115,5 +115,5 @@
                                 </td>
                             </tr>
                         </table>
-                    </form>
+                    </div>
 

+ 13 - 11
web/templates/user/list_mail.html

@@ -1,22 +1,23 @@
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/'"> Add Mail Domain </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get" >
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/mail/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -25,7 +26,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
@@ -68,7 +69,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="domain[]" value="<?php echo "$key" ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -164,6 +165,7 @@
                                 }
                             ?>
                         </table>
+                        </form>
 
                         <table class="data-count">
                             <tr>
@@ -179,5 +181,5 @@
                                 </td>
                             </tr>
                         </table>
-                    </form>
+                    </div>
 

+ 13 - 11
web/templates/user/list_mail_acc.html

@@ -1,23 +1,24 @@
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 12px 0 8px 6px">
+                                        <td style="padding: 12px 0 0 6px">
                                             <div style="float:left">
                                                 <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'"> Add Mail Account </button>
                                             </div>
                                             <div style="text-align: right; float: right;">
-                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
-                                                <button> Search </button>
+                                                <form action="/search/" method="get">
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;" name="q">
+                                                <input type="submit" name="search" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-                                                <select style="margin:0 2px 0 0px;" >
+                                                <form action="/bulk/mail/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
                                                     <option>apply to selected</option>
-                                                    <option>rebuild</option>
-                                                    <option>update counters</option>
                                                     <option>delete</option>
                                                 </select>
-                                                <button style="width:27px;"> › </button>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px;">
                                             </div>
                                         </td>
                                     </tr>
@@ -26,7 +27,7 @@
                         </tr>
                     </table>
 
-                    <form id="vstobjects">
+                    <div id="vstobjects">
                         <table class="data">
                             <?php
                                 foreach ($data as $key => $value) {
@@ -65,7 +66,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
                                     <table class="data-col1">
-                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="account[]" value="<?php echo $key?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
                                         <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
                                         <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
                                     </table>
@@ -145,6 +146,7 @@
                             }
                         ?>
                     </table>
+                    </form>
 
                     <table class="data-count">
                         <tr>
@@ -160,5 +162,5 @@
                             </td>
                         </tr>
                     </table>
-                </form>
+                </div>