Serghey Rodin 13 lat temu
rodzic
commit
e734d14637
43 zmienionych plików z 1280 dodań i 54 usunięć
  1. 4 0
      bin/v_list_user_ips
  2. 1 1
      func/ip.sh
  3. 2 2
      web/add/cron/index.php
  4. 2 2
      web/add/db/index.php
  5. 2 2
      web/add/dns/index.php
  6. 2 2
      web/add/mail/index.php
  7. 2 2
      web/add/web/index.php
  8. 2 2
      web/delete/backup/index.php
  9. 2 2
      web/delete/cron/index.php
  10. 2 2
      web/delete/db/index.php
  11. 2 2
      web/delete/dns/index.php
  12. 2 2
      web/delete/mail/index.php
  13. 17 19
      web/delete/web/index.php
  14. 2 2
      web/edit/cron/index.php
  15. 2 2
      web/edit/db/index.php
  16. 2 2
      web/edit/dns/index.php
  17. 2 2
      web/edit/mail/index.php
  18. 2 2
      web/edit/web/index.php
  19. 2 2
      web/list/backup/index.php
  20. 11 0
      web/list/cron/index.php
  21. 10 0
      web/list/db/index.php
  22. 21 0
      web/list/dns/index.php
  23. 21 0
      web/list/mail/index.php
  24. 2 2
      web/list/stats/index.php
  25. 9 0
      web/list/web/index.php
  26. 48 0
      web/templates/user/edit_user.html
  27. 126 0
      web/templates/user/list_cron.html
  28. 111 0
      web/templates/user/list_db.html
  29. 108 0
      web/templates/user/list_dns.html
  30. 93 0
      web/templates/user/list_dns_rec.html
  31. 114 0
      web/templates/user/list_mail.html
  32. 106 0
      web/templates/user/list_mail_acc.html
  33. 150 0
      web/templates/user/list_user.html
  34. 134 0
      web/templates/user/list_web.html
  35. 15 0
      web/templates/user/menu_cron.html
  36. 15 0
      web/templates/user/menu_db.html
  37. 16 0
      web/templates/user/menu_dns.html
  38. 15 0
      web/templates/user/menu_dns_rec.html
  39. 16 0
      web/templates/user/menu_mail.html
  40. 15 0
      web/templates/user/menu_mail_acc.html
  41. 10 0
      web/templates/user/menu_user.html
  42. 16 0
      web/templates/user/menu_web.html
  43. 44 0
      web/templates/user/panel.html

+ 4 - 0
bin/v_list_user_ips

@@ -44,7 +44,11 @@ json_list_user_ips() {
             done
             done
         else
         else
             if  [ "$OWNER" = 'admin' ] && [ "$STATUS" = 'shared' ]; then
             if  [ "$OWNER" = 'admin' ] && [ "$STATUS" = 'shared' ]; then
+                if [ -n "$data" ]; then
+                    echo -e '        },'
+                fi
                 i=1
                 i=1
+
                 for field in $fields; do
                 for field in $fields; do
                     eval value=$field
                     eval value=$field
                     if [ $i -eq 1 ]; then
                     if [ $i -eq 1 ]; then

+ 1 - 1
func/ip.sh

@@ -13,7 +13,7 @@ is_ip_valid() {
 is_ip_avalable() {
 is_ip_avalable() {
     ip_data=$(cat $VESTA/data/ips/$ip)
     ip_data=$(cat $VESTA/data/ips/$ip)
     owner=$(echo "$ip_data"|grep OWNER= | cut -f 2 -d \')
     owner=$(echo "$ip_data"|grep OWNER= | cut -f 2 -d \')
-    status=$(echo "$ip_data"|grep OWNER= | cut -f 2 -d \')
+    status=$(echo "$ip_data"|grep STATUS= | cut -f 2 -d \')
     shared=no
     shared=no
     if [ 'admin' = "$owner" ] && [ "$status" = 'shared' ]; then
     if [ 'admin' = "$owner" ] && [ "$status" = 'shared' ]; then
         shared='yes'
         shared='yes'

+ 2 - 2
web/add/cron/index.php

@@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_POST['ok'])) {
     if (!empty($_POST['ok'])) {
         // Check input
         // Check input
         if (empty($_POST['v_min'])) $errors[] = 'minute';
         if (empty($_POST['v_min'])) $errors[] = 'minute';
@@ -72,7 +72,7 @@ if ($_SESSION['user'] == 'admin') {
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);
     unset($_SESSION['ok_msg']);
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/add/db/index.php

@@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_POST['ok'])) {
     if (!empty($_POST['ok'])) {
         // Check input
         // Check input
         if (empty($_POST['v_database'])) $errors[] = 'database';
         if (empty($_POST['v_database'])) $errors[] = 'database';
@@ -71,7 +71,7 @@ if ($_SESSION['user'] == 'admin') {
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);
     unset($_SESSION['ok_msg']);
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/add/dns/index.php

@@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_POST['ok'])) {
     if (!empty($_POST['ok'])) {
         // Check input
         // Check input
         if (empty($_POST['v_domain'])) $errors[] = 'domain';
         if (empty($_POST['v_domain'])) $errors[] = 'domain';
@@ -132,7 +132,7 @@ if ($_SESSION['user'] == 'admin') {
         unset($_SESSION['error_msg']);
         unset($_SESSION['error_msg']);
         unset($_SESSION['ok_msg']);
         unset($_SESSION['ok_msg']);
     }
     }
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/add/mail/index.php

@@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     // Mail Domain
     // Mail Domain
     if (!empty($_POST['ok'])) {
     if (!empty($_POST['ok'])) {
         if (empty($_POST['v_domain'])) $errors[] = 'domain';
         if (empty($_POST['v_domain'])) $errors[] = 'domain';
@@ -174,7 +174,7 @@ if ($_SESSION['user'] == 'admin') {
         unset($_SESSION['error_msg']);
         unset($_SESSION['error_msg']);
         unset($_SESSION['ok_msg']);
         unset($_SESSION['ok_msg']);
     }
     }
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/add/web/index.php

@@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_POST['ok'])) {
     if (!empty($_POST['ok'])) {
         // Check input
         // Check input
         if (empty($_POST['v_domain'])) $errors[] = 'domain';
         if (empty($_POST['v_domain'])) $errors[] = 'domain';
@@ -216,7 +216,7 @@ if ($_SESSION['user'] == 'admin') {
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);
     unset($_SESSION['ok_msg']);
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/delete/backup/index.php

@@ -5,13 +5,13 @@ ob_start();
 session_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_GET['backup'])) {
     if (!empty($_GET['backup'])) {
         $v_username = escapeshellarg($user);
         $v_username = escapeshellarg($user);
         $v_backup = escapeshellarg($_GET['backup']);
         $v_backup = escapeshellarg($_GET['backup']);
         exec (VESTA_CMD."v_delete_user_backup ".$v_username." ".$v_backup, $output, $return_var);
         exec (VESTA_CMD."v_delete_user_backup ".$v_username." ".$v_backup, $output, $return_var);
         unset($output);
         unset($output);
     }
     }
-}
+//}
 
 
 header("Location: /list/backup/");
 header("Location: /list/backup/");

+ 2 - 2
web/delete/cron/index.php

@@ -5,13 +5,13 @@ ob_start();
 session_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_GET['job'])) {
     if (!empty($_GET['job'])) {
         $v_username = escapeshellarg($user);
         $v_username = escapeshellarg($user);
         $v_job = escapeshellarg($_GET['job']);
         $v_job = escapeshellarg($_GET['job']);
         exec (VESTA_CMD."v_delete_cron_job ".$v_username." ".$v_job, $output, $return_var);
         exec (VESTA_CMD."v_delete_cron_job ".$v_username." ".$v_job, $output, $return_var);
         unset($output);
         unset($output);
     }
     }
-}
+//}
 
 
 header("Location: /list/cron/");
 header("Location: /list/cron/");

+ 2 - 2
web/delete/db/index.php

@@ -5,13 +5,13 @@ ob_start();
 session_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     if (!empty($_GET['database'])) {
     if (!empty($_GET['database'])) {
         $v_username = escapeshellarg($user);
         $v_username = escapeshellarg($user);
         $v_database = escapeshellarg($_GET['database']);
         $v_database = escapeshellarg($_GET['database']);
         exec (VESTA_CMD."v_delete_database ".$v_username." ".$v_database, $output, $return_var);
         exec (VESTA_CMD."v_delete_database ".$v_username." ".$v_database, $output, $return_var);
         unset($output);
         unset($output);
     }
     }
-}
+//}
 
 
 header("Location: /list/db/");
 header("Location: /list/db/");

+ 2 - 2
web/delete/dns/index.php

@@ -5,7 +5,7 @@ ob_start();
 session_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     // DNS domain
     // DNS domain
     if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
     if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
         $v_username = escapeshellarg($user);
         $v_username = escapeshellarg($user);
@@ -26,6 +26,6 @@ if ($_SESSION['user'] == 'admin') {
         header("Location: /list/dns/?domain=".$_GET['domain']);
         header("Location: /list/dns/?domain=".$_GET['domain']);
         exit;
         exit;
     }
     }
