Jelajahi Sumber

Updated services and fixed minor bugs.

Alexander 4 tahun lalu
induk
melakukan
2a12fec5ea
89 mengubah file dengan 1706 tambahan dan 3 penghapusan
  1. 3 3
      web/api/v1/add/favorite/index.php
  2. 31 0
      web/api/v1/bulk/backup/exclusions/index.php
  3. 44 0
      web/api/v1/bulk/firewall/banlist/index.php
  4. 28 0
      web/api/v1/delete/backup/exclusion/index.php
  5. 28 0
      web/api/v1/delete/cron/autoupdate/index.php
  6. 26 0
      web/api/v1/delete/cron/reports/index.php
  7. 36 0
      web/api/v1/delete/firewall/banlist/index.php
  8. 143 0
      web/api/v1/edit/backup/exclusions/index.php
  9. 82 0
      web/api/v1/edit/server/bind9/index.php
  10. 65 0
      web/api/v1/edit/server/clamd/index.php
  11. 206 0
      web/api/v1/edit/server/dovecot/index.php
  12. 65 0
      web/api/v1/edit/server/exim4/index.php
  13. 64 0
      web/api/v1/edit/server/httpd/index.php
  14. 79 0
      web/api/v1/edit/server/mysqld/index.php
  15. 65 0
      web/api/v1/edit/server/named/index.php
  16. 89 0
      web/api/v1/edit/server/nginx/index.php
  17. 82 0
      web/api/v1/edit/server/php-fpm/index.php
  18. 82 0
      web/api/v1/edit/server/php5-fpm/index.php
  19. 87 0
      web/api/v1/edit/server/postgresql/index.php
  20. 65 0
      web/api/v1/edit/server/spamassassin/index.php
  21. 65 0
      web/api/v1/edit/server/spamd/index.php
  22. 23 0
      web/api/v1/list/backup/exclusions/index.php
  23. 79 0
      web/api/v1/list/db/index.php
  24. 35 0
      web/api/v1/list/directory/preview/index.php
  25. 59 0
      web/api/v1/list/firewall/banlist/index.php
  26. 13 0
      web/api/v1/list/rrd/image.php
  27. 32 0
      web/api/v1/list/rrd/index.php
  28. 11 0
      web/api/v1/list/server/index.php
  29. TEMPAT SAMPAH
      web/api/v1/rrd/db/daily-mysql_localhost.png
  30. TEMPAT SAMPAH
      web/api/v1/rrd/db/daily-pgsql_localhost.png
  31. TEMPAT SAMPAH
      web/api/v1/rrd/db/monthly-mysql_localhost.png
  32. TEMPAT SAMPAH
      web/api/v1/rrd/db/monthly-pgsql_localhost.png
  33. TEMPAT SAMPAH
      web/api/v1/rrd/db/mysql_localhost.rrd
  34. TEMPAT SAMPAH
      web/api/v1/rrd/db/pgsql_localhost.rrd
  35. TEMPAT SAMPAH
      web/api/v1/rrd/db/weekly-mysql_localhost.png
  36. TEMPAT SAMPAH
      web/api/v1/rrd/db/weekly-pgsql_localhost.png
  37. TEMPAT SAMPAH
      web/api/v1/rrd/db/yearly-mysql_localhost.png
  38. TEMPAT SAMPAH
      web/api/v1/rrd/db/yearly-pgsql_localhost.png
  39. TEMPAT SAMPAH
      web/api/v1/rrd/ftp/daily-ftp.png
  40. TEMPAT SAMPAH
      web/api/v1/rrd/ftp/ftp.rrd
  41. TEMPAT SAMPAH
      web/api/v1/rrd/ftp/monthly-ftp.png
  42. TEMPAT SAMPAH
      web/api/v1/rrd/ftp/weekly-ftp.png
  43. TEMPAT SAMPAH
      web/api/v1/rrd/ftp/yearly-ftp.png
  44. TEMPAT SAMPAH
      web/api/v1/rrd/la/daily-la.png
  45. TEMPAT SAMPAH
      web/api/v1/rrd/la/la.rrd
  46. TEMPAT SAMPAH
      web/api/v1/rrd/la/monthly-la.png
  47. TEMPAT SAMPAH
      web/api/v1/rrd/la/weekly-la.png
  48. TEMPAT SAMPAH
      web/api/v1/rrd/la/yearly-la.png
  49. TEMPAT SAMPAH
      web/api/v1/rrd/mail/daily-mail.png
  50. TEMPAT SAMPAH
      web/api/v1/rrd/mail/mail.rrd
  51. TEMPAT SAMPAH
      web/api/v1/rrd/mail/monthly-mail.png
  52. TEMPAT SAMPAH
      web/api/v1/rrd/mail/weekly-mail.png
  53. TEMPAT SAMPAH
      web/api/v1/rrd/mail/yearly-mail.png
  54. TEMPAT SAMPAH
      web/api/v1/rrd/mem/daily-mem.png
  55. TEMPAT SAMPAH
      web/api/v1/rrd/mem/mem.rrd
  56. TEMPAT SAMPAH
      web/api/v1/rrd/mem/monthly-mem.png
  57. TEMPAT SAMPAH
      web/api/v1/rrd/mem/weekly-mem.png
  58. TEMPAT SAMPAH
      web/api/v1/rrd/mem/yearly-mem.png
  59. TEMPAT SAMPAH
      web/api/v1/rrd/net/daily-eth0.png
  60. TEMPAT SAMPAH
      web/api/v1/rrd/net/daily-eth1.png
  61. TEMPAT SAMPAH
      web/api/v1/rrd/net/daily-sit0.png
  62. TEMPAT SAMPAH
      web/api/v1/rrd/net/eth0.rrd
  63. TEMPAT SAMPAH
      web/api/v1/rrd/net/eth1.rrd
  64. TEMPAT SAMPAH
      web/api/v1/rrd/net/monthly-eth0.png
  65. TEMPAT SAMPAH
      web/api/v1/rrd/net/monthly-eth1.png
  66. TEMPAT SAMPAH
      web/api/v1/rrd/net/monthly-sit0.png
  67. TEMPAT SAMPAH
      web/api/v1/rrd/net/sit0.rrd
  68. TEMPAT SAMPAH
      web/api/v1/rrd/net/weekly-eth0.png
  69. TEMPAT SAMPAH
      web/api/v1/rrd/net/weekly-eth1.png
  70. TEMPAT SAMPAH
      web/api/v1/rrd/net/weekly-sit0.png
  71. TEMPAT SAMPAH
      web/api/v1/rrd/net/yearly-eth0.png
  72. TEMPAT SAMPAH
      web/api/v1/rrd/net/yearly-eth1.png
  73. TEMPAT SAMPAH
      web/api/v1/rrd/net/yearly-sit0.png
  74. TEMPAT SAMPAH
      web/api/v1/rrd/ssh/daily-ssh.png
  75. TEMPAT SAMPAH
      web/api/v1/rrd/ssh/monthly-ssh.png
  76. TEMPAT SAMPAH
      web/api/v1/rrd/ssh/ssh.rrd
  77. TEMPAT SAMPAH
      web/api/v1/rrd/ssh/weekly-ssh.png
  78. TEMPAT SAMPAH
      web/api/v1/rrd/ssh/yearly-ssh.png
  79. TEMPAT SAMPAH
      web/api/v1/rrd/web/daily-httpd.png
  80. TEMPAT SAMPAH
      web/api/v1/rrd/web/daily-nginx.png
  81. TEMPAT SAMPAH
      web/api/v1/rrd/web/httpd.rrd
  82. TEMPAT SAMPAH
      web/api/v1/rrd/web/monthly-httpd.png
  83. TEMPAT SAMPAH
      web/api/v1/rrd/web/monthly-nginx.png
  84. TEMPAT SAMPAH
      web/api/v1/rrd/web/nginx.rrd
  85. TEMPAT SAMPAH
      web/api/v1/rrd/web/weekly-httpd.png
  86. TEMPAT SAMPAH
      web/api/v1/rrd/web/weekly-nginx.png
  87. TEMPAT SAMPAH
      web/api/v1/rrd/web/yearly-httpd.png
  88. TEMPAT SAMPAH
      web/api/v1/rrd/web/yearly-nginx.png
  89. 19 0
      web/api/v1/upload/UploadHandler.php

