فهرست منبع

added admin search

Serghey Rodin 13 سال پیش
والد
کامیت
f685d8d333
76فایلهای تغییر یافته به همراه871 افزوده شده و 114 حذف شده
  1. 145 0
      bin/v_search_object
  2. 11 1
      web/delete/backup/index.php
  3. 11 1
      web/delete/cron/index.php
  4. 11 1
      web/delete/db/index.php
  5. 21 3
      web/delete/dns/index.php
  6. 6 0
      web/delete/ip/index.php
  7. 21 1
      web/delete/mail/index.php
  8. 6 0
      web/delete/package/index.php
  9. 6 0
      web/delete/user/index.php
  10. 11 0
      web/delete/web/index.php
  11. 5 3
      web/edit/db/index.php
  12. 5 3
      web/edit/dns/index.php
  13. 5 3
      web/edit/mail/index.php
  14. 6 2
      web/edit/web/index.php
  15. 29 6
      web/search/index.php
  16. 9 0
      web/suspend/cron/index.php
  17. 10 0
      web/suspend/db/index.php
  18. 21 0
      web/suspend/dns/index.php
  19. 20 0
      web/suspend/mail/index.php
  20. 6 0
      web/suspend/user/index.php
  21. 10 0
      web/suspend/web/index.php
  22. 10 2
      web/templates/admin/add_cron.html
  23. 10 2
      web/templates/admin/add_db.html
  24. 10 2
      web/templates/admin/add_dns.html
  25. 10 2
      web/templates/admin/add_dns_rec.html
  26. 10 2
      web/templates/admin/add_ip.html
  27. 10 2
      web/templates/admin/add_mail.html
  28. 10 2
      web/templates/admin/add_mail_acc.html
  29. 10 2
      web/templates/admin/add_package.html
  30. 10 2
      web/templates/admin/add_user.html
  31. 10 2
      web/templates/admin/add_web.html
  32. 10 2
      web/templates/admin/edit_cron.html
  33. 10 2
      web/templates/admin/edit_db.html
  34. 10 2
      web/templates/admin/edit_dns.html
  35. 10 2
      web/templates/admin/edit_dns_rec.html
  36. 10 2
      web/templates/admin/edit_ip.html
  37. 10 2
      web/templates/admin/edit_mail.html
  38. 10 2
      web/templates/admin/edit_mail_acc.html
  39. 10 2
      web/templates/admin/edit_package.html
  40. 10 2
      web/templates/admin/edit_user.html
  41. 10 2
      web/templates/admin/edit_web.html
  42. 1 1
      web/templates/admin/list_backup.html
  43. 1 1
      web/templates/admin/list_cron.html
  44. 1 1
      web/templates/admin/list_db.html
  45. 1 1
      web/templates/admin/list_dns.html
  46. 1 1
      web/templates/admin/list_dns_rec.html
  47. 1 1
      web/templates/admin/list_ip.html
  48. 2 2
      web/templates/admin/list_log.html
  49. 1 1
      web/templates/admin/list_mail.html
  50. 1 1
      web/templates/admin/list_mail_acc.html
  51. 1 1
      web/templates/admin/list_packages.html
  52. 5 6
      web/templates/admin/list_rrd.html
  53. 137 0
      web/templates/admin/list_search.html
  54. 4 6
      web/templates/admin/list_stats.html
  55. 1 1
      web/templates/admin/list_user.html
  56. 1 1
      web/templates/admin/list_web.html
  57. 8 7
      web/templates/header.html
  58. 10 2
      web/templates/user/add_dns.html
  59. 10 2
      web/templates/user/add_web.html
  60. 10 2
      web/templates/user/edit_dns.html
  61. 10 2
      web/templates/user/edit_user.html
  62. 10 2
      web/templates/user/edit_web.html
  63. 1 1
      web/templates/user/list_cron.html
  64. 1 1
      web/templates/user/list_db.html
  65. 1 1
      web/templates/user/list_dns.html
  66. 1 1
      web/templates/user/list_dns_rec.html
  67. 1 1
      web/templates/user/list_mail.html
  68. 1 1
      web/templates/user/list_mail_acc.html
  69. 1 1
      web/templates/user/list_user.html
  70. 1 1
      web/templates/user/list_web.html
  71. 9 0
      web/unsuspend/cron/index.php
  72. 9 0
      web/unsuspend/db/index.php
  73. 19 0
      web/unsuspend/dns/index.php
  74. 19 0
      web/unsuspend/mail/index.php
  75. 6 0
      web/unsuspend/user/index.php
  76. 9 0
      web/unsuspend/web/index.php

