web domain editing

This commit is contained in:
Serghey Rodin 2012-06-05 14:09:56 +03:00
commit 89197647fa
30 changed files with 979 additions and 79 deletions

View file

@ -1,6 +1,6 @@
<?php
// Init
//error_reporting(NULL);
error_reporting(NULL);
ob_start();
session_start();
@ -34,6 +34,7 @@ if ($_SESSION['user'] == 'admin') {
$_SESSION['error_msg'] = $error;
} else {
$data = json_decode(implode('', $output), true);
unset($output);
$v_username = $_GET['user'];
$v_password = "••••••••";
$v_email = $data[$v_username]['CONTACT'];
@ -56,8 +57,6 @@ if ($_SESSION['user'] == 'admin') {
$v_time = $data[$v_username]['TIME'];
$v_date = $data[$v_username]['DATE'];
unset($output);
exec (VESTA_CMD."v_list_user_packages json", $output, $return_var);
$packages = json_decode(implode('', $output), true);
unset($output);
@ -67,9 +66,11 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Action
if (!empty($_POST['save'])) {
$v_username = escapeshellarg($_POST['v_username']);
// Change password
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
$v_password = escapeshellarg($_POST['v_password']);
exec (VESTA_CMD."v_change_user_password ".$v_username." ".$v_password, $output, $return_var);
@ -82,6 +83,7 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Change package
if (($v_package != $_POST['v_package']) && (empty($_SESSION['error_msg']))) {
$v_package = escapeshellarg($_POST['v_package']);
exec (VESTA_CMD."v_change_user_package ".$v_username." ".$v_package, $output, $return_var);
@ -93,6 +95,7 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Change shell
if (($v_shell != $_POST['v_shell']) && (empty($_SESSION['error_msg']))) {
$v_shell = escapeshellarg($_POST['v_shell']);
exec (VESTA_CMD."v_change_user_shell ".$v_username." ".$v_shell, $output, $return_var);
@ -104,6 +107,7 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Change contact email
if (($v_email != $_POST['v_email']) && (empty($_SESSION['error_msg']))) {
$v_email = escapeshellarg($_POST['v_email']);
exec (VESTA_CMD."v_change_user_contact ".$v_username." ".$v_email, $output, $return_var);
@ -115,6 +119,7 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Change Name
if (($v_fname != $_POST['v_fname']) || ($v_lname != $_POST['v_lname']) && (empty($_SESSION['error_msg']))) {
$v_fname = escapeshellarg($_POST['v_fname']);
$v_lname = escapeshellarg($_POST['v_lname']);
@ -127,12 +132,12 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Change NameServers
if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) && (empty($_SESSION['error_msg']))) {
$v_ns1 = escapeshellarg($_POST['v_ns1']);
$v_ns2 = escapeshellarg($_POST['v_ns2']);
$v_ns3 = escapeshellarg($_POST['v_ns3']);
$v_ns4 = escapeshellarg($_POST['v_ns4']);
$ns_cmd = VESTA_CMD."v_change_user_ns ".$v_username." ".$v_ns1." ".$v_ns2;
if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3;
if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4;
@ -153,8 +158,6 @@ if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_user.html');
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
}
// Footer