Merge branch 'Flatta-move-js'

This commit is contained in:
Serghey Rodin 2016-07-05 12:14:00 +03:00
commit 121e5a6bc9
106 changed files with 1027 additions and 1667 deletions

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'CRON'; $TAB = 'CRON';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check POST request // Check POST request
@ -62,18 +61,9 @@ if (!empty($_POST['ok'])) {
} }
} }
// Header // Render
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'add_cron');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,9 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'DB'; $TAB = 'DB';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check POST request // Check POST request
@ -107,17 +107,11 @@ if (!empty($_POST['ok'])) {
} }
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Get user email // Get user email
$v_db_email = $panel[$user]['CONTACT']; $v_db_email = $panel[$user]['CONTACT'];
// List avaiable database types // List avaiable database types
$db_types = split(",",$_SESSION['DB_SYSTEM']); $db_types = split(',', $_SESSION['DB_SYSTEM']);
// List available database servers // List available database servers
$db_hosts = array(); $db_hosts = array();
@ -127,13 +121,8 @@ $db_hosts = array_merge($db_hosts, $db_hosts_tmp);
unset($db_hosts_tmp); unset($db_hosts_tmp);
unset($output); unset($output);
// Display body render_page($user, $TAB, 'add_db');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
?>

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'DNS'; $TAB = 'DNS';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check POST request for dns domain // Check POST request for dns domain
@ -138,12 +137,6 @@ if (!empty($_POST['ok_rec'])) {
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
$v_ns1 = str_replace("'", "", $v_ns1); $v_ns1 = str_replace("'", "", $v_ns1);
$v_ns2 = str_replace("'", "", $v_ns2); $v_ns2 = str_replace("'", "", $v_ns2);
$v_ns3 = str_replace("'", "", $v_ns3); $v_ns3 = str_replace("'", "", $v_ns3);
@ -154,8 +147,9 @@ $v_ns7 = str_replace("'", "", $v_ns7);
$v_ns8 = str_replace("'", "", $v_ns8); $v_ns8 = str_replace("'", "", $v_ns8);
// Display body for dns domain
if (empty($_GET['domain'])) { if (empty($_GET['domain'])) {
// Display body for dns domain
if (empty($v_ttl)) $v_ttl = 14400; if (empty($v_ttl)) $v_ttl = 14400;
if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year')); if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year'));
if (empty($v_ns1)) { if (empty($v_ns1)) {
@ -171,18 +165,16 @@ if (empty($_GET['domain'])) {
$v_ns8 = str_replace("'", "", $nameservers[7]); $v_ns8 = str_replace("'", "", $nameservers[7]);
unset($output); unset($output);
} }
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html');
render_page($user, $TAB, 'add_dns');
} else {
// Display body for dns record
$v_domain = $_GET['domain'];
render_page($user, $TAB, 'add_dns_rec');
} }
// Display body for dns record
if (!empty($_GET['domain'])) {
$v_domain = $_GET['domain'];
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns_rec.html');
}
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,8 +1,6 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'FIREWALL'; $TAB = 'FIREWALL';
// Main include // Main include
@ -49,18 +47,9 @@ if (!empty($_POST['ok'])) {
} }
} }
// Header // Render
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'add_firewall_banlist');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_firewall_banlist.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,8 +1,6 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'FIREWALL'; $TAB = 'FIREWALL';
// Main include // Main include
@ -65,18 +63,9 @@ if (!empty($_POST['ok'])) {
} }
} }
// Header // Render
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'add_firewall');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_firewall.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'IP'; $TAB = 'IP';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check user // Check user
@ -75,12 +74,6 @@ if (!empty($_POST['ok'])) {
} }
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// List network interfaces // List network interfaces
exec (VESTA_CMD."v-list-sys-interfaces 'json'", $output, $return_var); exec (VESTA_CMD."v-list-sys-interfaces 'json'", $output, $return_var);
$interfaces = json_decode(implode('', $output), true); $interfaces = json_decode(implode('', $output), true);
@ -91,12 +84,9 @@ exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var);
$users = json_decode(implode('', $output), true); $users = json_decode(implode('', $output), true);
unset($output); unset($output);
// Display body // Render
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_ip.html'); render_page($user, $TAB, 'add_ip');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'MAIL'; $TAB = 'MAIL';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
@ -179,26 +178,18 @@ if (!empty($_POST['ok_acc'])) {
} }
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Display body for mail domain
if (empty($_GET['domain'])) { if (empty($_GET['domain'])) {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_mail.html'); // Display body for mail domain
}
render_page($user, $TAB, 'add_mail');
} else {
// Display body for mail account // Display body for mail account
if (!empty($_GET['domain'])) {
$v_domain = $_GET['domain']; $v_domain = $_GET['domain'];
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_mail_acc.html'); render_page($user, $TAB, 'add_mail_acc');
} }
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'PACKAGE'; $TAB = 'PACKAGE';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check user // Check user
@ -153,12 +152,6 @@ if (!empty($_POST['ok'])) {
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// List web temmplates // List web temmplates
exec (VESTA_CMD."v-list-web-templates json", $output, $return_var); exec (VESTA_CMD."v-list-web-templates json", $output, $return_var);
$web_templates = json_decode(implode('', $output), true); $web_templates = json_decode(implode('', $output), true);
@ -208,12 +201,9 @@ if (empty($v_bandwidth)) $v_bandwidth = "'1000'";
if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd'; if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd';
if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd'; if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd';
// Display body // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_package.html'); render_page($user, $TAB, 'add_package');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'USER'; $TAB = 'USER';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check user // Check user
@ -111,12 +110,6 @@ if (!empty($_POST['ok'])) {
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// List hosting packages // List hosting packages
exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); exec (VESTA_CMD."v-list-user-packages json", $output, $return_var);
check_error($return_var); check_error($return_var);
@ -128,12 +121,9 @@ exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var);
$languages = json_decode(implode('', $output), true); $languages = json_decode(implode('', $output), true);
unset($output); unset($output);
// Display body // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_user.html'); render_page($user, $TAB, 'add_user');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'WEB'; $TAB = 'WEB';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check POST request // Check POST request
@ -333,12 +332,6 @@ if (!empty($_POST['ok'])) {
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Define user variables // Define user variables
$v_ftp_user_prepath = $panel[$user]['HOME'] . "/web"; $v_ftp_user_prepath = $panel[$user]['HOME'] . "/web";
$v_ftp_email = $panel[$user]['CONTACT']; $v_ftp_email = $panel[$user]['CONTACT'];
@ -353,12 +346,9 @@ exec (VESTA_CMD."v-list-web-stats json", $output, $return_var);
$stats = json_decode(implode('', $output), true); $stats = json_decode(implode('', $output), true);
unset($output); unset($output);
// Display body // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html'); render_page($user, $TAB, 'add_web');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -2,7 +2,6 @@
// Init // Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'BACKUP'; $TAB = 'BACKUP';
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
@ -123,18 +122,9 @@ if (!empty($_POST['save'])) {
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_backup_exclusions');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_backup_exclusions.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -75,18 +75,9 @@ if (!empty($_POST['save'])) {
} }
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_cron');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_cron.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -2,16 +2,10 @@
// Init // Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'DB'; $TAB = 'DB';
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); // Main include
include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Check database id // Check database id
if (empty($_GET['database'])) { if (empty($_GET['database'])) {
@ -87,12 +81,9 @@ if (!empty($_POST['save'])) {
} }
} }
// Display body // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_db.html'); render_page($user, $TAB, 'edit_db');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'DNS'; $TAB = 'DNS';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check domain name // Check domain name
@ -195,30 +194,16 @@ if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (!empty($_GET['reco
} }
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Render page
if (empty($_GET['record_id'])) {
// Display body for dns domain // Display body for dns domain
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) { render_page($user, $TAB, 'edit_dns');
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns.html');
} else { } else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_dns.html');
}
}
// List dns record
if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
// Display body for dns record // Display body for dns record
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns_rec.html'); render_page($user, $TAB, 'edit_dns_rec');
} }
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,8 +1,6 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'FIREWALL'; $TAB = 'FIREWALL';
// Main include // Main include
@ -82,18 +80,9 @@ if (!empty($_POST['save'])) {
} }
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_firewall');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_firewall.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'IP'; $TAB = 'IP';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check user // Check user
@ -99,18 +98,9 @@ if (!empty($_POST['save'])) {
} }
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_ip');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_ip.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,18 +1,11 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'MAIL'; $TAB = 'MAIL';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Check domain argument // Check domain argument
if (empty($_GET['domain'])) { if (empty($_GET['domain'])) {
header("Location: /list/mail/"); header("Location: /list/mail/");
@ -310,19 +303,16 @@ if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (!empty($_GET['acco
} }
} }
// Display body for mail domain
if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail.html');
}
// Render page
if (empty($_GET['account'])) {
// Display body for mail domain
render_page($user, $TAB, 'edit_mail');
} else {
// Display body for mail account // Display body for mail account
if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) { render_page($user, $TAB, 'edit_mail_acc');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail_acc.html');
} }
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'PACKAGE'; $TAB = 'PACKAGE';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
@ -224,18 +223,9 @@ if (!empty($_POST['save'])) {
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_package');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_package.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,8 +1,8 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
$TAB = 'SERVER'; $TAB = 'SERVER';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check user // Check user
@ -421,18 +421,9 @@ foreach ($sys_arr as $key => $value) {
$_SESSION[$key] = $value; $_SESSION[$key] = $value;
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_server');
// Panel
top_panel($user,$TAB);
// Display body
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_server.html');
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,10 +1,9 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
$TAB = 'USER'; $TAB = 'USER';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
@ -184,28 +183,9 @@ if (!empty($_POST['save'])) {
} }
} }
// Render page
// Header render_page($user, $TAB, 'edit_user');
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
if (!empty($_SESSION['look'])) {
top_panel($user,$TAB);
} else {
top_panel($_SESSION['user'],$TAB);
}
// Display body
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_user.html');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_user.html');
}
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,11 +1,10 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
ob_start(); ob_start();
session_start();
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
$TAB = 'WEB'; $TAB = 'WEB';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check domain argument // Check domain argument
@ -694,22 +693,9 @@ if (isset($v_ftp_users_updated)) {
} }
} }
// Header // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); render_page($user, $TAB, 'edit_web');
// Panel
top_panel($user,$TAB);
// Display body
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_web.html');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_web.html');
}
// Flush session messages // Flush session messages
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,16 +1,10 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
session_start();
$TAB = 'WEB'; $TAB = 'WEB';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Prepare values // Prepare values
if (!empty($_GET['domain'])) { if (!empty($_GET['domain'])) {
$v_domain = $_GET['domain']; $v_domain = $_GET['domain'];
@ -29,9 +23,8 @@ $_SESSION['back'] = '';
// Check POST // Check POST
if (!isset($_POST['generate'])) { if (!isset($_POST['generate'])) {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/generate_ssl.html'); render_page($user, $TAB, 'generate_ssl');
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); exit;
exit();
} }
// Check input // Check input
@ -58,10 +51,9 @@ if (!empty($errors[0])) {
} }
} }
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/generate_ssl.html'); render_page($user, $TAB, 'generate_ssl');
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
exit(); exit;
} }
// Protect input // Protect input
@ -87,10 +79,9 @@ if ($return_var != 0) {
$error = implode('<br>', $output); $error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var); if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error; $_SESSION['error_msg'] = $error;
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/generate_ssl.html'); render_page($user, $TAB, 'generate_ssl');
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
unset($_SESSION['error_msg']); unset($_SESSION['error_msg']);
exit(); exit;
} }
// OK message // OK message
@ -106,6 +97,7 @@ $v_csr = $data[$v_domain]['CSR'];
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_ssl.html'); // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); render_page($user, $TAB, 'list_ssl');
unset($_SESSION['ok_msg']); unset($_SESSION['ok_msg']);