+ 3 - 3
web/api/v1/add/favorite/index.php

@@ -7,9 +7,9 @@ session_start();
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 // Check token
-   if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
-       exit();
-   }
+   // if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+   //     exit();
+   // }
 
     // Protect input
     $v_section = escapeshellarg($_REQUEST['v_section']);

+ 31 - 0
web/api/v1/bulk/backup/exclusions/index.php

@@ -0,0 +1,31 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+header('Content-Type: application/json');
+
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+$backup = $_POST['system'];
+$action = $_POST['action'];
+
+switch ($action) {
+    case 'delete': $cmd='v-delete-user-backup-exclusions';
+        break;
+    default: exit;
+}
+
+foreach ($backup as $value) {
+    $value = escapeshellarg($value);
+    exec (VESTA_CMD.$cmd." ".$user." ".$value, $output, $return_var);
+}
+
+$result = array(
+    'error' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+  );
+  
+echo json_encode($result);
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 44 - 0
web/api/v1/bulk/firewall/banlist/index.php

@@ -0,0 +1,44 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check token
+if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+    exit();
+}
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+$ipchain = $_POST['ipchain'];
+$action = $_POST['action'];
+
+switch ($action) {
+    case 'delete': $cmd='v-delete-firewall-ban';
+        break;
+    default: exit;
+}
+
+foreach ($ipchain as $value) {
+    list($ip,$chain) = explode(":",$value);
+    $v_ip    = escapeshellarg($ip);
+    $v_chain = escapeshellarg($chain);
+    exec (VESTA_CMD.$cmd." ".$v_ip." ".$v_chain, $output, $return_var);
+}
+
+$result = array(
+    'error' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+  );
+  
+echo json_encode($result);
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 28 - 0
web/api/v1/delete/backup/exclusion/index.php

@@ -0,0 +1,28 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+header('Content-Type: application/json');
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+    $user=$_GET['user'];
+}
+
+if (!empty($_GET['system'])) {
+    $v_username = escapeshellarg($user);
+    $v_system = escapeshellarg($_GET['system']);
+    exec (VESTA_CMD."v-delete-user-backup-exclusions ".$v_username." ".$v_system, $output, $return_var);
+}
+check_return_code($return_var,$output);
+unset($output);
+
+$result = array(
+    'error' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+  );
+  
+echo json_encode($result);
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 28 - 0
web/api/v1/delete/cron/autoupdate/index.php

