Serghey Rodin 11 лет назад
Родитель
Сommit
dab033ed0b

+ 14 - 11
web/suspend/cron/index.php

@@ -5,18 +5,21 @@ ob_start();
 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']);
-        exec (VESTA_CMD."v-suspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
-    }
-    check_return_code($return_var,$output);
-    unset($output);
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
+if (!empty($_GET['job'])) {
+    $v_username = escapeshellarg($user);
+    $v_job = escapeshellarg($_GET['job']);
+    exec (VESTA_CMD."v-suspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
 }
+check_return_code($return_var,$output);
+unset($output);
 
 $back = $_SESSION['back'];
 if (!empty($back)) {

+ 15 - 11
web/suspend/db/index.php

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

+ 36 - 31
web/suspend/dns/index.php

@@ -5,44 +5,49 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $user=$_GET['user'];
-    }
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
 
-    // DNS domain
-    if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        exec (VESTA_CMD."v-suspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
-        check_return_code($return_var,$output);
-        unset($output);
-        $back = $_SESSION['back'];
-        if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/dns/");
+// DNS domain
+if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v-suspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
+    check_return_code($return_var,$output);
+    unset($output);
+    $back = $_SESSION['back'];
+    if (!empty($back)) {
+        header("Location: ".$back);
         exit;
     }
+    header("Location: /list/dns/");
+    exit;
+}
 
-    // DNS record
-    if ((!empty($_GET['domain'])) && (!empty($_GET['record_id'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        $v_record_id = escapeshellarg($_GET['record_id']);
-        exec (VESTA_CMD."v-suspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
-        check_return_code($return_var,$output);
-        unset($output);
-        $back = $_SESSION['back'];
-        if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/dns/?domain=".$_GET['domain']);
+// DNS record
+if ((!empty($_GET['domain'])) && (!empty($_GET['record_id'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    $v_record_id = escapeshellarg($_GET['record_id']);
+    exec (VESTA_CMD."v-suspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
+    check_return_code($return_var,$output);
+    unset($output);
+    $back = $_SESSION['back'];
+    if (!empty($back)) {
+        header("Location: ".$back);
         exit;
     }
+    header("Location: /list/dns/?domain=".$_GET['domain']);
+    exit;
 }
+
 $back = $_SESSION['back'];
 if (!empty($back)) {
     header("Location: ".$back);

+ 36 - 31
web/suspend/mail/index.php

@@ -5,43 +5,47 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $user=$_GET['user'];
-    }
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
 
-    // Mail domain
-    if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        exec (VESTA_CMD."v-suspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var);
-        check_return_code($return_var,$output);
-        unset($output);
-        $back=getenv("HTTP_REFERER");
-        if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/mail/");
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
+
+// Mail domain
+if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v-suspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var);
+    check_return_code($return_var,$output);
+    unset($output);
+    $back=getenv("HTTP_REFERER");
+    if (!empty($back)) {
+        header("Location: ".$back);
         exit;
     }
+    header("Location: /list/mail/");
+    exit;
+}
 
-    // Mail account
-    if ((!empty($_GET['domain'])) && (!empty($_GET['account'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        $v_account = escapeshellarg($_GET['account']);
-        exec (VESTA_CMD."v-suspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
-        check_return_code($return_var,$output);
-        unset($output);
-        $back = $_SESSION['back'];
-            if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/mail/?domain=".$_GET['domain']);
+// Mail account
+if ((!empty($_GET['domain'])) && (!empty($_GET['account'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    $v_account = escapeshellarg($_GET['account']);
+    exec (VESTA_CMD."v-suspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
+    check_return_code($return_var,$output);
+    unset($output);
+    $back = $_SESSION['back'];
+        if (!empty($back)) {
+        header("Location: ".$back);
         exit;
     }
+    header("Location: /list/mail/?domain=".$_GET['domain']);
+    exit;
 }
 
 $back = $_SESSION['back'];
@@ -49,5 +53,6 @@ if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/mail/");
 exit;

+ 11 - 8
web/suspend/user/index.php

@@ -5,15 +5,18 @@ session_start();
 $TAB = 'USER';
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-// Are you admin?
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $v_username = escapeshellarg($_GET['user']);
-        exec (VESTA_CMD."v-suspend-user ".$v_username, $output, $return_var);
-    }
-    check_return_code($return_var,$output);
-    unset($output);
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $v_username = escapeshellarg($_GET['user']);
+    exec (VESTA_CMD."v-suspend-user ".$v_username, $output, $return_var);
 }
+check_return_code($return_var,$output);
+unset($output);
 
 $back = $_SESSION['back'];
 if (!empty($back)) {

+ 15 - 11
web/suspend/web/index.php

@@ -5,19 +5,23 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $user=$_GET['user'];
-    }
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
 
-    if (!empty($_GET['domain'])) {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        exec (VESTA_CMD."v-suspend-web-domain ".$v_username." ".$v_domain, $output, $return_var);
-    }
-    check_return_code($return_var,$output);
-    unset($output);
+if (!empty($_GET['domain'])) {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v-suspend-web-domain ".$v_username." ".$v_domain, $output, $return_var);
 }
+check_return_code($return_var,$output);
+unset($output);
 
 $back = $_SESSION['back'];
 if (!empty($back)) {

+ 17 - 11
web/unsuspend/cron/index.php

@@ -3,26 +3,32 @@
 error_reporting(NULL);
 ob_start();
 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']);
-        exec (VESTA_CMD."v-unsuspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
-    }
-    check_return_code($return_var,$output);
-    unset($output);
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
 
+if (!empty($_GET['job'])) {
+    $v_username = escapeshellarg($user);
+    $v_job = escapeshellarg($_GET['job']);
+    exec (VESTA_CMD."v-unsuspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
 }
+check_return_code($return_var,$output);
+unset($output);
 
 $back=getenv("HTTP_REFERER");
 if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/cron/");
 exit;

+ 16 - 11
web/unsuspend/db/index.php

@@ -5,17 +5,21 @@ ob_start();
 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']);
-        exec (VESTA_CMD."v-unsuspend-database ".$v_username." ".$v_database, $output, $return_var);
-        check_return_code($return_var,$output);
-        unset($output);
-    }
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
+if (!empty($_GET['database'])) {
+    $v_username = escapeshellarg($user);
+    $v_database = escapeshellarg($_GET['database']);
+    exec (VESTA_CMD."v-unsuspend-database ".$v_username." ".$v_database, $output, $return_var);
+    check_return_code($return_var,$output);
+    unset($output);
 }
 
 $back=getenv("HTTP_REFERER");
@@ -23,5 +27,6 @@ if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/db/");
 exit;

+ 44 - 40
web/unsuspend/dns/index.php

@@ -5,52 +5,55 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $user=$_GET['user'];
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
+
+// DNS domain
+if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v-unsuspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
+    if ($return_var != 0) {
+        $error = implode('<br>', $output);
+        if (empty($error)) $error = __('Error: vesta did not return any output.');
+        $_SESSION['error_msg'] = $error;
     }
-    // DNS domain
-    if ((!empty($_GET['domain'])) && (empty($_GET['record_id'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        exec (VESTA_CMD."v-unsuspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
-        if ($return_var != 0) {
-            $error = implode('<br>', $output);
-            if (empty($error)) $error = __('Error: vesta did not return any output.');
-            $_SESSION['error_msg'] = $error;
-        }
-        unset($output);
-        $back=getenv("HTTP_REFERER");
-        if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/dns/");
+    unset($output);
+    $back=getenv("HTTP_REFERER");
+    if (!empty($back)) {
+        header("Location: ".$back);
         exit;
-
     }
+    header("Location: /list/dns/");
+    exit;
+}
 
-    // DNS record
-    if ((!empty($_GET['domain'])) && (!empty($_GET['record_id'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        $v_record_id = escapeshellarg($_GET['record_id']);
-        exec (VESTA_CMD."v-unsuspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
-        if ($return_var != 0) {
-            $error = implode('<br>', $output);
-            if (empty($error)) $error = __('Error: vesta did not return any output.');
-            $_SESSION['error_msg'] = $error;
-        }
-        unset($output);
-        $back=getenv("HTTP_REFERER");
-        if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/dns/?domain=".$_GET['domain']);
+// DNS record
+if ((!empty($_GET['domain'])) && (!empty($_GET['record_id'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    $v_record_id = escapeshellarg($_GET['record_id']);
+    exec (VESTA_CMD."v-unsuspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
+    if ($return_var != 0) {
+        $error = implode('<br>', $output);
+        if (empty($error)) $error = __('Error: vesta did not return any output.');
+        $_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");
@@ -58,5 +61,6 @@ if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/dns/");
 exit;

+ 44 - 38
web/unsuspend/mail/index.php

@@ -5,50 +5,55 @@ ob_start();
 session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $user=$_GET['user'];
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
+}
+
+// Mail domain
+if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v-unsuspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var);
+    if ($return_var != 0) {
+        $error = implode('<br>', $output);
+        if (empty($error)) $error = __('Error: vesta did not return any output.');
+        $_SESSION['error_msg'] = $error;
     }
-    // Mail domain
-    if ((!empty($_GET['domain'])) && (empty($_GET['account'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        exec (VESTA_CMD."v-unsuspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var);
-        if ($return_var != 0) {
-            $error = implode('<br>', $output);
-            if (empty($error)) $error = __('Error: vesta did not return any output.');
-            $_SESSION['error_msg'] = $error;
-        }
-        unset($output);
-        $back=getenv("HTTP_REFERER");
-        if (!empty($back)) {
-            header("Location: ".$back);
-            exit;
-        }
-        header("Location: /list/mail/");
+    unset($output);
+    $back=getenv("HTTP_REFERER");
+    if (!empty($back)) {
+        header("Location: ".$back);
         exit;
     }
+    header("Location: /list/mail/");
+    exit;
+}
 
-    // Mail account
-    if ((!empty($_GET['domain'])) && (!empty($_GET['account'])))  {
-        $v_username = escapeshellarg($user);
-        $v_domain = escapeshellarg($_GET['domain']);
-        $v_account = escapeshellarg($_GET['account']);
-        exec (VESTA_CMD."v-unsuspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
-        if ($return_var != 0) {
-            $error = implode('<br>', $output);
-            if (empty($error)) $error = __('Error: vesta did not return any output.');
-            $_SESSION['error_msg'] = $error;
-        }
-        unset($output);
-        $back=getenv("HTTP_REFERER");
-        if (!empty($back)) {
-            header("Location: ".$back);
-    	exit;
-        }
-        header("Location: /list/mail/?domain=".$_GET['domain']);
+// Mail account
+if ((!empty($_GET['domain'])) && (!empty($_GET['account'])))  {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    $v_account = escapeshellarg($_GET['account']);
+    exec (VESTA_CMD."v-unsuspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
+    if ($return_var != 0) {
+        $error = implode('<br>', $output);
+        if (empty($error)) $error = __('Error: vesta did not return any output.');
+        $_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");
@@ -56,5 +61,6 @@ if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/mail/");
 exit;

+ 12 - 7
web/unsuspend/user/index.php

@@ -6,19 +6,24 @@ session_start();
 $TAB = 'USER';
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
-if ($_SESSION['user'] == 'admin') {
-    if (!empty($_GET['user'])) {
-        $v_username = escapeshellarg($_GET['user']);
-        exec (VESTA_CMD."v-unsuspend-user ".$v_username, $output, $return_var);
-    }
-    check_return_code($return_var,$output);
-    unset($output);
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+if (!empty($_GET['user'])) {
+    $v_username = escapeshellarg($_GET['user']);
+    exec (VESTA_CMD."v-unsuspend-user ".$v_username, $output, $return_var);
 }
+check_return_code($return_var,$output);
+unset($output);
 
 $back=getenv("HTTP_REFERER");
 if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/user/");
 exit;

+ 15 - 11
web/unsuspend/web/index.php

@@ -5,23 +5,27 @@ ob_start();
 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']);
-        exec (VESTA_CMD."v-unsuspend-web-domain ".$v_username." ".$v_domain, $output, $return_var);
-    }
-    check_return_code($return_var,$output);
-    unset($output);
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+if (!empty($_GET['user'])) {
+    $user=$_GET['user'];
 }
+if (!empty($_GET['domain'])) {
+    $v_username = escapeshellarg($user);
+    $v_domain = escapeshellarg($_GET['domain']);
+    exec (VESTA_CMD."v-unsuspend-web-domain ".$v_username." ".$v_domain, $output, $return_var);
+}
+check_return_code($return_var,$output);
+unset($output);
 
 $back=getenv("HTTP_REFERER");
 if (!empty($back)) {
     header("Location: ".$back);
     exit;
 }
+
 header("Location: /list/web/");
 exit;