View file

@ -95,6 +95,41 @@ function check_return_code($return_var,$output) {
} }
} }
function insert_scripts() {
@include_once(dirname(__DIR__) . '/templates/scripts.html');
}
function render_page($user, $TAB, $page) {
$__template_dir = dirname(__DIR__) . '/templates/';
// Header
include($__template_dir . 'header.html');
// Panel
top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB);
// Extarct global variables
// I think those variables should be passed via arguments
//*
extract($GLOBALS, EXTR_SKIP);
/*/
$variables = array_filter($GLOBALS, function($key){return preg_match('/^(v_|[a-z])[a-z\d]+$/', $key);}, ARRAY_FILTER_USE_KEY);
extract($variables, EXTR_OVERWRITE);
//*/
// Body
if (($_SESSION['user'] !== 'admin') && (@include($__template_dir . "user/$page.html"))) {
// User page loaded
} else {
// Not admin or user page doesn't exist
// Load admin page
@include($__template_dir . "admin/$page.html");
}
// Footer
include($__template_dir . 'footer.html');
}
function top_panel($user, $TAB) { function top_panel($user, $TAB) {
global $panel; global $panel;
$command = VESTA_CMD."v-list-user '".$user."' 'json'"; $command = VESTA_CMD."v-list-user '".$user."' 'json'";
@ -241,36 +276,6 @@ function send_email($to,$subject,$mailtext,$from) {
mail($to, $subject, $message, $header); mail($to, $subject, $message, $header);
} }
function display_error_block() {
if (!empty($_SESSION['error_msg'])) {
echo '
<div>
<script type="text/javascript">
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
},
create:function () {
$(this).closest(".ui-dialog")
.find(".ui-button:first")
.addClass("submit");
}
});
});
</script>
<div id="dialog-message" title="">
<p>'. htmlentities($_SESSION['error_msg']) .'</p>
</div>
</div>'."\n";
unset($_SESSION['error_msg']);
}
}
function list_timezones() { function list_timezones() {
$tz = new DateTimeZone('HAST'); $tz = new DateTimeZone('HAST');
$timezone_offsets['HAST'] = $tz->getOffset(new DateTime); $timezone_offsets['HAST'] = $tz->getOffset(new DateTime);

View file

@ -3,22 +3,15 @@ error_reporting(NULL);
$TAB = 'BACKUP'; $TAB = 'BACKUP';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-user-backup-exclusions $user json", $output, $return_var); exec (VESTA_CMD."v-list-user-backup-exclusions $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup_exclusions.html');
// Render page
render_page($user, $TAB, 'list_backup_exclusions');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -3,31 +3,24 @@ error_reporting(NULL);
$TAB = 'BACKUP'; $TAB = 'BACKUP';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
// Header // Data & Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data
if (empty($_GET['backup'])){ if (empty($_GET['backup'])){
exec (VESTA_CMD."v-list-user-backups $user json", $output, $return_var); exec (VESTA_CMD."v-list-user-backups $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true); $data = array_reverse($data,true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
render_page($user, $TAB, 'list_backup');
} else { } else {
exec (VESTA_CMD."v-list-user-backup $user '".escapeshellarg($_GET['backup'])."' json", $output, $return_var); exec (VESTA_CMD."v-list-user-backup $user ".escapeshellarg($_GET['backup'])." json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true); $data = array_reverse($data,true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup_detail.html');
render_page($user, $TAB, 'list_backup_detail');
} }
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,16 +1,9 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'CRON'; $TAB = 'CRON';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-cron-jobs $user json", $output, $return_var); exec (VESTA_CMD."v-list-cron-jobs $user json", $output, $return_var);
@ -18,15 +11,8 @@ $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true); $data = array_reverse($data,true);
unset($output); unset($output);
if ($_SESSION['user'] == 'admin') { // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_cron.html'); render_page($user, $TAB, 'list_cron');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_cron.html');
}
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -5,27 +5,14 @@ $TAB = 'DB';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-databases $user json", $output, $return_var); exec (VESTA_CMD."v-list-databases $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
if ($_SESSION['user'] == 'admin') { // Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_db.html'); render_page($user, $TAB, 'list_db');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_db.html');
}
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,42 +1,26 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'DNS'; $TAB = 'DNS';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header // Data & Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data
if (empty($_GET['domain'])){ if (empty($_GET['domain'])){
exec (VESTA_CMD."v-list-dns-domains $user json", $output, $return_var); exec (VESTA_CMD."v-list-dns-domains $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns.html'); render_page($user, $TAB, 'list_dns');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns.html');
}
} else { } else {
exec (VESTA_CMD."v-list-dns-records '".$user."' '".escapeshellarg($_GET['domain'])."' 'json'", $output, $return_var); exec (VESTA_CMD."v-list-dns-records '".$user."' '".escapeshellarg($_GET['domain'])."' 'json'", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns_rec.html'); render_page($user, $TAB, 'list_dns_rec');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns_rec.html');
}
} }
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,6 +1,5 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'FIREWALL'; $TAB = 'FIREWALL';
// Main include // Main include
@ -12,22 +11,14 @@ if ($_SESSION['user'] != 'admin') {
exit; exit;
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-firewall-ban json", $output, $return_var); exec (VESTA_CMD."v-list-firewall-ban json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_firewall_banlist.html');
// Render page
render_page($user, $TAB, 'list_firewall_banlist');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,6 +1,5 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'FIREWALL'; $TAB = 'FIREWALL';
// Main include // Main include
@ -12,22 +11,14 @@ if ($_SESSION['user'] != 'admin') {
exit; exit;
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-firewall json", $output, $return_var); exec (VESTA_CMD."v-list-firewall json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_firewall.html');
// Render page
render_page($user, $TAB, 'list_firewall');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,27 +1,25 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'IP'; $TAB = 'IP';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header // Check user
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); if ($_SESSION['user'] != 'admin') {
header('Location: /list/user');
// Panel exit;
top_panel($user,$TAB); }
// Data // Data
if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var); exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_ip.html');
} // Render page
render_page($user, $TAB, 'list_ip');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,15 +1,10 @@
<?php <?php
// Init
error_reporting(NULL); error_reporting(NULL);
$TAB = 'LOG'; $TAB = 'LOG';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-user-log $user json", $output, $return_var); exec (VESTA_CMD."v-list-user-log $user json", $output, $return_var);
check_error($return_var); check_error($return_var);
@ -17,7 +12,5 @@ $data = json_decode(implode('', $output), true);
$data = array_reverse($data); $data = array_reverse($data);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_log.html'); // Render page
render_page($user, $TAB, 'list_log');
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,42 +1,26 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'MAIL'; $TAB = 'MAIL';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header // Data & Render page
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data
if (empty($_GET['domain'])){ if (empty($_GET['domain'])){
exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var); exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail.html'); render_page($user, $TAB, 'list_mail');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail.html');
}
} else { } else {
exec (VESTA_CMD."v-list-mail-accounts '".$user."' '".escapeshellarg($_GET['domain'])."' json", $output, $return_var); exec (VESTA_CMD."v-list-mail-accounts '".$user."' '".escapeshellarg($_GET['domain'])."' json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html'); render_page($user, $TAB, 'list_mail_acc');
} else {
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail_acc.html');
}
} }
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -15,30 +15,20 @@ if($_REQUEST['ajax'] == 1){
$data[$key] = $note; $data[$key] = $note;
} }
echo json_encode($data); echo json_encode($data);
exit(); exit;
} }
$TAB = 'NOTIFICATIONS'; $TAB = 'NOTIFICATIONS';
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var); exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true); $data = array_reverse($data,true);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_notifications.html'); // Render page
} else { render_page($user, $TAB, 'list_notifications');
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_notifications.html');
}
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,5 +1,6 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
$TAB = 'PACKAGE'; $TAB = 'PACKAGE';
// Main include // Main include
@ -11,20 +12,13 @@ if ($_SESSION['user'] != 'admin') {
exit; exit;
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); exec (VESTA_CMD."v-list-user-packages json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html');
// Render page
render_page($user, $TAB, 'list_packages');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -5,22 +5,19 @@ $TAB = 'RRD';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header // Check user
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); if ($_SESSION['user'] != 'admin') {
header('Location: /list/user');
// Panel exit;
top_panel($user,$TAB); }
// Data // Data
if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var); exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_rrd.html');
} // Render page
render_page($user, $TAB, 'list_rrd');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -112,13 +112,6 @@ if (isset($_GET['db'])) {
exit(); exit();
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-sys-info json", $output, $return_var); exec (VESTA_CMD."v-list-sys-info json", $output, $return_var);
$sys = json_decode(implode('', $output), true); $sys = json_decode(implode('', $output), true);
@ -126,10 +119,9 @@ unset($output);
exec (VESTA_CMD."v-list-sys-services json", $output, $return_var); exec (VESTA_CMD."v-list-sys-services json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_services.html');
// Render page
render_page($user, $TAB, 'list_services');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -5,12 +5,6 @@ $TAB = 'STATS';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
if ($user == 'admin') { if ($user == 'admin') {
if (empty($_GET['user'])) { if (empty($_GET['user'])) {
@ -29,18 +23,15 @@ if ($user == 'admin') {
exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var); exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var);
$users = json_decode(implode('', $output), true); $users = json_decode(implode('', $output), true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_stats.html');
} else { } else {
exec (VESTA_CMD."v-list-user-stats $user json", $output, $return_var); exec (VESTA_CMD."v-list-user-stats $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data, true); $data = array_reverse($data, true);
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_stats.html');
} }
// Render page
render_page($user, $TAB, 'list_stats');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -5,14 +5,13 @@ $TAB = 'UPDATES';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header // Check user
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); if ($_SESSION['user'] != 'admin') {
header('Location: /list/user');
// Panel exit;
top_panel($user,$TAB); }
// Data // Data
if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-sys-vesta-updates json", $output, $return_var); exec (VESTA_CMD."v-list-sys-vesta-updates json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
unset($output); unset($output);
@ -20,11 +19,8 @@ if ($_SESSION['user'] == 'admin') {
$autoupdate = $output['0']; $autoupdate = $output['0'];
unset($output); unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_updates.html'); // Render page
} render_page($user, $TAB, 'list_updates');
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -1,19 +1,11 @@
<?php <?php
error_reporting(NULL); error_reporting(NULL);
session_start();
$TAB = 'USER'; $TAB = 'USER';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
if ($_SESSION['user'] == 'admin') {
if ($user == 'admin') { if ($user == 'admin') {
exec (VESTA_CMD . "v-list-users json", $output, $return_var); exec (VESTA_CMD . "v-list-users json", $output, $return_var);
} else { } else {
@ -21,17 +13,9 @@ if ($_SESSION['user'] == 'admin') {
} }
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true); $data = array_reverse($data,true);
display_error_block();
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_user.html'); // Render page
} else { render_page($user, $TAB, 'list_user');
exec (VESTA_CMD . "v-list-user ".$user." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
display_error_block();
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_user.html');
}
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -5,24 +5,13 @@ $TAB = 'WEB';
// Main include // Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data // Data
exec (VESTA_CMD."v-list-web-domains $user json", $output, $return_var); exec (VESTA_CMD."v-list-web-domains $user json", $output, $return_var);
$data = json_decode(implode('', $output), true); $data = json_decode(implode('', $output), true);
$data = array_reverse($data,true); $data = array_reverse($data,true);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_web.html'); // Render page
} else { render_page($user, $TAB, 'list_web');
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_web.html');
}
// Back uri // Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

1
web/phpinfo.php Normal file
View file

@ -0,0 +1 @@
<?php phpinfo();

View file

@ -1,9 +1,11 @@
<?php <?php
// Init // Init
error_reporting(NULL); error_reporting(NULL);
session_start();
$TAB = 'SEARCH'; $TAB = 'SEARCH';
$_SESSION['back'] = $_SERVER['REQUEST_URI']; $_SESSION['back'] = $_SERVER['REQUEST_URI'];
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check query // Check query
@ -18,26 +20,14 @@ if (empty($q)) {
exit; exit;
} }
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
$lang = 'ru_RU.utf8';
//setlocale(LC_ALL, $lang);
// Data // Data
$q = escapeshellarg($q); $q = escapeshellarg($q);
if ($_SESSION['user'] == 'admin') { $command = $_SESSION['user'] == 'admin'
exec (VESTA_CMD."v-search-object ".$q." json", $output, $return_var); ? "v-search-object $q json"
$data = json_decode(implode('', $output), true); : "v-search-user-object $user $q json";
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_search.html');
} else {
exec (VESTA_CMD."v-search-user-object ".$user." ".$q." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_search.html');
}
// Footer exec (VESTA_CMD . $command, $output, $return_var);
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); $data = json_decode(implode('', $output), true);
// Render page
render_page($user, $TAB, 'list_search');

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,26 +30,7 @@
<form id="vstobjects" name="v_add_db" method="post"> <form id="vstobjects" name="v_add_db" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_add_db.v_password.value = randomstring;
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
<td class="data-dotted"> <td class="data-dotted">
@ -208,8 +187,25 @@
</form> </form>
</div> </div>
<script type="text/javascript"> <?php insert_scripts(); ?>
GLOBAL.DB_USER_PREFIX = '<?php echo $user; ?>_'; <script>
GLOBAL.DB_DBNAME_PREFIX = '<?php echo $user; ?>_'; function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_db.v_password.value = randomstring;
}
GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
</script> </script>
<script type="text/javascript" src="/js/pages/add.db.js"></script> <script src="/js/pages/add.db.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,16 +30,6 @@
<form id="vstobjects" name="v_add_dns" method="post"> <form id="vstobjects" name="v_add_dns" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script language="javascript">
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -190,10 +178,17 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript">
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$(document).ready(function(){ $(document).ready(function(){
$('.add-ns-button').click(function(){ $('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length; var n = $('input[name^=v_ns]').length;
if(n < 8){ if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true); var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)}); t.find('input').attr({value:'', name:'v_ns'+(n+1)});
@ -212,11 +207,11 @@
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) })
$('.add-ns').show() $('.add-ns').show()
}) });
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
}); });
</script> </script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -122,7 +120,8 @@
</form> </form>
</div> </div>
<script type="text/javascript"> <?php insert_scripts(); ?>
GLOBAL.DNS_REC_PREFIX = '<?php echo $_GET['domain']; ?>'; <script>
GLOBAL.DNS_REC_PREFIX = <?=json_encode($_GET['domain'])?>;
</script> </script>
<script type="text/javascript" src="/js/pages/add.dns.record.js"></script> <script src="/js/pages/add.dns.record.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,16 +30,6 @@
<form id="vstobjects" name="v_add_ip" method="post"> <form id="vstobjects" name="v_add_ip" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -129,3 +117,11 @@
</from> </from>
</div> </div>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,16 +30,6 @@
<form id="vstobjects" name="v_add_ip" method="post"> <form id="vstobjects" name="v_add_ip" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -96,3 +84,11 @@
</table> </table>
</from> </from>
</div> </div>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,16 +30,6 @@
<form id="vstobjects" name="v_add_ip" method="post"> <form id="vstobjects" name="v_add_ip" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -157,3 +145,11 @@
</table> </table>
</form> </form>
</div> </div>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,53 +30,6 @@
<form id="vstobjects" name="v_add_mail_acc" method="post"> <form id="vstobjects" name="v_add_mail_acc" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok_acc" value="add" /> <input type="hidden" name="ok_acc" value="add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_add_mail_acc.v_password.value = randomstring;
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text(randomstring);
else
$('#v_password').text(Array(randomstring.length+1).join('*'));
}
$(document).ready(function() {
$('#v_account').text($('input[name=v_account]').val());
$('#v_password').text($('input[name=v_password]').val());
$('input[name=v_account]').change(function(){
$('#v_account').text($(this).val());
});
$('input[name=v_password]').change(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($(this).val());
else
$('#v_password').text(Array($(this).val().length+1).join('*'));
});
$('.toggle-psw-visibility-icon').click(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($('input[name=v_password]').val());
else
$('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
});
});
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -229,4 +180,51 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript" src="/js/pages/edit.package.js"></script>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_mail_acc.v_password.value = randomstring;
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text(randomstring);
else
$('#v_password').text(Array(randomstring.length+1).join('*'));
}
$(document).ready(function() {
$('#v_account').text($('input[name=v_account]').val());
$('#v_password').text($('input[name=v_password]').val());
$('input[name=v_account]').change(function(){
$('#v_account').text($(this).val());
});
$('input[name=v_password]').change(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($(this).val());
else
$('#v_password').text(Array($(this).val().length+1).join('*'));
});
$('.toggle-psw-visibility-icon').click(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($('input[name=v_password]').val());
else
$('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
});
});
</script>
<script src="/js/pages/edit.package.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -380,11 +378,12 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript" src="/js/pages/add.package.js"></script>
<script type="text/javascript"> <?php insert_scripts(); ?>
<script>
$(document).ready(function(){ $(document).ready(function(){
$('.add-ns-button').click(function(){ $('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length; var n = $('input[name^=v_ns]').length;
if(n < 8){ if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true); var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)}); t.find('input').attr({value:'', name:'v_ns'+(n+1)});
@ -401,13 +400,13 @@
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)}); $(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
$('.add-ns').show() $('.add-ns').show();
}) });
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
}); });
</script> </script>
<script src="/js/pages/add.package.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
@ -34,24 +32,6 @@
<form id="vstobjects" name="v_add_user" method="post"> <form id="vstobjects" name="v_add_user" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
$(function() {
$("#v_email").change(function() {
document.getElementById('v_notify').value = document.getElementById('v_email').value;
});
});
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_add_user.v_password.value = randomstring;
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -189,3 +169,23 @@
</table> </table>
</form> </form>
</div> </div>
<?php insert_scripts(); ?>
<script>
$(function() {
$('#v_email').change(function() {
document.getElementById('v_notify').value = document.getElementById('v_email').value;
});
});
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_user.v_password.value = randomstring;
}
</script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -33,44 +31,6 @@
<form id="vstobjects" name="v_add_web" method="post"> <form id="vstobjects" name="v_add_web" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" /> <input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
$(function() {
$("#v_domain").change(function() {
var prefix = 'www.';
document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
});
});
function WEBrandom() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var webrandom = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substring(rnum,rnum+1);
}
document.v_add_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var ftprandomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substring(rnum,rnum+1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
@ -429,14 +389,49 @@
</div> </div>
</div> </div>
<?php insert_scripts(); ?>
<script>
$(function() {
$('#v_domain').change(function() {
var prefix = 'www.';
document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
});
});
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_add_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
<script type="text/javascript">
GLOBAL.FTP_USER_PREFIX = '<?php echo $user; ?>_';
GLOBAL.FTP_USER_PREPATH = '<?php echo $v_ftp_user_prepath; ?>';
$('#vstobjects').bind('submit', function(evt) { $('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) { $('input[disabled]').each(function(i, elm) {
$(elm).removeAttr('disabled'); $(elm).removeAttr('disabled');
}); });
}); });
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user)?>;
GLOBAL.FTP_USER_PREPATH = <?=json_encode($v_ftp_user_prepath)?>;
</script> </script>
<script type="text/javascript" src="/js/pages/add.web.js"></script> <script src="/js/pages/add.web.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,26 +30,6 @@
<form id="vstobjects" name="v_edit_db" method="post" class="<?=$v_status?>"> <form id="vstobjects" name="v_edit_db" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_db.v_password.value = randomstring;
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
@ -146,8 +124,26 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript">
GLOBAL.DB_USER_PREFIX = '<?php echo $user; ?>_'; <?php insert_scripts(); ?>
GLOBAL.DB_DBNAME_PREFIX = '<?php echo $user; ?>_'; <script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_db.v_password.value = randomstring;
}
GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
</script> </script>
<script type="text/javascript" src="/js/pages/edit.db.js"></script> <script src="/js/pages/edit.db.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,16 +30,6 @@
<form id="vstobjects" name="v_edit_firewall" method="post" class="<?=$v_status?>"> <form id="vstobjects" name="v_edit_firewall" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
@ -131,3 +119,11 @@
</table> </table>
</form> </form>
</div> </div>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,16 +30,6 @@
<form id="vstobjects" name="v_edit_ip" method="post" class="<?=$v_status?>"> <form id="vstobjects" name="v_edit_ip" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
@ -154,3 +142,11 @@
</table> </table>
</form> </form>
</div> </div>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,26 +30,6 @@
<form id="vstobjects" name="v_edit_mail_acc" method="post" class="<?=$v_status?>"> <form id="vstobjects" name="v_edit_mail_acc" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_mail_acc.v_password.value = randomstring;
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
@ -163,4 +141,23 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript" src="/js/pages/edit.mail_acc.js"></script>
<?php insert_scripts(); ?>
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_mail_acc.v_password.value = randomstring;
}
</script>
<script src="/js/pages/edit.mail_acc.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -381,11 +379,12 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript" src="/js/pages/edit.package.js"></script>
<script type="text/javascript"> <?php insert_scripts(); ?>
<script>
$(document).ready(function(){ $(document).ready(function(){
$('.add-ns-button').click(function(){ $('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length; var n = $('input[name^=v_ns]').length;
if(n < 8){ if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true); var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)}); t.find('input').attr({value:'', name:'v_ns'+(n+1)});
@ -402,13 +401,14 @@
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)}); $(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
$('.add-ns').show() $('.add-ns').show();
}) });
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
}); });
</script> </script>
<script src="/js/pages/edit.package.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -33,16 +31,7 @@
<form id="vstobjects" name="v_configure_server" method="post"> <form id="vstobjects" name="v_configure_server" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add"> <table class="data mode-add">
<tr class="data-add"> <tr class="data-add">
<td class="data-dotted"> <td class="data-dotted">
@ -779,7 +768,13 @@
</form> </form>
</div> </div>
<?php insert_scripts(); ?>
<script> <script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$(document).ready(function(){ $(document).ready(function(){
$('select[name=v_filemanager]').change(function(){ $('select[name=v_filemanager]').change(function(){
if($(this).val() == 'yes'){ if($(this).val() == 'yes'){

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,18 +30,7 @@
<form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>"> <form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_user.v_password.value = randomstring;
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
<td class="data-dotted"> <td class="data-dotted">
@ -264,10 +251,23 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript">
<?php insert_scripts(); ?>
<script>
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_user.v_password.value = randomstring;
}
$(document).ready(function(){ $(document).ready(function(){
$('.add-ns-button').click(function(){ $('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length; var n = $('input[name^=v_ns]').length;
if(n < 8){ if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true); var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)}); t.find('input').attr({value:'', name:'v_ns'+(n+1)});
@ -284,13 +284,13 @@
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)}); $(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
$('.add-ns').show() $('.add-ns').show();
}) });
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
}); });
</script> </script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,40 +30,7 @@
<form id="vstobjects" name="v_edit_web" method="post" class="<?=$v_status?>"> <form id="vstobjects" name="v_edit_web" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script language="javascript">
function WEBrandom() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var webrandom = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substring(rnum,rnum+1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var ftprandomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substring(rnum,rnum+1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
<td class="data-dotted"> <td class="data-dotted">
@ -485,8 +450,38 @@
</table> </table>
</div> </div>
</div> </div>
<script type="text/javascript">
GLOBAL.FTP_USER_PREFIX = '<?php echo $user; ?>_'; <?php insert_scripts(); ?>
<script>
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$('#vstobjects').bind('submit', function(evt) { $('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) { $('input[disabled]').each(function(i, elm) {
var copy_elm = $(elm).clone(true); var copy_elm = $(elm).clone(true);
@ -495,6 +490,7 @@
$(elm).after(copy_elm); $(elm).after(copy_elm);
}); });
}); });
</script>
<script type="text/javascript" src="/js/pages/edit.web.js"></script>
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user.'_')?>;
</script>
<script src="/js/pages/edit.web.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -32,11 +32,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -30,11 +30,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -29,11 +29,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -51,11 +51,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -72,11 +72,7 @@
</table> </table>
<!-- --> <!-- -->
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -42,11 +42,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -32,11 +32,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -45,11 +45,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -30,11 +30,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -42,11 +42,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -14,9 +14,6 @@
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -50,11 +50,7 @@
</table> </table>
<!-- --> <!-- -->
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -49,11 +49,7 @@
</table> </table>
<!-- --> <!-- -->
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -37,11 +37,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -41,11 +41,7 @@
</tr> </tr>
</table> </table>
</div --> </div -->
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -23,9 +23,6 @@
</table> </table>
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>
@ -75,29 +72,9 @@
if ($key == $user) { if ($key == $user) {
?> ?>
<div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/logout"><?=__('logout')?> <i></i></a><span class="shortcut">&nbsp;L</span></div> <div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/logout"><?=__('logout')?> <i></i></a><span class="shortcut">&nbsp;L</span></div>
<? <?php
if (!empty($_SESSION['look_alert'])) { } else {
?> ?>
<script type="text/javascript">
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
},
}
});
});
</script>
<div id="dialog-message" title="<?=__('Welcome')?>">
<p class="confirmation"><?=__('LOGGED_IN_AS',$key)?></p>
</div>
<?
unset($_SESSION['look_alert']);
}
} else { ?>
<div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/login/?loginas=<?=$data[$key]['USER']?>&token=<?=$_SESSION['token']?>""><?=__('login as')?> <i></i></a><span class="shortcut">&nbsp;L</span></div> <div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/login/?loginas=<?=$data[$key]['USER']?>&token=<?=$_SESSION['token']?>""><?=__('login as')?> <i></i></a><span class="shortcut">&nbsp;L</span></div>
<? } <? }
} }