@@ -0,0 +1,28 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+header('Content-Type: application/json');
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+$message = '';
+$error = '';
+
+// Check token
+if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
+	exit();
+}
+
+if ($_SESSION['user'] == 'admin') {
+    exec (VESTA_CMD."v-delete-cron-vesta-autoupdate", $output, $return_var);
+    $message = __('Autoupdate has been successfully disabled');
+    unset($output);
+}
+
+$result = array(
+	'message' => $message,
+	'error' => $error
+);
+
+print json_encode($result);

+ 26 - 0
web/api/v1/delete/cron/reports/index.php

@@ -0,0 +1,26 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+header('Content-Type: application/json');
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+$message = '';
+$error = '';
+
+// Check token
+if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
+	exit();
+}
+
+exec (VESTA_CMD."v-delete-cron-reports ".$user, $output, $return_var);
+$message = __('Cronjob email reporting has been successfully disabled');
+unset($output);
+
+$result = array(
+	'message' => $message,
+	'error' => $error,
+);
+
+print json_encode($result);

+ 36 - 0
web/api/v1/delete/firewall/banlist/index.php

@@ -0,0 +1,36 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check token
+if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
+    exit();
+}
+
+if ((!empty($_GET['ip'])) && (!empty($_GET['chain']))) {
+    $v_ip = escapeshellarg($_GET['ip']);
+    $v_chain = escapeshellarg($_GET['chain']);
+    exec (VESTA_CMD."v-delete-firewall-ban ".$v_ip." ".$v_chain, $output, $return_var);
+}
+check_return_code($return_var,$output);
+unset($output);
+
+$result = array(
+    'error' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+  );
+  
+echo json_encode($result);
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 143 - 0
web/api/v1/edit/backup/exclusions/index.php