+ 145 - 0
bin/v_search_object

@@ -0,0 +1,145 @@
+#!/bin/bash
+# info: search objects
+# options: object [format]
+#
+# The function that allows to find system objects.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument defenition
+object=$1
+format=${2-shell}
+
+# Includes
+source $VESTA/conf/vesta.conf
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'object [format]'
+validate_format 'object'
+
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+conf=$(mktemp)
+i=0
+OLD_IFS=$IFS
+IFS=$'\n'
+
+# User loop
+for user in $(ls $VESTA/data/users/); do
+    # Search query
+    search=$(grep "$object" \
+        $VESTA/data/users/$user/web.conf \
+        $VESTA/data/users/$user/dns.conf \
+        $VESTA/data/users/$user/mail.conf \
+        $VESTA/data/users/$user/db.conf)
+    
+    for row in $search; do
+        # Initialise variable
+        key=''
+        result=''
+        dom_alias=''
+        suspended=''
+	object_time=''
+        object_date=''
+
+        # Parsing result
+        type=$(echo $row |cut -f 1 -d : |cut -f 8 -d / |cut -f 1 -d \.)
+        data=$(echo $row |cut -f 2,3,4,5 -d :)
+        eval "$data"
+
+        # Check WEB domain
+        dom_alias=''
+        if [ "$type" = 'web' ]; then
+            if [ -n "$(echo $DOMAIN |grep $object)" ]; then
+                # Check domain alias
+                check_dom_alias="$(echo $ALIAS| tr ',' '\n' |grep $object)"
+                if [ ! -z "$check_dom_alias" ];then
+                    dom_alias=$(echo $check_dom_alias | tr ' ' ',')
+                fi
+                key="DOMAIN"
+                result="$DOMAIN"
+                suspended=$SUSPENDED
+                object_time=$TIME
+                object_date=$DATE
+                ((i ++))
+            fi
+        fi
+
+        # DNS
+        if [ "$type" = 'dns' ]; then
+            if [ -n "$(echo $DOMAIN |grep $object)" ]; then
+                key="DOMAIN"
+                result="$DOMAIN"
+                suspended=$SUSPENDED
+                object_time=$TIME
+                object_date=$DATE
+                ((i ++))
+            fi
+        fi
+
+        # MAIL
+        if [ "$type" = 'mail' ]; then
+            if [ -n "$(echo $DOMAIN |grep $object)" ]; then
+                key="DOMAIN"
+                result="$DOMAIN"
+                suspended=$SUSPENDED
+                object_time=$TIME
+                object_date=$DATE
+                ((i ++))
+            fi
+        fi
+
+        # DB
+        if [ "$type" = 'db' ]; then
+            if [ -n "$(echo $DB |grep $object)" ]; then
+                key="DATABASE"
+                result="$DB"
+                suspended=$SUSPENDED
+                object_time=$TIME
+                object_date=$DATE
+                ((i ++))
+            fi
+        fi
+
+        if [ ! -z "$result" ]; then
+            str="ID='$i' USER='$user' TYPE='$type' KEY='$key'"
+            str="$str RESULT='$result' ALIAS='$dom_alias'"
+            str="$str  SUSPENDED='$suspended' TIME='$object_time'"
+            str="$str DATE='$object_date'"
+            echo $str >> $conf
+        fi
+    done
+done
+IFS=$OLD_IFS
+
+# Defining fileds to select
+fields='$ID $USER $TYPE $KEY $RESULT $ALIAS $SUSPENDED $TIME $DATE'
+
+# Listing domains
+case $format in 
+    json)   json_list ;;
+    plain)  nohead=1; shell_list ;;
+    shell)  fields='$USER $TYPE $KEY $RESULT $ALIAS'; shell_list |column -t;;
+    *)      check_args '2' '0' 'object [format]'
+esac
+
+rm $conf
+
+#----------------------------------------------------------#
+#                       Vesta                              #
+#----------------------------------------------------------#
+
+# Logging
+#log_event "$OK" "$EVENT"
+
+exit