View file

@ -36,9 +36,6 @@
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -37,11 +37,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -35,11 +35,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -54,11 +54,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>
@ -96,38 +92,9 @@ sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DI
if ($key == $user) { if ($key == $user) {
?> ?>
<div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/logout"><?=__('logout')?> <i></i></a><span class="shortcut">&nbsp;L</span></div> <div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/logout"><?=__('logout')?> <i></i></a><span class="shortcut">&nbsp;L</span></div>
<? <?php
if (!empty($_SESSION['look_alert'])) { } else {
?> ?>
<script type="text/javascript">
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
},
},
create:function () {
$(this).closest(".ui-dialog")
.find(".ui-button:first")
.addClass("submit");
$(this).closest(".ui-dialog")
.find(".ui-button")
.eq(1) // the first button
.addClass("cancel");
}
});
});
</script>
<div id="dialog-message" title="<?=__('Welcome')?>">
<p class="confirmation"><?=__('LOGGED_IN_AS',$key)?></p>
</div>
<?
unset($_SESSION['look_alert']);
}
} else { ?>
<div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>""><?=__('login as').' '.$key?> <i></i></a><span class="shortcut">&nbsp;L</span></div> <div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>""><?=__('login as').' '.$key?> <i></i></a><span class="shortcut">&nbsp;L</span></div>
<?}?> <?}?>
<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>"><?=__('edit')?> <i></i></a><span class="shortcut enter">&nbsp;&#8629;</span></div> <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>"><?=__('edit')?> <i></i></a><span class="shortcut enter">&nbsp;&#8629;</span></div>