-}
+//}
 
 
 header("Location: /list/dns/");
 header("Location: /list/dns/");

+ 2 - 2
web/delete/mail/index.php

@@ -5,7 +5,7 @@ ob_start();
 session_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
     // Mail domain
     // Mail domain
     if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
     if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
         $v_username = escapeshellarg($user);
         $v_username = escapeshellarg($user);
@@ -26,6 +26,6 @@ if ($_SESSION['user'] == 'admin') {
         header("Location: /list/mail/?domain=".$_GET['domain']);
         header("Location: /list/mail/?domain=".$_GET['domain']);
         exit;
         exit;
     }
     }
-}
+//}
 
 
 header("Location: /list/mail/");
 header("Location: /list/mail/");

+ 17 - 19
web/delete/web/index.php

@@ -5,28 +5,26 @@ ob_start();
 session_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['domain'])) {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        exec (VESTA_CMD."v_delete_web_domain ".$v_username." ".$v_domain, $output, $return_var);
-        unset($output);
+if (!empty($_GET['domain'])) {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v_delete_web_domain ".$v_username." ".$v_domain, $output, $return_var);
+    unset($output);
 
 
-        // DNS
-        if ($return_var == 0) {
-            exec (VESTA_CMD."v_list_dns_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var);
-            if ($lreturn_var == 0 ) {
-                exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
-                unset($output);
-            }
+    // DNS
+    if ($return_var == 0) {
+        exec (VESTA_CMD."v_list_dns_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var);
+        if ($lreturn_var == 0 ) {
+            exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
+            unset($output);
         }
         }
+    }
 
 
-        // Mail
-        if ($return_var == 0) {
-            exec (VESTA_CMD."v_list_mail_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var);
-            if ($lreturn_var == 0 ) {
-                exec (VESTA_CMD."v_delete_mail_domain ".$v_username." ".$v_domain, $output, $return_var);
-            }
+    // Mail
+    if ($return_var == 0) {
+        exec (VESTA_CMD."v_list_mail_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var);
+        if ($lreturn_var == 0 ) {
+            exec (VESTA_CMD."v_delete_mail_domain ".$v_username." ".$v_domain, $output, $return_var);
         }
         }
     }
     }
 }
 }

+ 2 - 2
web/edit/cron/index.php

@@ -14,7 +14,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     // Check user argument?
     // Check user argument?
     if (empty($_GET['job'])) {
     if (empty($_GET['job'])) {
@@ -78,7 +78,7 @@ if ($_SESSION['user'] == 'admin') {
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_cron.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_cron.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);
     unset($_SESSION['ok_msg']);
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/edit/db/index.php

@@ -14,7 +14,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     // Check user argument?
     // Check user argument?
     if (empty($_GET['database'])) {
     if (empty($_GET['database'])) {
@@ -72,7 +72,7 @@ if ($_SESSION['user'] == 'admin') {
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_db.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_db.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);
     unset($_SESSION['ok_msg']);
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/edit/dns/index.php

@@ -14,7 +14,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     // Check user argument?
     // Check user argument?
     if (empty($_GET['domain'])) {
     if (empty($_GET['domain'])) {
@@ -200,7 +200,7 @@ if ($_SESSION['user'] == 'admin') {
         unset($_SESSION['error_msg']);
         unset($_SESSION['error_msg']);
         unset($_SESSION['ok_msg']);
         unset($_SESSION['ok_msg']);
     }
     }
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/edit/mail/index.php

@@ -14,7 +14,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     // Check user argument?
     // Check user argument?
     if (empty($_GET['domain'])) {
     if (empty($_GET['domain'])) {
@@ -364,7 +364,7 @@ if ($_SESSION['user'] == 'admin') {
         unset($_SESSION['error_msg']);
         unset($_SESSION['error_msg']);
         unset($_SESSION['ok_msg']);
         unset($_SESSION['ok_msg']);
     }
     }
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/edit/web/index.php

@@ -14,7 +14,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Are you admin?
 // Are you admin?
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     // Check user argument?
     // Check user argument?
     if (empty($_GET['domain'])) {
     if (empty($_GET['domain'])) {
@@ -513,7 +513,7 @@ if ($_SESSION['user'] == 'admin') {
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_web.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_web.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);
     unset($_SESSION['ok_msg']);
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 2 - 2
web/list/backup/index.php

@@ -12,7 +12,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Data
 // Data
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     exec (VESTA_CMD."v_list_user_backups $user json", $output, $return_var);
     exec (VESTA_CMD."v_list_user_backups $user json", $output, $return_var);
     check_error($return_var);
     check_error($return_var);
@@ -22,7 +22,7 @@ if ($_SESSION['user'] == 'admin') {
 
 
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_backup.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_backup.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 11 - 0
web/list/cron/index.php

@@ -22,6 +22,17 @@ if ($_SESSION['user'] == 'admin') {
 
 
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_cron.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_cron.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_cron.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_cron.html');
+} else {
+
+    exec (VESTA_CMD."v_list_cron_jobs $user json", $output, $return_var);
+    check_error($return_var);
+    $data = json_decode(implode('', $output), true);
+    $data = array_reverse($data);
+    unset($output);
+
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_cron.html');
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_cron.html');
+
 }
 }
 
 
 // Footer
 // Footer

+ 10 - 0
web/list/db/index.php

@@ -22,6 +22,16 @@ if ($_SESSION['user'] == 'admin') {
 
 
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_db.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_db.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_db.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_db.html');
+} else {
+
+    exec (VESTA_CMD."v_list_databases $user json", $output, $return_var);
+    check_error($return_var);
+    $data = json_decode(implode('', $output), true);
+    $data = array_reverse($data);
+    unset($output);
+
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_db.html');
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_db.html');
 }
 }
 
 
 // Footer
 // Footer

+ 21 - 0
web/list/dns/index.php

@@ -32,6 +32,27 @@ if ($_SESSION['user'] == 'admin') {
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_dns_rec.html');
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_dns_rec.html');
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns_rec.html');
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns_rec.html');
     }
     }
+} else {
+
+    if (empty($_GET['domain'])){
+        exec (VESTA_CMD."v_list_dns_domains $user json", $output, $return_var);
+        check_error($return_var);
+        $data = json_decode(implode('', $output), true);
+        $data = array_reverse($data);
+        unset($output);
+
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_dns.html');
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns.html');
+    } else {
+        exec (VESTA_CMD."v_list_dns_domain_records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
+        check_error($return_var);
+        $data = json_decode(implode('', $output), true);
+        $data = array_reverse($data);
+        unset($output);
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_dns_rec.html');
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns_rec.html');
+    }
+
 }
 }
 
 
 // Footer
 // Footer

+ 21 - 0
web/list/mail/index.php

@@ -32,6 +32,27 @@ if ($_SESSION['user'] == 'admin') {
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_mail_acc.html');
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_mail_acc.html');
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html');
         include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html');
     }
     }
+} else {
+
+    if (empty($_GET['domain'])){
+        exec (VESTA_CMD."v_list_mail_domains $user json", $output, $return_var);
+        check_error($return_var);
+        $data = json_decode(implode('', $output), true);
+        $data = array_reverse($data);
+        unset($output);
+
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_mail.html');
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail.html');
+    } else {
+        exec (VESTA_CMD."v_list_mail_accounts '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
+        check_error($return_var);
+        $data = json_decode(implode('', $output), true);
+        $data = array_reverse($data);
+        unset($output);
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_mail_acc.html');
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail_acc.html');
+    }
+
 }
 }
 
 
 // Footer
 // Footer

+ 2 - 2
web/list/stats/index.php

@@ -12,7 +12,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Data
 // Data
-if ($_SESSION['user'] == 'admin') {
+//if ($_SESSION['user'] == 'admin') {
 
 
     exec (VESTA_CMD."v_list_user_stats $user json", $output, $return_var);
     exec (VESTA_CMD."v_list_user_stats $user json", $output, $return_var);
     check_error($return_var);
     check_error($return_var);
@@ -22,7 +22,7 @@ if ($_SESSION['user'] == 'admin') {
 
 
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_stats.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_stats.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_stats.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_stats.html');
-}
+//}
 
 
 // Footer
 // Footer
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 9 - 0
web/list/web/index.php

@@ -22,6 +22,15 @@ if ($_SESSION['user'] == 'admin') {
 
 
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_web.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_web.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_web.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_web.html');
+} else {
+    exec (VESTA_CMD."v_list_web_domains $user json", $output, $return_var);
+    check_error($return_var);
+    $data = json_decode(implode('', $output), true);
+    $data = array_reverse($data);
+    unset($output);
+
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_web.html');
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_web.html');
 }
 }
 
 
 // Footer
 // Footer

+ 48 - 0
web/templates/user/edit_user.html

@@ -0,0 +1,48 @@
+<script type="text/javascript">
+function randomString() {
+var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
+var string_length = 10;
+var randomstring = '';
+for (var i=0; i<string_length; i++) {
+  var rnum = Math.floor(Math.random() * chars.length);
+  randomstring += chars.substring(rnum,rnum+1);
+}
+document.v_edit_user.v_password.value = randomstring;
+}
+</script>
+<table class='data'>
+<tr class="data-add">
+    <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
+        <table class="data-col1">
+            <tr><td style="padding: 24px 0 2px 4px;"><a class="data-date" ?><?php echo date("d M Y", strtotime($v_date))?></a></td></tr>
+            <tr><td style="padding: 0 0 6px 4px;"><a class="data-date" ?><?php echo $v_time?></a></td></tr>
+            <tr><td style="padding: 0 0 0 21px;" class="data-<?php echo $v_status ?>"><b><?php echo $v_status ?></b></td></tr>
+        </table>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+        </tr></table>
+        <form method="post" name="v_edit_user">
+        <table class="data-col2" width="830px">
+            <tr><td class="add-text" style="padding: 10 0 0 2px;">Username</td></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_user" <?php if (!empty($v_username)) echo "value=".$v_username;  ?> disabled> <input type="hidden" name="v_username" <?php if (!empty($v_username)) echo "value=".$v_username;  ?>></tr>
+            <tr><td class="add-text" style="padding: 10px 0 0 2px;">
+                Password <a href="javascript:randomString();" class="genpass">generate</a></td></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_password" <?php if (!empty($v_password)) echo "value=".$v_password;  ?>></tr>
+            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Email</td></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_email" <?php if (!empty($v_email)) echo "value=".$v_email; ?>></tr>
+            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Name Servers </td></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_ns1" <?php if (!empty($v_ns1)) echo "value=".$v_ns1; ?>></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_ns2" <?php if (!empty($v_ns2)) echo "value=".$v_ns2; ?>></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_ns3" <?php if (!empty($v_ns3)) echo "value=".$v_ns3; ?>></tr>
+            <tr><td><input type="text" size="20" class="add-input" name="v_ns4" <?php if (!empty($v_ns4)) echo "value=".$v_ns4; ?>></tr>
+            <tr><td style="padding: 24px 0 0 0;">
+                <input type="submit" class="add-button" name="save" value="Save">
+                </form>
+                <input type="button" class="add-button" value="Cancel" onClick="location.href='/list/user/'">
+            </td></tr>
+        </table>
+    </td>
+</tr>
+</table>

+ 126 - 0
web/templates/user/list_cron.html

@@ -0,0 +1,126 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend';
+    }
+
+    if (empty($data[$key]['CATCHALL'])) {
+        $data[$key]['CATCHALL'] = 'null';
+    }
+    ?>
+
+<tr class="data-row">
+    <script type="text/javascript">
+    $(function(){
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/cron/?job=<?php echo $data[$key]['JOB']; ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+    </script>
+    <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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/cron/?job=<?php echo $data[$key]['JOB'] ?>"> edit</a></td>
+            <td class="data-controls" width="70px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
+                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete cron job?</p>
+                </div>
+            </td>
+        </tr></table>
+
+        <table class="data-col2" width="800px">
+            <tr><td colspan=5 class="cron" style="padding: 0 0 0 4px;"><b><?php echo $data[$key]['CMD'] ?></b></td></tr>
+            <tr>
+                <td style="vertical-align:top;"  width="80px">
+                    <table>
+                        <tr><td class="cron-counter-name">Min</td></tr>
+                        <tr><td class="cron-counter-value"><?php echo $data[$key]['MIN'] ?></tr>
+                    </table>
+                </td>
+                <td style="vertical-align:top;"  width="80px">
+                    <table>
+                        <tr><td class="cron-counter-name">Hour</td></tr>
+                        <tr><td class="cron-counter-value"><?php echo $data[$key]['HOUR'] ?></tr>
+                    </table>
+                </td>
+
+                <td style="vertical-align:top;"  width="80px">
+                    <table>
+                        <tr><td class="cron-counter-name">Day</td></tr>
+                        <tr><td class="cron-counter-value"><?php echo $data[$key]['DAY'] ?></tr>
+                    </table>
+                </td>
+
+                <td style="vertical-align:top;"  width="80px">
+                    <table>
+                        <tr><td class="cron-counter-name">Month</td></tr>
+                        <tr><td class="cron-counter-value"><?php echo $data[$key]['MONTH'] ?></tr>
+                    </table>
+                </td>
+
+                <td style="vertical-align:top;">
+                    <table>
+                        <tr><td class="cron-counter-name">Day of Week</td></tr>
+                        <tr><td class="cron-counter-value"><?php echo $data[$key]['WDAY'] ?></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 cron job ";
+        } else {
+            echo "$i cron jobs ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:172px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:55px\"><tr><td></td></tr></table>"; ?>

+ 111 - 0
web/templates/user/list_db.html

@@ -0,0 +1,111 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+    }
+
+    if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$_SERVER["HTTP_HOST"]."/phpMyAdmin/";
+    if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$_SERVER["HTTP_HOST"]."/phpPgAdmin/";
+    ?>
+
+
+<tr class="data-row">
+    <script type="text/javascript">
+    $(function(){
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/db/?database=<?php echo "$key" ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+    </script>
+    <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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="120px"><img src="/images/new_window.png" width="8px" height="8px"> <a href="<?php echo $db_admin_link; ?>" target="_blank"> open web admin</a></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/db/?database=<?php echo $key ?>"> edit</a></td>
+            <td class="data-controls" width="70px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
+                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> database?</p>
+                </div>
+            </td>
+        </tr></table>
+
+        <table class="data-col2" width="830px">
+            <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b></td></tr>
+            <tr>
+                <td style="vertical-align:top;" >
+                    <table>
+                        <tr><td class="counter-name" style="padding: 2px 0 4px 2px">[<?php echo $data[$key]['TYPE'] ?>] database</td></tr>
+                        <tr><td class="chart1" style="padding: 0px 0 0px 2px">Disk: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
+                            <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                    </table>
+                </td>
+                <td style="vertical-align:top;" width="250">
+                    <table>
+                        <tr><td class="counter-name">User: </td><td class="counter-value"><?php echo $data[$key]['DBUSER'] ?></td></tr>
+                        <tr><td class="counter-name">Host: </td><td class="counter-value"><?php echo $data[$key]['HOST'] ?></td></tr>
+                    </table>
+                </td>
+                <td rowspan=4 style="vertical-align:top;" width="300">
+                    <table>
+                        <tr><td class="counter-name">Charset:</td><td class="counter-value"><?php echo $data[$key]['CHARSET'] ?></td></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 database ";
+        } else {
+            echo "$i databases ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:166px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:43px\"><tr><td></td></tr></table>"; ?>

+ 108 - 0
web/templates/user/list_dns.html

@@ -0,0 +1,108 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+    }
+    ?>
+<script type="text/javascript">
+    $(function(){
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/dns/?domain=<?php echo "$key" ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+</script>
+
+<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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="96px"><img src="/images/more.png" width="8px" height="8px"><a href="/list/dns/?domain=<?php echo $key ?>"> list records</a></td>
+            <td class="data-controls" width="92px"><img src="/images/add.png" width="8px" height="8px"><a href="/add/dns/?domain=<?php echo $key ?>"> add record</a></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/dns/?domain=<?php echo $key ?>"> edit</a></td>
+            <td class="data-controls" width="70px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
+                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
+                </div>
+            </td>
+        </tr></table>
+        <table class="data-col2" width="830px">
+            <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b></td></tr>
+            <tr>
+                <td style="vertical-align:top;" >
+                    <table>
+                        <tr><td class="counter-name" style="padding: 2px 0 0 2px;"><?php echo $data[$key]['IP'] ?></td>
+                        <tr><td class="counter-name" style="padding: 0 0 20px 2px">[<?php echo $data[$key]['TPL'] ?>] template</td></tr>
+                    </table>
+                </td>
+                <td style="vertical-align:top;" width="250">
+                    <table>
+                        <tr><td class="counter-name">SOA:</td><td class="counter-value"><?php echo $data[$key]['SOA'] ?></td></tr>
+                        <tr><td class="counter-name">TTL:</td><td class="counter-value"><?php echo $data[$key]['TTL'] ?></td></tr>
+                    </table>
+                </td>
+                <td rowspan=4 style="vertical-align:top;" width="300">
+                    <table>
+                        <tr><td class="counter-name">Expire:</td><td class="counter-value"><?php echo $data[$key]['EXP'] ?></td></tr>
+                        <tr><td class="counter-name">Records:</td><td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 user dns domain ";
+        } else {
+            echo "$i dns domains ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:157px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:25px\"><tr><td></td></tr></table>"; ?>

+ 93 - 0
web/templates/user/list_dns_rec.html

@@ -0,0 +1,93 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+    }
+    ?>
+<script type="text/javascript">
+    $(function(){
+
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+</script>
+
+<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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"> edit</a></td>
+            <td class="data-controls" width="87px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo "$i" ?>"> delete</a>
+                <div id="delete_dialog_<?php echo "$i" ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete <span style="color: #34536A;"><b><?php echo $data[$key]['RECORD'] ?></b></span> record?</p>
+                </div>
+            </td>
+
+        </tr></table>
+
+        <table class="data-col5" width="780px">
+            <tr>
+                <td class="log" style="padding: 0 0 0 4px;" width="200"><b><?php echo $data[$key]['RECORD'] ?></b></td>
+                <td class="log-counter-value" width="80"><?php echo $data[$key]['TYPE'] ?></td>
+                <td class="log-counter-value" width="80"><?php echo $data[$key]['PRIORITY'] ?></td>
+                <td class="log-counter-value" ><?php echo $data[$key]['VALUE'] ?></td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<table class="data-count">
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 dns record ";
+        } else {
+            echo "$i dns records ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:196px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:103px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 3) echo "<table class=\"data-spacer\" style=\"height:10px\"><tr><td></td></tr></table>"; ?>

+ 114 - 0
web/templates/user/list_mail.html

@@ -0,0 +1,114 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+    }
+
+    if (empty($data[$key]['CATCHALL'])) {
+        $data[$key]['CATCHALL'] = '/dev/null';
+    }
+    ?>
+<script type="text/javascript">
+    $(function(){
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/mail/?domain=<?php echo "$key" ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+</script>
+
+<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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="100px"><img src="/images/more.png" width="8px" height="8px"><a href="?domain=<?php echo $key ?>"> list accounts</a></td>
+            <td class="data-controls" width="98px"><img src="/images/add.png" width="8px" height="8px"><a href="/add/mail/?domain=<?php echo $key ?>"> add account</a></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/mail/?domain=<?php echo $key ?>"> edit</a></td>
+            <td class="data-controls" width="70px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
+                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
+                </div>
+            </td>
+        </tr></table>
+
+        <table class="data-col2" width="830px">
+            <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b></td></tr>
+            <tr>
+                <td style="vertical-align:top;" >
+                    <table>
+                        <tr><td class="counter-name" style="padding: 2px 0 2px 0">catchall > <?php echo $data[$key]['CATCHALL'] ?></td></tr>
+                        <tr><td class="chart1">Disk: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
+                            <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                    </table>
+                </td>
+                <td style="vertical-align:top;" width="250">
+                    <table>
+                        <tr><td class="counter-name">Antivirus:</td><td class="counter-value"><?php echo $data[$key]['ANTIVIRUS'] ?></td></tr>
+                        <tr><td class="counter-name">Antispam:</td><td class="counter-value"><?php echo $data[$key]['ANTISPAM'] ?></td></tr>
+
+                    </table>
+                </td>
+                <td rowspan=4 style="vertical-align:top;" width="300">
+                    <table>
+                        <tr><td class="counter-name">DKIM:</td><td class="counter-value"><?php echo $data[$key]['DKIM'] ?></td></tr>
+                        <tr><td class="counter-name">Accounts:</td><td class="counter-value"><?php echo $data[$key]['ACCOUNTS'] ?></td></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 mail domain ";
+        } else {
+            echo "$i mail domains ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:166px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:43px\"><tr><td></td></tr></table>"; ?>

+ 106 - 0
web/templates/user/list_mail_acc.html

@@ -0,0 +1,106 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend';
+    }
+    ?>
+<script type="text/javascript">
+    $(function(){
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+</script>
+
+<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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>"> edit</a></td>
+            <td class="data-controls" width="70px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo "$i" ?>"> delete</a>
+                <div id="delete_dialog_<?php echo "$i" ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete <b><?php echo $key ?></b> account?</p>
+                </div>
+            </td>
+        </tr></table>
+
+        <table class="data-col2" width="830px">
+            <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b> <a class="aliases" style="padding: 0 20px 0 4px"><?php echo str_replace(',', ', ', $data[$key]['ALIAS']) ?></a></td></tr>
+            <tr>
+                <td style="vertical-align:top;" >
+                    <table>
+                        <tr><td class="counter-name" style="padding: 4px 0 0 0;"><?php echo $data[$key]['IP'] ?></td>
+                        <tr><td class="chart1" style="padding: 0 0 2px 0">Disk: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
+                            <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                    </table>
+                </td>
+                <td style="vertical-align:top;" width="200">
+                    <table>
+                        <tr><td class="counter-name">Quota:</td><td class="counter-value"><?php echo $data[$key]['QUOTA'] ?></td></tr>
+                        <tr><td class="counter-name">Autoreply:</td><td class="counter-value"><?php echo $data[$key]['AUTOREPLY'] ?></td></tr>
+                    </table>
+                </td>
+                <td rowspan=4 style="vertical-align:top;" width="350">
+                    <table width="350">
+                        <tr><td class="counter-name">Forward:</td><td class="counter-value" style="padding: 0 0 0 8px;" ><?php echo str_replace(',', ', ', $data[$key]['FWD']) ?></td></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 mail account ";
+        } else {
+            echo "$i mail accounts ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:173px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:57px\"><tr><td></td></tr></table>"; ?>

+ 150 - 0
web/templates/user/list_user.html

@@ -0,0 +1,150 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+    }
+    ?>
+<script type="text/javascript">
+    $(function(){
+        $('#<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/<?php echo $spnd_action ?>/user/?user=<?php echo "$key" ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#<?php echo $spnd_action ?>_link_<?php echo "$i" ?>').click(function(){
+            $('#<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/user/?user=<?php echo "$key" ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+    });
+</script>
+<tr class="data-row">
+    <td class="data-dotted" style="padding: 0px 10px 0px 0px">
+        <table class="data-col1">
+            <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object"></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']))?></a></td></tr>
+            <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></b></td></tr>
+        </table>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/user/?user=<?php echo "$key" ?>"> edit</a></td>
+        </tr></table>
+
+        <table class="data-col2" width="830px">
+            <tr><td colspan=3 class="username" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b><a class="fullname"><?php echo $data[$key]['FNAME']?> <?php echo $data[$key]['LNAME']?></a></td></tr>
+            <td style="vertical-align:top;"  width="240">
+                <table>
+                    <tr><td colspan=2 class="counter-name"  style="padding: 2px 0 0 2px;"><?php echo $data[$key]['CONTACT']?></td></tr>
+                    <tr><td colspan=2 class="counter-name"  style="padding: 0 0 18px 2px;">[<?php echo $data[$key]['PACKAGE']?>] package</td></tr>
+                    <tr><td class="chart1" colspan=2 style="padding: 0 0 0 3px;">Bandwidth: <?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>% (<?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>)
+                        <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                    <tr><td class="chart1" colspan=2 style="padding: 0 0 0 3px;">Disk: <?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>% (<?php echo humanize_usage($data[$key]['U_DISK']) ?>)
+                        <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                    <tr><td colspan=2>
+                        <table class="chart2"><tr>
+                            <td>
+                                Web: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
+                                Mail: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
+                            </td><td style="padding: 0px 10px 0px 8px">
+                                Databases: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?><br>
+                                User Dirs: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?><br>
+                            </td>
+                        </tr></table></td>
+                    </tr>
+                </table>
+            </td>
+            <td style="vertical-align:top;" width="320">
+                <table width="300">
+                    <tr><td class="counter-name" width="37%">Web Domains:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_WEB_DOMAINS'] ?> / <?php echo $data[$key]['WEB_DOMAINS'] ?></td></tr>
+                    <tr><td class="counter-name">Web SSL:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_WEB_SSL'] ?></td></tr>
+                    <tr><td class="counter-name">Web Aliases:</td>
+                    <td class="counter-value"><?php echo $data[$key]['WEB_ALIASES'] ?> per domain</td></tr>
+                    <tr><td class="counter-name">Web Templates:</td>
+                    <td class="counter-value"><?php echo str_replace(',', ', ',$data[$key]['WEB_TPL']) ?></td></tr>
+                    <tr><td class="counter-name">Dns Domains:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_DNS_DOMAINS'] ?> / <?php echo $data[$key]['DNS_DOMAINS'] ?></td></tr>
+                    <tr><td class="counter-name">Dns Records:</td>
+                    <td class="counter-value"><?php echo $data[$key]['DNS_RECORDS'] ?> per domain</td></tr>
+                    <tr><td class="counter-name">Name Servers:<br></td>
+                    <td class="counter-value"><?php echo str_replace(',', ', ',$data[$key]['NS']) ?></td></tr>
+                </table></td>
+            <td style="vertical-align:top;">
+                <table class="data-col4">
+                    <tr><td class="counter-name">Mail Domains:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_MAIL_DOMAINS'] ?> / <?php echo $data[$key]['MAIL_DOMAINS'] ?></td></tr>
+                    <tr><td class="counter-name">Mail Accounts:</td>
+                    <td class="counter-value"><?php echo $data[$key]['MAIL_ACCOUNTS'] ?> per domain</td></tr>
+                    <tr><td class="counter-name">Databases:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_DATABASES'] ?> / <?php echo $data[$key]['DATABASES'] ?></td></tr>
+                    <tr><td class="counter-name">Cron Jobs:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_CRON_JOBS'] ?> / <?php echo $data[$key]['CRON_JOBS'] ?></td></tr>
+                    <tr><td class="counter-name">Shell:</td>
+                    <td class="counter-value"><?php echo $data[$key]['SHELL'] ?></td></tr>
+                    <tr><td class="counter-name">Dedicated IP:</td>
+                    <td class="counter-value"><?php echo $data[$key]['IP_OWNED'] ?></td></tr>
+                    <tr><td class="counter-name">Backups:</td>
+                    <td class="counter-value"><?php echo $data[$key]['U_BACKUPS'] ?> / <?php echo $data[$key]['BACKUPS'] ?></td></tr>
+                </table>
+            </td>
+        </tr>
+        </table>
+    </td>
+</tr>
+
+    <?php
+}
+?>
+
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 user account ";
+        } else {
+            echo "$i user accounts ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:70px\"><tr><td></td></tr></table>"; ?>

+ 134 - 0
web/templates/user/list_web.html

@@ -0,0 +1,134 @@
+<table class='data'>
+
+<?php
+foreach ($data as $key => $value) {
+    ++$i;
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+    } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+    }
+
+    if (!empty($data[$key]['SSL_HOME'])) {
+        if ($data[$key]['SSL_HOME'] == 'same') {
+            $ssl_home = 'public_html';
+        } else {
+            $ssl_home = 'public_shtml';
+        }
+    } else {
+        $ssl_home = '';
+    }
+    if (strlen($data[$key]['NGINX_EXT']) > 16 ) {
+        $nginx_ext = substr($data[$key]['NGINX_EXT'], 0, 16);
+        $nginx_ext = trim($nginx_ext, ",");
+        $nginx_ext = str_replace(',', ', ', $nginx_ext);
+        $nginx_ext = $nginx_ext.", ...";
+    } else {
+        $nginx_ext = str_replace(',', ', ', $data[$key]['NGINX_EXT']);
+    }
+
+    ?>
+<script type="text/javascript">
+    $(function(){
+        $('#delete_dialog_<?php echo "$i" ?>').dialog({
+            modal: true,
+            autoOpen: false,
+            width: 360,
+            buttons: {
+                "Ok": function(event, ui) {
+                     location.href = '/delete/web/?domain=<?php echo "$key" ?>';
+                },
+                "Cancel": function() {
+                    $(this).dialog("close");
+                }
+            }
+        });
+        $('#delete_link_<?php echo "$i" ?>').click(function(){
+            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+            return false;
+        });
+
+    });
+</script>
+
+<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><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>
+    </td>
+    <td class="data-dotted" width="830px" style="vertical-align:top;">
+        <table width="830px"><tr>
+            <td></td>
+            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/web/?domain=<?php echo "$key" ?>"> edit</a></td>
+            <td class="data-controls" width="70px">
+                <img src="/images/delete.png" width="7px" height="7px">
+                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
+                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
+                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
+                </div>
+            </td>
+        </tr></table>
+
+        <table class="data-col2" width="830px">
+            <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b> <a class="aliases" style="padding: 0 30px 0 8px"><?php echo str_replace(',', ', ', $data[$key]['ALIAS']) ?></a></td></tr>
+            <tr>
+                <td style="vertical-align:top;" >
+                    <table>
+                        <tr><td class="counter-name" style="padding: 2px 0 0 2px;"><?php echo $data[$key]['IP'] ?></td>
+                        <tr><td class="counter-name" style="padding: 0 0 8px 2px">[<?php echo $data[$key]['TPL'] ?>] template</td></tr>
+                        <tr><td class="chart1" style="padding: 0 0 0 2px">Bandwidth: <?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>
+                            <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$panel[$user]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                        <tr><td class="chart1" style="padding: 0 0 0 2px">Disk: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
+                            <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
+                    </table>
+                </td>
+                <td style="vertical-align:top;" width="250">
+                    <table>
+                        <tr><td class="counter-name">PHP Type:</td><td class="counter-value"><?php echo $data[$key]['PHP'] ?></td></tr>
+                        <tr><td class="counter-name">CGI Support:</td><td class="counter-value"><?php echo $data[$key]['CGI'] ?></td></tr>
+                        <tr><td class="counter-name">Error Log:</td><td class="counter-value"><?php echo $data[$key]['ELOG'] ?></td></tr>
+                        <tr><td class="counter-name">Web Statistics:</td><td class="counter-value"><?php echo $data[$key]['STATS'] ?></td></tr>
+                        <tr><td class="counter-name">Statistics Auth:</td><td class="counter-value"><?php echo $data[$key]['STATS_AUTH'] ?></td></tr>
+                    </table>
+                </td>
+                <td rowspan=4 style="vertical-align:top;" width="300">
+                    <table width="300">
+                        <tr><td class="counter-name" width="40%">SSL Support:</td><td class="counter-value"><?php echo $data[$key]['SSL'] ?></td></tr>
+                        <tr><td class="counter-name">SSL Home:</td><td class="counter-value"><?php echo $ssl_home ?></td></tr>
+                        <tr><td class="counter-name">Nginx Template:</td><td class="counter-value"><?php echo $data[$key]['NGINX'] ?></td></tr>
+                        <tr><td class="counter-name">Nginx Extentions:</td><td class="counter-value"><?php echo $nginx_ext ?></td></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+    </td>
+</tr>
+
+
+    <?php
+}
+?>
+</table>
+<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
+<table class="data-count">
+<tr>
+    <td>→ 
+    <?php
+        if ( $i == 1) {
+            echo "1 web domain ";
+        } else {
+            echo "$i web domains ";
+        }
+    ?>
+    </td>
+</tr>
+</table>
+</form>
+<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:113px\"><tr><td></td></tr></table>"; ?>

+ 15 - 0
web/templates/user/menu_cron.html

@@ -0,0 +1,15 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/cron/'">Add Job</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 15 - 0
web/templates/user/menu_db.html

@@ -0,0 +1,15 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/db/'">Add Database</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 16 - 0
web/templates/user/menu_dns.html

@@ -0,0 +1,16 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/dns/'">Add Domain</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>update counters</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 15 - 0
web/templates/user/menu_dns_rec.html

@@ -0,0 +1,15 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'">Add Record</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 16 - 0
web/templates/user/menu_mail.html

@@ -0,0 +1,16 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/mail/'">Add Domain</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>update counters</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 15 - 0
web/templates/user/menu_mail_acc.html

@@ -0,0 +1,15 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'">Add Account</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 10 - 0
web/templates/user/menu_user.html

@@ -0,0 +1,10 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/web/'">Add Domain</button>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 16 - 0
web/templates/user/menu_web.html

@@ -0,0 +1,16 @@
+<table class="sub-menu">
+<tr>
+    <td width="142px" style="padding: 16px 0 16px 6px">
+    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/web/'">Add Domain</button>
+    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+    <select style="margin:0 0 0 0px">
+        <option>apply to selected</option>
+        <option>update counters</option>
+        <option>delete</option>
+    </select> <button> > </button></td>
+</td>
+    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
+</tr><tr>
+</tr>
+</table>
+<form id="vstobjects">

+ 44 - 0
web/templates/user/panel.html

@@ -0,0 +1,44 @@
+<table class="main"><tr><td>
+<table class="top">
+<tr>
+    <td width="196px"><p class="hostname"><?php echo exec('hostname') ?></p></td>
+    <td width="76px"><b><a class="top-<?php if($TAB == 'STATS' ) echo 's' ?>link" href="/list/stats/">Statistics</a></b></td>
+    <td width="90px"><b><a class="top-<?php if($TAB == 'LOG' ) echo 's' ?>link" href="/list/log/">History Log</a></b></td>
+    <td></td>
+    <td width="260px"><b><?php if($user != $_SESSION['user']) echo 'admin / ' ?><?php echo $user ?></b><a class="top-link" style="padding: 0 0 0 6" href="/logout/">Log out</a></td>
+</tr>
+</table>
+<table class="nav">
+<tr>
+    <td style="padding: 34px 30px 0px 26px;">
+        <img src="/images/logo.png" width="124px" height="46px">
+    </td>
+    <td><div id="nav-block"><ul>
+        <li><b><a class="nav-<?php if($TAB == 'USER' ) echo 's' ?>link" href="/list/user/">USER</b></a><p class="counters">
+            users: <? echo $panel[$user]['U_USERS'] ?><br>
+            suspended: <? echo $panel[$user]['SUSPENDED_USERS']?></p></li>
+        <li><b><a class="nav-<?php if($TAB == 'WEB' ) echo 's' ?>link" href="/list/web/">WEB</a></b><p class="counters">
+            domains: <? echo $panel[$user]['U_WEB_DOMAINS']?><br>
+            aliases: <? echo $panel[$user]['U_WEB_ALIASES']?><br>
+            webssl: <? echo $panel[$user]['U_WEB_SSL']?><br>
+            suspended: <? echo $panel[$user]['SUSPENDED_WEB']?></p></li>
+        <li><b><a class="nav-<?php if($TAB == 'DNS' ) echo 's' ?>link" href="/list/dns/">DNS</a></b><p class="counters">
+            domains: <? echo $panel[$user]['U_DNS_DOMAINS']?><br>
+            records: <? echo $panel[$user]['U_DNS_RECORDS']?><br>
+            suspended: <? echo $panel[$user]['SUSPENDED_DNS']?></p></li>
+        <li><b><a class="nav-<?php if($TAB == 'MAIL' ) echo 's' ?>link" href="/list/mail/">MAIL</a></b><p class="counters">
+            domains: <? echo $panel[$user]['U_MAIL_DOMAINS']?><br>
+            dkim: <? echo $panel[$user]['U_MAIL_DKIM']?><br>
+            accounts: <? echo $panel[$user]['U_MAIL_ACCOUNTS']?><br>
+            suspended: <? echo $panel[$user]['SUSPENDED_MAIL']?></p></li>
+        <li><b><a class="nav-<?php if($TAB == 'DB' ) echo 's' ?>link" href="/list/db/">DB</a></b><p class="counters">
+            databases: <? echo $panel[$user]['U_DATABASES']?><br>
+            suspended: <? echo $panel[$user]['SUSPENDED_DB']?></p></li>
+        <li><b><a class="nav-<?php if($TAB == 'CRON' ) echo 's' ?>link" href="/list/cron/">CRON</a></b><p class="counters">
+            jobs: <? echo $panel[$user]['U_CRON_JOBS']?><br>
+            suspended: <? echo $panel[$user]['SUSPENDED_CRON']?></p></li>
+        <li><b><a class="nav-<?php if($TAB == 'BACKUP' ) echo 's' ?>link" href="/list/backup/">BACKUP</a></a></b><p class="counters">
+            backups: <? echo $panel[$user]['U_BACKUPS']?><br>
+    <ul></div></td>
+</tr>
+</table>