+ 11 - 1
web/delete/backup/index.php

@@ -5,7 +5,11 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-//if ($_SESSION['user'] == 'admin') {
+    // Delete as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=$_GET['user'];
+    }
+
     if (!empty($_GET['backup'])) {
         $v_username = escapeshellarg($user);
         $v_backup = escapeshellarg($_GET['backup']);
@@ -20,4 +24,10 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 //}
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/backup/");
+exit;

+ 11 - 1
web/delete/cron/index.php

@@ -5,7 +5,11 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-//if ($_SESSION['user'] == 'admin') {
+    // Delete as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=$_GET['user'];
+    }
+
     if (!empty($_GET['job'])) {
         $v_username = escapeshellarg($user);
         $v_job = escapeshellarg($_GET['job']);
@@ -20,4 +24,10 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 //}
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/cron/");
+exit;

+ 11 - 1
web/delete/db/index.php

@@ -5,7 +5,11 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-//if ($_SESSION['user'] == 'admin') {
+    // Delete as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=$_GET['user'];
+    }
+
     if (!empty($_GET['database'])) {
         $v_username = escapeshellarg($user);
         $v_database = escapeshellarg($_GET['database']);
@@ -20,4 +24,10 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 //}
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/db/");
+exit;

+ 21 - 3
web/delete/dns/index.php

@@ -5,7 +5,11 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-//if ($_SESSION['user'] == 'admin') {
+    // Delete as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=$_GET['user'];
+    }
+
     // DNS domain
     if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
         $v_username = escapeshellarg($user);
@@ -17,6 +21,11 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/dns/");
         exit;
     }
@@ -33,11 +42,20 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
-
-        unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/dns/?domain=".$_GET['domain']);
         exit;
     }
 //}
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/dns/");
+exit;

+ 6 - 0
web/delete/ip/index.php

@@ -19,4 +19,10 @@ if ($_SESSION['user'] == 'admin') {
 
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/ip/");
+exit;

+ 21 - 1
web/delete/mail/index.php

@@ -5,7 +5,11 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-//if ($_SESSION['user'] == 'admin') {
+    // Delete as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=$_GET['user'];
+    }
+
     // Mail domain
     if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
         $v_username = escapeshellarg($user);
@@ -17,6 +21,11 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/mail/");
         exit;
     }
@@ -33,9 +42,20 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
                 $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/mail/?domain=".$_GET['domain']);
         exit;
     }
 //}
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/mail/");
+exit;

+ 6 - 0
web/delete/package/index.php

@@ -18,4 +18,10 @@ if ($_SESSION['user'] == 'admin') {
     unset($output);
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/package/");
+exit;

+ 6 - 0
web/delete/user/index.php

@@ -18,4 +18,10 @@ if ($_SESSION['user'] == 'admin') {
     unset($output);
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/user/");
+exit;

+ 11 - 0
web/delete/web/index.php

@@ -5,6 +5,11 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
+    // Delete as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=$_GET['user'];
+    }
+
 if (!empty($_GET['domain'])) {
     $v_username = escapeshellarg($user);
     $v_domain = escapeshellarg($_GET['domain']);
@@ -45,4 +50,10 @@ if (!empty($_GET['domain'])) {
     }
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/web/");
+exit;

+ 5 - 3
web/edit/db/index.php

@@ -13,15 +13,17 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 // Panel
 top_panel($user,$TAB);
 
-// Are you admin?
-//if ($_SESSION['user'] == 'admin') {
-
     // Check user argument?
     if (empty($_GET['database'])) {
         header("Location: /list/db/");
         exit;
     }
 
+    // Edit as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=escapeshellarg($_GET['user']);
+    }
+
     $v_database = escapeshellarg($_GET['database']);
     exec (VESTA_CMD."v_list_database ".$user." ".$v_database." 'json'", $output, $return_var);
     if ($return_var != 0) {

+ 5 - 3
web/edit/dns/index.php

@@ -13,15 +13,17 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 // Panel
 top_panel($user,$TAB);
 
-// Are you admin?
-//if ($_SESSION['user'] == 'admin') {
-
     // Check user argument?
     if (empty($_GET['domain'])) {
         header("Location: /list/dns/");
         exit;
     }
 
+    // Edit as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=escapeshellarg($_GET['user']);
+    }
+
     // Check domain
     if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
         $v_domain = escapeshellarg($_GET['domain']);

+ 5 - 3
web/edit/mail/index.php

@@ -13,15 +13,17 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 // Panel
 top_panel($user,$TAB);
 
-// Are you admin?
-//if ($_SESSION['user'] == 'admin') {
-
     // Check user argument?
     if (empty($_GET['domain'])) {
         header("Location: /list/mail/");
         exit;
     }
 
+    // Edit as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=escapeshellarg($_GET['user']);
+    }
+
     // Check domain
     if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
         $v_domain = escapeshellarg($_GET['domain']);

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