View file

@ -38,17 +38,14 @@
</select> </select>
</div> </div>
<input type="submit" class="l-sort-toolbar__filter-apply" value=""/> <input type="submit" class="l-sort-toolbar__filter-apply" value=""/>
</div>
</td> </td>
</tr> </tr>
</table> </table>
<!-- --> <!-- -->
</div> </div>
</div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>
</div>
<div class="l-separator"></div> <div class="l-separator"></div>
<!-- /.l-separator --> <!-- /.l-separator -->

View file

@ -1,15 +1,69 @@
<?php
// Insert script elements if it isn't loaded yet
insert_scripts();
?>
</div> </div>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js?1446554103"></script>
<script type="text/javascript" src="/js/jquery.cookie.js?1446554103"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.20.custom.min.js?1467113876"></script>
<script type="text/javascript" src="/js/hotkeys.js?1446554103"></script>
<script type="text/javascript" src="/js/events.js?1446554103"></script>
<script type="text/javascript" src="/js/app.js?1446554103"></script>
<script type="text/javascript" src="/js/templates.js?1446554103"></script>
<script src="/js/jquery.finder.js"></script>
<script> <script>
$(document).ready(function(){ hover_menu(); }); </script> $(function() {
hover_menu();
});
</script>
<?php
// Dialogs
// todo: display all the dialogs?
if (!empty($_SESSION['look_alert'])):
?>
<script>
$(function() {
$('#dialog:ui-dialog').dialog('destroy');
$('#dialog-message').dialog({
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
});
</script>
<div id="dialog-message" title="<?=__('Welcome')?>">
<p class="confirmation"><?=__('LOGGED_IN_AS', $_SESSION['look'])?></p>
</div>
<?php
unset($_SESSION['look_alert']);
elseif (!empty($_SESSION['error_msg'])):
?>
<div>
<script>
$(function() {
$('#dialog:ui-dialog').dialog('destroy');
$('#dialog-message').dialog({
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
},
create: function() {
$(this)
.closest('.ui-dialog')
.find('.ui-button:first')
.addClass('submit');
}
});
});
</script>
<div id="dialog-message" title="">
<p><?=htmlentities($_SESSION['error_msg'])?></p>
</div>
</div>
<?php
unset($_SESSION['error_msg']);
endif;
?>
<div title="Confirmation" class="confirmation-text-redirect hidden"> <div title="Confirmation" class="confirmation-text-redirect hidden">
<p class="confirmation"><?=__('LEAVE_PAGE_CONFIRMATION')?></p> <p class="confirmation"><?=__('LEAVE_PAGE_CONFIRMATION')?></p>

View file

@ -0,0 +1,8 @@
<script src="/js/jquery-1.7.2.min.js?1446554103"></script>
<script src="/js/jquery.cookie.js?1446554103"></script>
<script src="/js/jquery-ui-1.8.20.custom.min.js?1467113876"></script>
<script src="/js/hotkeys.js?1446554103"></script>
<script src="/js/events.js?1446554103"></script>
<script src="/js/app.js?1446554103"></script>
<script src="/js/templates.js?1446554103"></script>
<script src="/js/jquery.finder.js"></script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,18 +30,7 @@
<form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>"> <form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script type="text/javascript">
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_user.v_password.value = randomstring;
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
<td class="data-dotted"> <td class="data-dotted">
@ -232,10 +219,23 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript">
<?php insert_scripts(); ?>
<script>
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_user.v_password.value = randomstring;
}
$(document).ready(function(){ $(document).ready(function(){
$('.add-ns-button').click(function(){ $('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length; var n = $('input[name^=v_ns]').length;
if(n < 8){ if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true); var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)}); t.find('input').attr({value:'', name:'v_ns'+(n+1)});
@ -252,13 +252,13 @@
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)}); $(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
$('.add-ns').show() $('.add-ns').show();
}) });
$('input[name^=v_ns]').each(function(i, ns){ $('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show(); i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
}) });
}); });
</script> </script>