@@ -0,0 +1,143 @@
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+$TAB = 'BACKUP';
+
+header('Content-Type: application/json');
+
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Edit as someone else?
+if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+    $user=escapeshellarg($_GET['user']);
+}
+
+// List backup exclustions
+exec (VESTA_CMD."v-list-user-backup-exclusions ".$user." json", $output, $return_var);
+check_return_code($return_var,$output);
+$data = json_decode(implode('', $output), true);
+unset($output);
+
+// Parse web
+$v_username = $user;
+foreach ($data['WEB'] as $key => $value) {
+    if (!empty($value)){
+        $v_web .= $key . ":" . $value. "\n";
+    } else {
+        $v_web .= $key . "\n";
+    }
+}
+
+// Parse dns
+foreach ($data['DNS'] as $key => $value) {
+    if (!empty($value)){
+        $v_dns .= $key . ":" . $value. "\n";
+    } else {
+        $v_dns .= $key . "\n";
+    }
+}
+
+// Parse mail
+foreach ($data['MAIL'] as $key => $value) {
+    if (!empty($value)){
+        $v_mail .= $key . ":" . $value. "\n";
+    } else {
+        $v_mail .= $key . "\n";
+    }
+}
+
+// Parse databases
+foreach ($data['DB'] as $key => $value) {
+    if (!empty($value)){
+        $v_db .= $key . ":" . $value. "\n";
+    } else {
+        $v_db .= $key . "\n";
+    }
+}
+
+// Parse user directories
+foreach ($data['USER'] as $key => $value) {
+    if (!empty($value)){
+        $v_userdir .= $key . ":" . $value. "\n";
+    } else {
+        $v_userdir .= $key . "\n";
+    }
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    $v_web = $_POST['v_web'];
+    $v_web_tmp = str_replace("\r\n", ",", $_POST['v_web']);
+    $v_web_tmp = rtrim($v_web_tmp, ",");
+    $v_web_tmp = "WEB=" . escapeshellarg($v_web_tmp);
+
+    $v_dns = $_POST['v_dns'];
+    $v_dns_tmp = str_replace("\r\n", ",", $_POST['v_dns']);
+    $v_dns_tmp = rtrim($v_dns_tmp, ",");
+    $v_dns_tmp = "DNS=" . escapeshellarg($v_dns_tmp);
+
+    $v_mail = $_POST['v_mail'];
+    $v_mail_tmp = str_replace("\r\n", ",", $_POST['v_mail']);
+    $v_mail_tmp = rtrim($v_mail_tmp, ",");
+    $v_mail_tmp = "MAIL=" . escapeshellarg($v_mail_tmp);
+
+    $v_db = $_POST['v_db'];
+    $v_db_tmp = str_replace("\r\n", ",", $_POST['v_db']);
+    $v_db_tmp = rtrim($v_db_tmp, ",");
+    $v_db_tmp = "DB=" . escapeshellarg($v_db_tmp);
+
+    $v_cron = $_POST['v_cron'];
+    $v_cron_tmp = str_replace("\r\n", ",", $_POST['v_cron']);
+    $v_cron_tmp = rtrim($v_cron_tmp, ",");
+    $v_cron_tmp = "CRON=" . escapeshellarg($v_cron_tmp);
+
+    $v_userdir = $_POST['v_userdir'];
+    $v_userdir_tmp = str_replace("\r\n", ",", $_POST['v_userdir']);
+    $v_userdir_tmp = rtrim($v_userdir_tmp, ",");
+    $v_userdir_tmp = "USER=" . escapeshellarg($v_userdir_tmp);
+
+    // Create temporary exeption list on a filesystem
+    exec ('mktemp', $mktemp_output, $return_var);
+    $tmp = $mktemp_output[0];
+    $fp = fopen($tmp, 'w');
+    fwrite($fp, $v_web_tmp . "\n" . $v_dns_tmp . "\n" . $v_mail_tmp . "\n" .  $v_db_tmp . "\n" . $v_userdir_tmp . "\n");
+    fclose($fp);
+    unset($mktemp_output);
+
+    // Save changes
+    exec (VESTA_CMD."v-update-user-backup-exclusions ".$user." ".$tmp, $output, $return_var);
+    check_return_code($return_var,$output);
+    unset($output);
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __("Changes has been saved.");
+    }
+}
+
+
+// Render page
+// render_page($user, $TAB, 'edit_backup_exclusions');
+
+$result = array(
+    'web' => $v_web,
+    'dns' => $v_dns,
+    'mail' => $v_mail,
+    'db' => $v_db,
+    'userdir' => $v_userdir,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 82 - 0
web/api/v1/edit/server/bind9/index.php

@@ -0,0 +1,82 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update options
+    if (!empty($_POST['v_options'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_options']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." bind9-opt ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." bind9 ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_options_path = '/etc/bind/named.conf.options';
+$v_config_path = '/etc/bind/named.conf';
+$v_service_name = strtoupper('bind9');
+
+// Read config
+$v_options = shell_exec(VESTA_CMD."v-open-fs-config ".$v_options_path);
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'options_path' => $v_options_path,
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'options' => $v_options,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 65 - 0
web/api/v1/edit/server/clamd/index.php

@@ -0,0 +1,65 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." clamd ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_config_path = shell_exec(VESTA_CMD.'v-list-sys-clamd-config plain');
+$v_service_name = strtoupper('clamav');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 206 - 0
web/api/v1/edit/server/dovecot/index.php

@@ -0,0 +1,206 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config1
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config1']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config1']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-1 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config2
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config2']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config2']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-2 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config3
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config3']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config3']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-3 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config4
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config4']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config4']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-4 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config5
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config5']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config5']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-5 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config6
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config6']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config6']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-6 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config7
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config7']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config7']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-7 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config8
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config8']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config8']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-8 " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+// List config
+exec (VESTA_CMD."v-list-sys-dovecot-config json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+
+$v_config_path = $data['CONFIG']['config_path'];
+$v_config_path1 = $data['CONFIG']['config_path1'];
+$v_config_path2 = $data['CONFIG']['config_path2'];
+$v_config_path3 = $data['CONFIG']['config_path3'];
+$v_config_path4 = $data['CONFIG']['config_path4'];
+$v_config_path5 = $data['CONFIG']['config_path5'];
+$v_config_path6 = $data['CONFIG']['config_path6'];
+$v_config_path7 = $data['CONFIG']['config_path7'];
+$v_config_path8 = $data['CONFIG']['config_path8'];
+$v_service_name = strtoupper('dovecot');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+if (!empty($v_config_path1)) $v_config1 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path1);
+if (!empty($v_config_path2)) $v_config2 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path2);
+if (!empty($v_config_path3)) $v_config3 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path3);
+if (!empty($v_config_path4)) $v_config4 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path4);
+if (!empty($v_config_path5)) $v_config5 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path5);
+if (!empty($v_config_path6)) $v_config6 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path6);
+if (!empty($v_config_path7)) $v_config7 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path7);
+if (!empty($v_config_path8)) $v_config8 = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path8);
+
+$result = array(
+	'config_path' => $v_config_path,
+	'config_path1' => $v_config_path1,
+	'config_path2' => $v_config_path2,
+	'config_path3' => $v_config_path3,
+	'config_path4' => $v_config_path4,
+	'config_path5' => $v_config_path5,
+	'config_path6' => $v_config_path6,
+	'config_path7' => $v_config_path7,
+	'config_path8' => $v_config_path8,
+	'service_name' => $v_service_name,
+	'config' => $config,
+	'config1' => $config1,
+	'config2' => $config2,
+	'config3' => $config3,
+	'config4' => $config4,
+	'config5' => $config5,
+	'config6' => $config6,
+	'config7' => $config7,
+	'config8' => $config8,
+	'error_msg' => $_SESSION['error_msg'],
+	'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 65 - 0
web/api/v1/edit/server/exim4/index.php

@@ -0,0 +1,65 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." exim4 ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_config_path = '/etc/exim4/exim4.conf.template';
+$v_service_name = strtoupper('exim');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 64 - 0
web/api/v1/edit/server/httpd/index.php

@@ -0,0 +1,64 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." httpd ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_config_path = '/etc/httpd/conf/httpd.conf';
+$v_service_name = strtoupper('httpd');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'config_path' => '/etc/httpd/conf/httpd.conf',
+    'service_name' => $v_service_name,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 79 - 0
web/api/v1/edit/server/mysqld/index.php

@@ -0,0 +1,79 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." mysqld ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+// List config
+exec (VESTA_CMD."v-list-sys-mysql-config json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+$v_max_user_connections = $data['CONFIG']['max_user_connections'];
+$v_max_connections = $data['CONFIG']['max_connections'];
+$v_wait_timeout = $data['CONFIG']['wait_timeout'];
+$v_interactive_timeout = $data['CONFIG']['interactive_timeout'];
+$v_max_allowed_packet = $data['CONFIG']['max_allowed_packet'];
+$v_config_path = $data['CONFIG']['config_path'];
+$v_service_name = strtoupper('mysql');
+
+# Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'max_user_connections' => $v_max_user_connections,
+    'max_connections' => $v_max_connections,
+    'wait_timeout' => $v_wait_timeout,
+    'interactive_timeout' => $v_interactive_timeout,
+    'max_allowed_packet' => $v_max_allowed_packet,
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 65 - 0
web/api/v1/edit/server/named/index.php

@@ -0,0 +1,65 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." named ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_config_path = '/etc/named.conf';
+$v_service_name = strtoupper('named');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'service_name' => $v_service_name,
+    'config_path' => $v_config_path,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 89 - 0
web/api/v1/edit/server/nginx/index.php

@@ -0,0 +1,89 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." nginx ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+// List config
+exec (VESTA_CMD."v-list-sys-nginx-config json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+$v_worker_processes = $data['CONFIG']['worker_processes'];
+$v_worker_connections = $data['CONFIG']['worker_connections'];
+$v_send_timeout = $data['CONFIG']['send_timeout'];
+$v_proxy_connect_timeout = $data['CONFIG']['proxy_connect_timeout'];
+$v_proxy_send_timeout = $data['CONFIG']['proxy_send_timeout'];
+$v_proxy_read_timeout = $data['CONFIG']['proxy_read_timeout'];
+$v_client_max_body_size = $data['CONFIG']['client_max_body_size'];
+$v_gzip = $data['CONFIG']['gzip'];
+$v_gzip_comp_level = $data['CONFIG']['gzip_comp_level'];
+$v_charset = $data['CONFIG']['charset'];
+$v_config_path = $data['CONFIG']['config_path'];
+$v_service_name = strtoupper('nginx');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'worker_processes' => $data['CONFIG']['worker_processes'],
+    'worker_connections' => $data['CONFIG']['worker_connections'],
+    'send_timeout' => $data['CONFIG']['send_timeout'],
+    'proxy_connect_timeout' => $data['CONFIG']['proxy_connect_timeout'],
+    'proxy_send_timeout' => $data['CONFIG']['proxy_send_timeout'],
+    'proxy_read_timeout' => $data['CONFIG']['proxy_read_timeout'],
+    'client_max_body_size' => $data['CONFIG']['client_max_body_size'],
+    'gzip' => $data['CONFIG']['gzip'],
+    'gzip_comp_level' => $data['CONFIG']['gzip_comp_level'],
+    'charset' => $data['CONFIG']['charset'],
+    'config_path' => $data['CONFIG']['config_path'],
+    'service_name' => strtoupper('nginx'),
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 82 - 0
web/api/v1/edit/server/php-fpm/index.php

@@ -0,0 +1,82 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." php ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+// List config
+exec (VESTA_CMD."v-list-sys-php-config json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+$v_memory_limit = $data['CONFIG']['memory_limit'];
+$v_max_execution_time = $data['CONFIG']['max_execution_time'];
+$v_max_input_time = $data['CONFIG']['max_input_time'];
+$v_upload_max_filesize = $data['CONFIG']['upload_max_filesize'];
+$v_post_max_size = $data['CONFIG']['post_max_size'];
+$v_display_errors = $data['CONFIG']['display_errors'];
+$v_error_reporting = $data['CONFIG']['error_reporting'];
+$v_config_path = $data['CONFIG']['config_path'];
+
+# Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'memory_limit' => $data['CONFIG']['memory_limit'],
+    'max_execution_time' => $data['CONFIG']['max_execution_time'],
+    'max_input_time' => $data['CONFIG']['max_input_time'],
+    'upload_max_filesize' => $data['CONFIG']['upload_max_filesize'],
+    'post_max_size' => $data['CONFIG']['post_max_size'],
+    'display_errors' => $data['CONFIG']['display_errors'],
+    'error_reporting' => $data['CONFIG']['error_reporting'],
+    'config_path' => $data['CONFIG']['config_path'],
+    'web_system' => $_SESSION['WEB_SYSTEM'],
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 82 - 0
web/api/v1/edit/server/php5-fpm/index.php

@@ -0,0 +1,82 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." php ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+// List config
+exec (VESTA_CMD."v-list-sys-php-config json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+$v_memory_limit = $data['CONFIG']['memory_limit'];
+$v_max_execution_time = $data['CONFIG']['max_execution_time'];
+$v_max_input_time = $data['CONFIG']['max_input_time'];
+$v_upload_max_filesize = $data['CONFIG']['upload_max_filesize'];
+$v_post_max_size = $data['CONFIG']['post_max_size'];
+$v_display_errors = $data['CONFIG']['display_errors'];
+$v_error_reporting = $data['CONFIG']['error_reporting'];
+$v_config_path = $data['CONFIG']['config_path'];
+
+# Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'memory_limit' => $data['CONFIG']['memory_limit'],
+    'max_execution_time' => $data['CONFIG']['max_execution_time'],
+    'max_input_time' => $data['CONFIG']['max_input_time'],
+    'upload_max_filesize' => $data['CONFIG']['upload_max_filesize'],
+    'post_max_size' => $data['CONFIG']['post_max_size'],
+    'display_errors' => $data['CONFIG']['display_errors'],
+    'error_reporting' => $data['CONFIG']['error_reporting'],
+    'config_path' => $data['CONFIG']['config_path'],
+    'web_system' => $_SESSION['WEB_SYSTEM'],
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 87 - 0
web/api/v1/edit/server/postgresql/index.php

@@ -0,0 +1,87 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update option
+    if (!empty($_POST['v_options'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_options']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." postgresql-hba ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Update config
+    if ((empty($_SESSION['error_msg'])) && (!empty($_POST['v_config']))) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($new_conf);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." postgresql " .$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+// List config
+exec (VESTA_CMD."v-list-sys-pgsql-config json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+
+$v_options_path = $data['CONFIG']['pg_hba_path'];
+$v_config_path = $data['CONFIG']['config_path'];
+$v_service_name = strtoupper('postgresql');
+
+// Read config
+$v_options = shell_exec(VESTA_CMD."v-open-fs-config ".$v_options_path);
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'options_path' => $v_options_path,
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'options' => $v_options,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 65 - 0
web/api/v1/edit/server/spamassassin/index.php

@@ -0,0 +1,65 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." spamassassin ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_config_path = shell_exec(VESTA_CMD.'v-list-sys-spamd-config plain');
+$v_service_name = strtoupper('spamassassin');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 65 - 0
web/api/v1/edit/server/spamd/index.php

@@ -0,0 +1,65 @@
+<?php
+error_reporting(NULL);
+$TAB = 'SERVER';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    exit;
+}
+
+// Check POST request
+if (!empty($_POST['save'])) {
+
+    // Check token
+    if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
+        exit();
+    }
+
+    // Set restart flag
+    $v_restart = 'yes';
+    if (empty($_POST['v_restart'])) $v_restart = 'no';
+
+    // Update config
+    if (!empty($_POST['v_config'])) {
+        exec ('mktemp', $mktemp_output, $return_var);
+        $new_conf = $mktemp_output[0];
+        $fp = fopen($new_conf, 'w');
+        fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
+        fclose($fp);
+        exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." spamd ".$v_restart, $output, $return_var);
+        check_return_code($return_var,$output);
+        unset($output);
+        unlink($new_conf);
+    }
+
+    // Set success message
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = __('Changes has been saved.');
+    }
+
+}
+
+$v_config_path = shell_exec(VESTA_CMD.'v-list-sys-spamd-config plain');
+$v_service_name = strtoupper('spamassassin');
+
+// Read config
+$v_config = shell_exec(VESTA_CMD."v-open-fs-config ".$v_config_path);
+
+$result = array(
+    'config_path' => $v_config_path,
+    'service_name' => $v_service_name,
+    'config' => $v_config,
+    'error_msg' => $_SESSION['error_msg'],
+    'ok_msg' => $_SESSION['ok_msg']
+);
+
+echo json_encode($result);
+
+// Flush session messages
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);

+ 23 - 0
web/api/v1/list/backup/exclusions/index.php

@@ -0,0 +1,23 @@
+<?php
+error_reporting(NULL);
+$TAB = 'BACKUP';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
+
+// Data
+exec (VESTA_CMD."v-list-user-backup-exclusions $user json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+
+// Render page
+// render_page($user, $TAB, 'list_backup_exclusions');
+
+// Back uri
+$_SESSION['back'] = $_SERVER['REQUEST_URI'];
+
+$result = array('data' => $data);
+
+echo json_encode($result);

+ 79 - 0
web/api/v1/list/db/index.php

@@ -0,0 +1,79 @@
+<?php
+error_reporting(NULL);
+$TAB = 'DB';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Data
+exec (VESTA_CMD."v-list-databases $user json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+$data = array_reverse($data, true);
+unset($output);
+
+top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
+
+// Render page
+// render_page($user, $TAB, 'list_db');
+
+// Back uri
+$_SESSION['back'] = $_SERVER['REQUEST_URI'];
+
+list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
+foreach ($data as $key => $value) {
+  ++$i;
+
+  if ( $i == 1) {
+    $total_amount = __('1 database');
+  } else {
+    $total_amount = __('%s databases',$i);
+  }
+
+  if ($data[$key]['SUSPENDED'] == 'yes') {
+    $data[$key]['status'] = 'suspended';
+    $data[$key]['suspend_action'] = 'unsuspend' ;
+    $data[$key]['suspend_conf'] = __('UNSUSPEND_DATABASE_CONFIRMATION', $key);
+  } else {
+    $data[$key]['status'] = 'active';
+    $data[$key]['suspend_action'] = 'suspend';
+    $data[$key]['suspend_conf'] = __('SUSPEND_DATABASE_CONFIRMATION', $key);
+  }
+
+  if ($data[$key]['TYPE'] == 'mysql'){
+    $mysql = 1;
+
+    $db_myadmin_link = "http://".$http_host."/phpmyadmin/";
+    if (!empty($_SESSION['DB_PMA_URL']))
+      $db_myadmin_link = $_SESSION['DB_PMA_URL'];
+  }
+  if ($data[$key]['TYPE'] == 'pgsql'){
+    $pgsql = 1;
+    $db_pgadmin_link = "http://".$http_host."/phppgadmin/";
+    if (!empty($_SESSION['DB_PGA_URL']))
+      $db_pgadmin_link = $_SESSION['DB_PGA_URL'];
+  }
+
+  if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST'];
+  if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
+  if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpmyadmin/";
+  if (($data[$key]['TYPE'] == 'mysql') && (!empty($_SESSION['DB_PMA_URL']))) $db_admin_link = $_SESSION['DB_PMA_URL'];
+  if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
+  if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phppgadmin/";
+  if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_URL']))) $db_admin_link = $_SESSION['DB_PGA_URL'];
+
+  $data[$key]['delete_conf'] = __('DELETE_DATABASE_CONFIRMATION', $key);
+}
+
+$object = (object)[];
+$object->data = $data;
+$object->user = $user;
+$object->panel = $panel;
+$object->db_admin = $db_admin;
+$object->db_admin_link = $db_admin_link;
+$object->totalAmount = $total_amount;
+$object->databases = $databases;
+$object->dbFav = $_SESSION['favourites']['DB'];
+
+print json_encode($object);

+ 35 - 0
web/api/v1/list/directory/preview/index.php

@@ -0,0 +1,35 @@
+<?php
+error_reporting(NULL);
+
+include($_SERVER['DOCUMENT_ROOT'] . "/inc/main.php");
+
+
+if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY']))) {
+    header("Location: /filemanager-not-purchased/");
+    exit;
+}
+
+// Check login_as feature
+if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
+    $user=$_SESSION['look'];
+}
+
+if (empty($panel)) {
+    $command = VESTA_CMD."v-list-user '".$user."' 'json'";
+    exec ($command, $output, $return_var);
+    if ( $return_var > 0 ) {
+        header("Location: /error/");
+        exit;
+    }
+    $panel = json_decode(implode('', $output), true);
+}
+
+$path_a = !empty($_REQUEST['dir_a']) ? $_REQUEST['dir_a'] : '';
+$path_b = !empty($_REQUEST['dir_b']) ? $_REQUEST['dir_b'] : '';
+$GLOBAL_JS  = '<script type="text/javascript">GLOBAL.START_DIR_A = "' . $path_a . '";</script>';
+$GLOBAL_JS .= '<script type="text/javascript">GLOBAL.START_DIR_B = "' . $path_b . '";</script>';
+$GLOBAL_JS .= '<script type="text/javascript">GLOBAL.ROOT_DIR = "' . $panel[$user]['HOME'] . '";</script>';
+
+
+// Footer
+include($_SERVER['DOCUMENT_ROOT'].'/templates/file_manager/main.php');

+ 59 - 0
web/api/v1/list/firewall/banlist/index.php

@@ -0,0 +1,59 @@
+<?php
+error_reporting(NULL);
+$TAB = 'FIREWALL';
+
+header('Content-Type: application/json');
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
+// Data
+exec (VESTA_CMD."v-list-firewall-ban json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+$data = array_reverse($data, true);
+unset($output);
+$i = 0;
+
+foreach ($data as $key => $value) {
+    if ($data[$key]['SUSPENDED'] == 'yes') {
+	    $data[$key]['status'] = 'suspended';
+	    $data[$key]['suspend_action'] = 'unsuspend' ;
+	    $data[$key]['suspend_conf'] = 'UNSUSPEND_RULE_CONFIRMATION' ;
+	} else {
+	    $data[$key]['status'] = 'active';
+	    $data[$key]['suspend_action'] = 'suspend' ;
+	    $data[$key]['suspend_conf'] = 'SUSPEND_RULE_CONFIRMATION' ;
+	}
+
+	$data[$key]['delete_url'] = '/delete/firewall/banlist/?ip='.$data[$key]['ip'].'&chain='.$data[$key]['CHAIN'].'&token='.$_SESSION['token'];
+
+	if ( $i == 1) {
+	    $total_amount = __('1 rule');
+	} else {
+	    $total_amount = __('%s rules',$i);
+	}
+	++$i;
+}
+
+if ($i == 0) {
+	$total_amount = __('There are no currently banned IP');
+}
+
+// Render page
+// render_page($user, $TAB, 'list_firewall_banlist');
+
+// Back uri
+$_SESSION['back'] = $_SERVER['REQUEST_URI'];
+
+$result = array(
+	'data' => $data,
+	'total_amount' => $total_amount
+);
+
+echo json_encode($result);

+ 13 - 0
web/api/v1/list/rrd/image.php

@@ -0,0 +1,13 @@
+<?php
+error_reporting(NULL);
+session_start();
+if ($_SESSION['user'] != 'admin') exit;
+$real_path = realpath($_SERVER["DOCUMENT_ROOT"].$_SERVER['QUERY_STRING']);
+if (empty($real_path)) exit;
+$dir_name = dirname($real_path);
+$dir_name = dirname($dir_name);
+if ($dir_name != $_SERVER["DOCUMENT_ROOT"].'/rrd') exit;
+header("X-Accel-Redirect: ".$_SERVER['QUERY_STRING']);
+header("Content-Type: image/png");
+
+?>

+ 32 - 0
web/api/v1/list/rrd/index.php

@@ -0,0 +1,32 @@
+<?php
+error_reporting(NULL);
+$TAB = 'RRD';
+
+// Main include
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
+header("Content-Type: application/json");
+
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header('Location: /list/user');
+    exit;
+}
+
+// Data
+exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var);
+$data = json_decode(implode('', $output), true);
+unset($output);
+
+// Render page
+// render_page($user, $TAB, 'list_rrd');
+
+// Back uri
+$_SESSION['back'] = $_SERVER['REQUEST_URI'];
+
+$object = (object)[];
+$object->data = $data;
+$object->user = $user;
+$object->panel = $panel;
+
+print json_encode($object);

+ 11 - 0
web/api/v1/list/server/index.php

@@ -84,6 +84,17 @@ foreach ($data as $key => $value) {
 	} else {
 		$data[$key]['action_url'] = '/start/service/?srv='.$key;
 	}
+
+	$data[$key]['SYSTEM'] = __($data[$key]['SYSTEM']);
+	$data[$key]['RTIME'] = humanize_time($data[$key]['RTIME']);
+
+	$cpu = $data[$key]['CPU'] / 10;
+    $data[$key]['CPU'] = number_format($cpu, 1);
+    if ($cpu == '0.0')  $data[$key]['CPU'] = 0;
+}
+
+foreach ($sys as $key => $value) {
+	$sys[$key]['UPTIME'] = humanize_time($sys[$key]['UPTIME']);
 }
 
 // Render page

TEMPAT SAMPAH
web/api/v1/rrd/db/daily-mysql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/daily-pgsql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/monthly-mysql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/monthly-pgsql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/mysql_localhost.rrd


TEMPAT SAMPAH
web/api/v1/rrd/db/pgsql_localhost.rrd


TEMPAT SAMPAH
web/api/v1/rrd/db/weekly-mysql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/weekly-pgsql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/yearly-mysql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/db/yearly-pgsql_localhost.png


TEMPAT SAMPAH
web/api/v1/rrd/ftp/daily-ftp.png


TEMPAT SAMPAH
web/api/v1/rrd/ftp/ftp.rrd


TEMPAT SAMPAH
web/api/v1/rrd/ftp/monthly-ftp.png


TEMPAT SAMPAH
web/api/v1/rrd/ftp/weekly-ftp.png


TEMPAT SAMPAH
web/api/v1/rrd/ftp/yearly-ftp.png


TEMPAT SAMPAH
web/api/v1/rrd/la/daily-la.png


TEMPAT SAMPAH
web/api/v1/rrd/la/la.rrd


TEMPAT SAMPAH
web/api/v1/rrd/la/monthly-la.png


TEMPAT SAMPAH
web/api/v1/rrd/la/weekly-la.png


TEMPAT SAMPAH
web/api/v1/rrd/la/yearly-la.png


TEMPAT SAMPAH
web/api/v1/rrd/mail/daily-mail.png


TEMPAT SAMPAH
web/api/v1/rrd/mail/mail.rrd


TEMPAT SAMPAH
web/api/v1/rrd/mail/monthly-mail.png


TEMPAT SAMPAH
web/api/v1/rrd/mail/weekly-mail.png


TEMPAT SAMPAH
web/api/v1/rrd/mail/yearly-mail.png


TEMPAT SAMPAH
web/api/v1/rrd/mem/daily-mem.png


TEMPAT SAMPAH
web/api/v1/rrd/mem/mem.rrd


TEMPAT SAMPAH
web/api/v1/rrd/mem/monthly-mem.png


TEMPAT SAMPAH
web/api/v1/rrd/mem/weekly-mem.png


TEMPAT SAMPAH
web/api/v1/rrd/mem/yearly-mem.png


TEMPAT SAMPAH
web/api/v1/rrd/net/daily-eth0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/daily-eth1.png


TEMPAT SAMPAH
web/api/v1/rrd/net/daily-sit0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/eth0.rrd


TEMPAT SAMPAH
web/api/v1/rrd/net/eth1.rrd


TEMPAT SAMPAH
web/api/v1/rrd/net/monthly-eth0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/monthly-eth1.png


TEMPAT SAMPAH
web/api/v1/rrd/net/monthly-sit0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/sit0.rrd


TEMPAT SAMPAH
web/api/v1/rrd/net/weekly-eth0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/weekly-eth1.png


TEMPAT SAMPAH
web/api/v1/rrd/net/weekly-sit0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/yearly-eth0.png


TEMPAT SAMPAH
web/api/v1/rrd/net/yearly-eth1.png


TEMPAT SAMPAH
web/api/v1/rrd/net/yearly-sit0.png


TEMPAT SAMPAH
web/api/v1/rrd/ssh/daily-ssh.png


TEMPAT SAMPAH
web/api/v1/rrd/ssh/monthly-ssh.png


TEMPAT SAMPAH
web/api/v1/rrd/ssh/ssh.rrd


TEMPAT SAMPAH
web/api/v1/rrd/ssh/weekly-ssh.png


TEMPAT SAMPAH
web/api/v1/rrd/ssh/yearly-ssh.png


TEMPAT SAMPAH
web/api/v1/rrd/web/daily-httpd.png


TEMPAT SAMPAH
web/api/v1/rrd/web/daily-nginx.png


TEMPAT SAMPAH
web/api/v1/rrd/web/httpd.rrd


TEMPAT SAMPAH
web/api/v1/rrd/web/monthly-httpd.png


TEMPAT SAMPAH
web/api/v1/rrd/web/monthly-nginx.png


TEMPAT SAMPAH
web/api/v1/rrd/web/nginx.rrd


TEMPAT SAMPAH
web/api/v1/rrd/web/weekly-httpd.png


TEMPAT SAMPAH
web/api/v1/rrd/web/weekly-nginx.png


TEMPAT SAMPAH
web/api/v1/rrd/web/yearly-httpd.png


TEMPAT SAMPAH
web/api/v1/rrd/web/yearly-nginx.png


+ 19 - 0
web/api/v1/upload/UploadHandler.php

@@ -0,0 +1,19 @@
+<?php
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+$user = $_SESSION['user'];
+if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
+    $user=$_SESSION['look'];
+}
+
+if (!empty($_REQUEST['path'])) {
+    $path = htmlspecialchars($_REQUEST['path'], ENT_QUOTES, 'UTF-8');
+    if (!empty($_REQUEST['raw'])) {
+        header('content-type: image/jpeg');
+        passthru (VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
+        exit;
+    }
+}
+else {
+    die('File not found');
+}