@@ -14,8 +14,6 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 // Panel
 top_panel($user,$TAB);
 
-// Are you admin?
-//if ($_SESSION['user'] == 'admin') {
 
     // Check user argument?
     if (empty($_GET['domain'])) {
@@ -23,6 +21,12 @@ top_panel($user,$TAB);
         exit;
     }
 
+    // Edit as someone else?
+    if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+        $user=escapeshellarg($_GET['user']);
+    }
+
+
     // Check domain
     $v_domain = escapeshellarg($_GET['domain']);
     exec (VESTA_CMD."v_list_web_domain ".$user." ".$v_domain." json", $output, $return_var);

+ 29 - 6
web/search/index.php

@@ -1,16 +1,39 @@
 <?php
 // Init
 error_reporting(NULL);
-ob_start();
 session_start();
+$TAB = 'SEARCH';
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-$back=getenv("HTTP_REFERER");
-if (!empty($back)) {
-    header("Location: ".$back);
+// Check query
+$q = $_GET['q'];
+if (empty($q)) {
+    $back=getenv("HTTP_REFERER");
+    if (!empty($back)) {
+        header("Location: ".$back);
+        exit;
+    }
+    header("Location: /");
     exit;
 }
 
-header("Location: /");
+// Header
+include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 
-exit;
+// Panel
+top_panel($user,$TAB);
+
+// Data
+if ($_SESSION['user'] == 'admin') {
+    $q = escapeshellarg($q);
+    exec (VESTA_CMD."v_search_object ".$q." json", $output, $return_var);
+    $data = json_decode(implode('', $output), true);
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_search.html');
+} else {
+    exec (VESTA_CMD."v_list_web_domains $user json", $output, $return_var);
+    $data = json_decode(implode('', $output), true);
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_web.html');
+}
+
+// Footer
+include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 9 - 0
web/suspend/cron/index.php

@@ -6,6 +6,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
     if (!empty($_GET['job'])) {
         $v_username = escapeshellarg($user);
         $v_job = escapeshellarg($_GET['job']);
@@ -19,4 +22,10 @@ if ($_SESSION['user'] == 'admin') {
     unset($output);
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/cron/");
+exit;

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

@@ -6,6 +6,10 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
+
     if (!empty($_GET['database'])) {
         $v_username = escapeshellarg($user);
         $v_database = escapeshellarg($_GET['database']);
@@ -20,4 +24,10 @@ if ($_SESSION['user'] == 'admin') {
 
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/db/");
+exit;

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

@@ -6,6 +6,10 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
+
     // DNS domain
     if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
         $v_username = escapeshellarg($user);
@@ -17,6 +21,11 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/dns/");
         exit;
     }
@@ -33,9 +42,21 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/dns/?domain=".$_GET['domain']);
         exit;
+
     }
 
 }
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/dns/");
+exit;

+ 20 - 0
web/suspend/mail/index.php

@@ -6,6 +6,10 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
+
     // Mail domain
     if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
         $v_username = escapeshellarg($user);
@@ -17,6 +21,11 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/mail/");
         exit;
     }
@@ -33,9 +42,20 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+	}
         header("Location: /list/mail/?domain=".$_GET['domain']);
         exit;
     }
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/mail/");
+exit;