View file

@ -12,9 +12,7 @@
} }
?> ?>
</div> </div>
</div> </div>
<? display_error_block() ?>
</div> </div>
<div class="l-separator"></div> <div class="l-separator"></div>
@ -32,40 +30,7 @@
<form id="vstobjects" name="v_edit_web" method="post" class="<?=$v_status?>"> <form id="vstobjects" name="v_edit_web" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" /> <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" /> <input type="hidden" name="save" value="save" />
<script language="javascript">
function WEBrandom() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var webrandom = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substring(rnum,rnum+1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var ftprandomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substring(rnum,rnum+1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'> <table class='data'>
<tr class="data-add"> <tr class="data-add">
<td class="data-dotted"> <td class="data-dotted">
@ -414,8 +379,38 @@
</table> </table>
</div> </div>
</div> </div>
<script type="text/javascript">
GLOBAL.FTP_USER_PREFIX = '<?php echo $user; ?>_'; <?php insert_scripts(); ?>
<script>
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$('#vstobjects').bind('submit', function(evt) { $('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) { $('input[disabled]').each(function(i, elm) {
var copy_elm = $(elm).clone(true); var copy_elm = $(elm).clone(true);
@ -424,6 +419,7 @@
$(elm).after(copy_elm); $(elm).after(copy_elm);
}); });
}); });
</script>
<script type="text/javascript" src="/js/pages/edit.web.js"></script>
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user.'_')?>;
</script>
<script src="/js/pages/edit.web.js"></script>

View file

@ -49,11 +49,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -71,11 +71,7 @@
</table> </table>
<!-- --> <!-- -->
</div> </div>
</div> </div>
<? display_error_block() ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -41,11 +41,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

View file

@ -30,11 +30,7 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<? display_error_block(); ?>
<!-- /.l-sort --> <!-- /.l-sort -->
</div> </div>

Some files were not shown because too many files have changed in this diff Show more