+ 6 - 0
web/suspend/user/index.php

@@ -20,4 +20,10 @@ if ($_SESSION['user'] == 'admin') {
 
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/user/");
+exit;

+ 10 - 0
web/suspend/web/index.php

@@ -6,6 +6,10 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
+
     if (!empty($_GET['domain'])) {
         $v_username = escapeshellarg($user);
         $v_domain = escapeshellarg($_GET['domain']);
@@ -19,4 +23,10 @@ if ($_SESSION['user'] == 'admin') {
     unset($output);
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/web/");
+exit;

+ 10 - 2
web/templates/admin/add_cron.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/cron/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding Cron Job</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding Cron Job</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -96,7 +104,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/cron/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_db.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/db/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding Database</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding Database</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -157,7 +165,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/db/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_dns.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/dns/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding DNS Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding DNS Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -146,7 +154,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/dns/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_dns_rec.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/dns/?domain=".$v_domain."'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding DNS Record</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding DNS Record</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -99,7 +107,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok_rec" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/dns/<?php echo "?domain=".$v_domain;  ?>'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_ip.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/ip/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding IP Address</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding IP Address</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -129,7 +137,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/ip/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_mail.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/mail/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding Mail Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding Mail Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -76,7 +84,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/mail/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_mail_acc.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/mail/?domain=".$v_domain."'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding Mail Account</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding Mail Account</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -128,7 +136,7 @@
                                 <tr>
                                     <td style="padding: 24px 0 0 0;">
                                         <input type="submit" name="ok_acc" value="OK" class="button">
-                                        <input type="button" class="button" value="Cancel" onclick="location.href='/list/mail/<?php echo "?domain=".$v_domain;  ?>'">
+                                        <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                     </td>
                                 </tr>
                             </table>

+ 10 - 2
web/templates/admin/add_package.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/package/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10x 2px 0 0;" ><a class="add-name"><b>Adding Package</b></a>
+                                        <td style="padding: 10x 2px 0 0;" ><a class="name"><b>Adding Package</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -227,7 +235,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/package/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_user.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/user/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding User</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding User</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -130,7 +138,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/user/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/add_web.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/web/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -225,7 +233,7 @@
                                     <tr>
                                         <td style="padding: 24px 0 0 0;">
                                             <input type="submit" name="ok" value="OK" class="button">
-                                            <input type="button" class="button" value="Cancel" onclick="location.href='/list/web/'">
+                                            <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                         </td>
                                     </tr>
                                 </table>

+ 10 - 2
web/templates/admin/edit_cron.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/cron/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Cron Job</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Cron Job</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -99,7 +107,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="save" value="Save" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/cron/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_db.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/db/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Database</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Database</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -119,7 +127,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="save" value="Save" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/db/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_dns.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/web/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing DNS Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing DNS Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -109,7 +117,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" class="button" name="save" value="Save">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/dns/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_dns_rec.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/dns/?domain=".$_GET['domain']."'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing DNS Record</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing DNS Record</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -89,7 +97,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" class="button" name="save" value="Save">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/dns/<?php echo "?domain=".$_GET['domain'];  ?>'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_ip.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/ip/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing IP Address</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing IP Address</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -118,7 +126,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="save" value="Save" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/ip/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_mail.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/back/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Mail Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Mail Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -88,7 +96,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" class="button" name="save" value="Save">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/mail/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_mail_acc.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/mail/?domain=".$_GET['domain']."'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Mail Account</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Mail Account</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -145,7 +153,7 @@
                                     <tr>
                                         <td style="padding: 24px 0 0 0;">
                                             <input type="submit" name="save" value="Save" class="button">
-                                            <input type="button" class="button" value="Cancel" onclick="location.href='/list/mail/<?php echo "?domain=".$_GET['domain'];  ?>'">
+                                            <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                         </td>
                                     </tr>
                                 </table>

+ 10 - 2
web/templates/admin/edit_package.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/package/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Package</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Package</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -229,7 +237,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="save" value="Save" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/package/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_user.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/user/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding User</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding User</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -189,7 +197,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" class="button" name="save" value="Save">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/user/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/admin/edit_web.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/web/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -240,7 +248,7 @@
                                         </td></tr></tr></table>
                                         <tr><td style="padding: 24px 0 0 0;">
                                             <input type="submit" class="button" name="save" value="Save"></form>
-                                            <input type="button" class="button" value="Cancel" onClick="location.href='/list/web/'">
+                                            <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                         </td></tr>
                                         </form>
                                     </table>

+ 1 - 1
web/templates/admin/list_backup.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_cron.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_db.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_dns.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_dns_rec.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_ip.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 2 - 2
web/templates/admin/list_log.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                         </td>
@@ -28,7 +28,7 @@
                             <tr class="data-row">
                                 <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
                                     <table class="data-col1" width="150">
-                                        <tr><td style="padding: 18 0 4 4;"><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 style="padding: 14 0 4 4;"><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 style="padding: 0 0 0 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></td></tr>
                                     </table>
                                 </td>

+ 1 - 1
web/templates/admin/list_mail.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_mail_acc.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_packages.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 5 - 6
web/templates/admin/list_rrd.html

@@ -11,7 +11,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                         </td>
@@ -33,11 +33,10 @@
                             ?>
 
                             <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-active"><b>active</b></td></tr>
+                                <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
+                                    <table class="data-col1" width="150">
+                                        <tr><td style="padding: 24 0 4 4;"><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 style="padding: 0 0 4 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></td></tr>
                                     </table>
                                 </td>
                                 <td class="data-dotted" width="830px" style="vertical-align:top;">

+ 137 - 0
web/templates/admin/list_search.html

@@ -0,0 +1,137 @@
+
+                                <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <a class="name" style="padding: 0;"><b>Search Results</b></a>
+                                            </div>
+                                            <div style="text-align: right; float: right;">
+                                                <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" value="Search" class="button" style="font-size: 12px;">
+                                                </form>
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <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'] == 'db') {
+                                        $object = 'database';
+                                    } else {
+                                        $object = strtolower($data[$key]['TYPE']." ".$data[$key]['KEY']);
+                                    }
+                            ?>
+
+                            <tr class="data-row">
+                                <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
+                                    <table class="data-col1" width="150">
+                                        <tr><td style="padding: 24 0 4 4;"><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 style="padding: 0 0 4 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></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="70px"><a href="/login/?loginas=<?php echo $data[$key]['USER'] ?>"><img src="/images/login-as.png" width="8px" height="8px"> login as</a></td>
+                                            <td class="data-controls" width="50px"><a href="/edit/<?php echo $data[$key]['TYPE'] ?>/?<?php echo strtolower($data[$key]['KEY']) ?>=<?php echo $data[$key]['RESULT'] ?>&user=<?php echo $data[$key]['USER'] ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
+                                            <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
+                                                <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
+                                                <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo $spnd_action ?></a>
+                                                <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/<?php echo $data[$key]['TYPE'] ?>/?<?php echo strtolower($data[$key]['KEY']) ?>=<?php echo $data[$key]['RESULT'] ?>&user=<?php echo $data[$key]['USER'] ?>" />
+                                                <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to <?php echo $spnd_action ?> <b><?php echo $data[$key]['RESULT'] ?></b> ?</p>
+                                                </div>
+                                            </td>
+                                            <td class="data-controls do_delete" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
+                                                <input type="hidden" name="delete_url" value="/delete/<?php echo $data[$key]['TYPE'] ?>/?<?php echo strtolower($data[$key]['KEY']) ?>=<?php echo $data[$key]['RESULT'] ?>&user=<?php echo $data[$key]['USER'] ?>" />
+                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo $data[$key]['RESULT'] ?></b> ?</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 $data[$key]['RESULT'] ?></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">
+                                                        Object:
+                                                    </td>
+                                                    <td class="counter-value">
+                                                        <?php echo $object ?>  
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                        <td style="vertical-align:top;" width="200">
+                                            <table>
+                                                <tr>
+                                                    <td class="counter-name">
+                                                        Owner:
+                                                    </td>
+                                                    <td class="counter-value">
+                                                        <?php echo $data[$key]['USER'] ?> 
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                        <td style="vertical-align:top;" width="350">
+                                            <table >
+                                                <tr>
+                                                    <td class="counter-name">
+                                                        Status:
+                                                    </td>
+                                                    <td class="counter-value" style="padding: 0 0 0 8px;">
+                                                        <?php echo $status ?> 
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+
+                        <?php
+                            }
+                        ?>
+                    </table>
+                    </form>
+
+                    <table class="data-count">
+                        <tr>
+                            <td width="160px"></td>
+                            <td>
+                                <?php
+                                    if ( $i == 1){
+                                        echo "1 object ";
+                                    } else {
+                                        echo "$i objects ";
+                                    }
+                                ?>
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+

+ 4 - 6
web/templates/admin/list_stats.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                         </td>
@@ -26,11 +26,9 @@
                             ?>
 
                             <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($key)) ?></td></tr>
-                                        <tr><td class="data-active"><b>active</b></td></tr>
+                                <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
+                                    <table class="data-col1" width="150">
+                                        <tr><td style="padding: 24 0 4 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($key))?></a></td></tr>
                                     </table>
                                 </td>
                                 <td class="data-dotted" width="830px" style="vertical-align:top;">

+ 1 - 1
web/templates/admin/list_user.html

@@ -14,7 +14,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/admin/list_web.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 8 - 7
web/templates/header.html

@@ -408,7 +408,7 @@
             .cron {
                 color: #555555;
                 font-family: Arial, sans-serif;
-                font-size: 14pt;
+                font-size: 18px;
             }
 
             .log {
@@ -433,7 +433,7 @@
 
             .fullname {
                 font-family: Arial;
-                font-size: 14pt;
+                font-size: 18px;
                 color: #99a7af;
                 padding: 0 0 0 8px;
             }
@@ -480,7 +480,7 @@
                 color: #484243;
             }
 
-            .add-name {
+            .name {
                 font-family: Arial;
                 font-size: 16pt;
                 color: #777;
@@ -489,14 +489,14 @@
 
             .add-ok {
                 font-family: Arial;
-                font-size: 14pt;
+                font-size: 18px;
                 color: #62a358;
                 padding: 0 0 0 6px;
             }
 
             .add-error {
                 font-family: Arial;
-                font-size: 14pt;
+                font-size: 18px;
                 color: #de6c5d;
                 padding: 0 0 0 6px;
             }
@@ -512,7 +512,7 @@
                 border-radius: 3px 3px 3px 3px;
                 color: #555555;
                 font-family: Arial,sans-serif;
-                font-size: 14pt;
+                font-size: 18px;
                 padding: 6px;
                 width: 360px;
                 height: 120px;
@@ -532,9 +532,10 @@
                 border-radius: 3px 3px 3px 3px;
                 color: #555555;
                 font-family: Arial,sans-serif;
-                font-size: 14pt;
+                font-size: 18px;
                 padding: 6px;
                 width: 360px;
+                line-height:22px;
             }
 
             .add-input:hover {

+ 10 - 2
web/templates/user/add_dns.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/dns/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding DNS Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding DNS Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -123,7 +131,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" name="ok" value="OK" class="button">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/dns/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/user/add_web.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/web/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Adding Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Adding Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -202,7 +210,7 @@
                                     <tr>
                                         <td style="padding: 24px 0 0 0;">
                                             <input type="submit" name="ok" value="OK" class="button">
-                                            <input type="button" class="button" value="Cancel" onclick="location.href='/list/web/'">
+                                            <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                         </td>
                                     </tr>
                                 </table>

+ 10 - 2
web/templates/user/edit_dns.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/dns/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing DNS Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing DNS Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -88,7 +96,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" class="button" name="save" value="Save">
-                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/dns/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/user/edit_user.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/user/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing User</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing User</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -105,7 +113,7 @@
                                         <tr>
                                             <td style="padding: 24px 0 0 0;">
                                                 <input type="submit" class="button" name="save" value="Save">
-                                                <input type="button" class="button" value="Cancel" onClick="location.href='/list/user/'">
+                                                <input type="button" class="button" value="Cancel" onclick="<?php echo $back ?>">
                                             </td>
                                         </tr>
                                     </table>

+ 10 - 2
web/templates/user/edit_web.html

@@ -1,7 +1,15 @@
+                                <?php
+                                    $back = getenv("HTTP_REFERER");
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/web/'";
+                                    } else {
+                                        $back = "javascript:history.back(1)";
+                                    }
+                                ?> 
 
                                 <table class="sub-menu" style="background: white;">
                                     <tr>
-                                        <td style="padding: 10px 2px 0 0;" ><a class="add-name"><b>Editing Domain</b></a>
+                                        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b>Editing Domain</b></a>
                                             <?php
                                                 if (!empty($_SESSION['error_msg'])) {
                                                     echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
@@ -219,7 +227,7 @@
                                         </td></tr></tr></table>
                                         <tr><td style="padding: 24px 0 0 0;">
                                             <input type="submit" class="button" name="save" value="Save">
-                                            <input type="button" class="button" value="Cancel" onClick="location.href='/list/web/'">
+                                            <input type="button" class="button" value="Cancel" onClick="<?php echo $back ?>">
                                         </td></tr>
                                         </form>
                                     </table>

+ 1 - 1
web/templates/user/list_cron.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/user/list_db.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/user/list_dns.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

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

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/user/list_mail.html

@@ -7,7 +7,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/user/list_mail_acc.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/user/list_user.html

@@ -14,7 +14,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 1 - 1
web/templates/user/list_web.html

@@ -8,7 +8,7 @@
                                             <div style="text-align: right; float: right;">
                                                 <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;">
+                                                <input type="submit" value="Search"class="button" style="font-size: 12px;">
                                                 </form>
                                             </div>
                                             <div style="float:left; padding-left: 26px;">

+ 9 - 0
web/unsuspend/cron/index.php

@@ -6,6 +6,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
     if (!empty($_GET['job'])) {
         $v_username = escapeshellarg($user);
         $v_job = escapeshellarg($_GET['job']);
@@ -20,4 +23,10 @@ if ($_SESSION['user'] == 'admin') {
 
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/cron/");
+exit;

+ 9 - 0
web/unsuspend/db/index.php

@@ -6,6 +6,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
     if (!empty($_GET['database'])) {
         $v_username = escapeshellarg($user);
         $v_database = escapeshellarg($_GET['database']);
@@ -14,4 +17,10 @@ if ($_SESSION['user'] == 'admin') {
     }
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/db/");
+exit;

+ 19 - 0
web/unsuspend/dns/index.php

@@ -6,6 +6,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
     // DNS domain
     if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
         $v_username = escapeshellarg($user);
@@ -17,6 +20,11 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/dns/");
         exit;
 
@@ -34,10 +42,21 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/dns/?domain=".$_GET['domain']);
         exit;
     }
 
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/dns/");
+exit;

+ 19 - 0
web/unsuspend/mail/index.php

@@ -6,6 +6,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
     // Mail domain
     if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
         $v_username = escapeshellarg($user);
@@ -17,6 +20,11 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+            exit;
+        }
         header("Location: /list/mail/");
         exit;
     }
@@ -33,9 +41,20 @@ if ($_SESSION['user'] == 'admin') {
             $_SESSION['error_msg'] = $error;
         }
         unset($output);
+        $back=getenv("HTTP_REFERER");
+        if (!empty($back)) {
+            header("Location: ".$back);
+    	exit;
+        }
         header("Location: /list/mail/?domain=".$_GET['domain']);
         exit;
     }
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/mail/");
+exit;

+ 6 - 0
web/unsuspend/user/index.php

@@ -19,4 +19,10 @@ if ($_SESSION['user'] == 'admin') {
     unset($output);
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/user/");
+exit;

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

@@ -6,6 +6,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 if ($_SESSION['user'] == 'admin') {
+    if (!empty($_GET['user'])) {
+        $user=$_GET['user'];
+    }
     if (!empty($_GET['domain'])) {
         $v_username = escapeshellarg($user);
         $v_domain = escapeshellarg($_GET['domain']);
@@ -19,4 +22,10 @@ if ($_SESSION['user'] == 'admin') {
     unset($output);
 }
 
+$back=getenv("HTTP_REFERER");
+if (!empty($back)) {
+    header("Location: ".$back);
+    exit;
+}
 header("Location: /list/web/");
+exit;