Skip to content

Commit

Permalink
UI update
Browse files Browse the repository at this point in the history
  • Loading branch information
serghey-rodin committed Jun 2, 2015
1 parent 0f7110b commit 527e4a9
Show file tree
Hide file tree
Showing 139 changed files with 2,046 additions and 124 deletions.
6 changes: 6 additions & 0 deletions web/add/cron/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if ((!isset($_POST['v_min'])) || ($_POST['v_min'] == '')) $errors[] = __('minute');
if ((!isset($_POST['v_hour'])) || ($_POST['v_hour'] == '')) $errors[] = __('hour');
Expand Down
8 changes: 7 additions & 1 deletion web/add/db/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_database'])) $errors[] = __('database');
if (empty($_POST['v_dbuser'])) $errors[] = __('username');
Expand Down Expand Up @@ -91,7 +97,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',$user."_".$_POST['v_database'],$user."_".$_POST['v_database']);
$_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',htmlentities($user)."_".htmlentities($_POST['v_database']),htmlentities($user)."_".htmlentities($_POST['v_database']));
$_SESSION['ok_msg'] .= " / <a href=".$db_admin_link." target='_blank'>" . __('open %s',$db_admin) . "</a>";
unset($v_database);
unset($v_dbuser);
Expand Down
16 changes: 14 additions & 2 deletions web/add/dns/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
// Check POST request for dns domain
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_domain'])) $errors[] = __('domain');
if (empty($_POST['v_ip'])) $errors[] = __('ip');
Expand Down Expand Up @@ -70,7 +76,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('DNS_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
$_SESSION['ok_msg'] = __('DNS_DOMAIN_CREATED_OK',htmlentities($_POST[v_domain]),htmlentities($_POST[v_domain]));
unset($v_domain);
}
}
Expand All @@ -79,6 +85,12 @@
// Check POST request for dns record
if (!empty($_POST['ok_rec'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_domain'])) $errors[] = 'domain';
if (empty($_POST['v_rec'])) $errors[] = 'record';
Expand Down Expand Up @@ -112,7 +124,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('DNS_RECORD_CREATED_OK',$_POST[v_rec],$_POST[v_domain]);
$_SESSION['ok_msg'] = __('DNS_RECORD_CREATED_OK',htmlentities($_POST[v_rec]),htmlentities($_POST[v_domain]));
unset($v_domain);
unset($v_rec);
unset($v_val);
Expand Down
6 changes: 6 additions & 0 deletions web/add/firewall/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_action'])) $errors[] = __('action');
if (empty($_POST['v_protocol'])) $errors[] = __('protocol');
Expand Down
8 changes: 7 additions & 1 deletion web/add/ip/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_ip'])) $errors[] = __('ip address');
if (empty($_POST['v_netmask'])) $errors[] = __('netmask');
Expand Down Expand Up @@ -61,7 +67,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('IP_CREATED_OK',$_POST['v_ip'],$_POST['v_ip']);
$_SESSION['ok_msg'] = __('IP_CREATED_OK',htmlentities($_POST['v_ip']),htmlentities($_POST['v_ip']));
unset($v_ip);
unset($v_netmask);
unset($v_name);
Expand Down
16 changes: 14 additions & 2 deletions web/add/mail/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// Check POST request for mail domain
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_domain'])) $errors[] = __('domain');
if (!empty($errors[0])) {
Expand Down Expand Up @@ -59,7 +65,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('MAIL_DOMAIN_CREATED_OK',$_POST['v_domain'],$_POST['v_domain']);
$_SESSION['ok_msg'] = __('MAIL_DOMAIN_CREATED_OK',htmlentities($_POST['v_domain']),htmlentities($_POST['v_domain']));
unset($v_domain);
}
}
Expand All @@ -68,6 +74,12 @@
// Check POST request for mail account
if (!empty($_POST['ok_acc'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_domain'])) $errors[] = __('domain');
if (empty($_POST['v_account'])) $errors[] = __('account');
Expand Down Expand Up @@ -156,7 +168,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',strtolower($_POST['v_account']),$_POST[v_domain],strtolower($_POST['v_account']),$_POST[v_domain]);
$_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',htmlentities(strtolower($_POST['v_account'])),htmlentities($_POST[v_domain]),htmlentities(strtolower($_POST['v_account'])),htmlentities($_POST[v_domain]));
$_SESSION['ok_msg'] .= " / <a href=".$webmail." target='_blank'>" . __('open webmail') . "</a>";
unset($v_account);
unset($v_password);
Expand Down
10 changes: 8 additions & 2 deletions web/add/package/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_package'])) $errors[] = __('package');
if (empty($_POST['v_web_template'])) $errors[] = __('web template');
if (!empty($_SESSION['WEB_SYSTEM'])) {
if (!empty($_SESSION['WEB_BACKEND'])) {
if (empty($_POST['v_backend_template'])) $errors[] = __('backend template');
}
if (!empty($_SESSION['PROXY_SYSTEM'])) {
Expand Down Expand Up @@ -132,7 +138,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('PACKAGE_CREATED_OK',$_POST['v_package'],$_POST['v_package']);
$_SESSION['ok_msg'] = __('PACKAGE_CREATED_OK',htmlentities($_POST['v_package']),htmlentities($_POST['v_package']));
unset($v_package);
}

Expand Down
10 changes: 8 additions & 2 deletions web/add/user/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check empty fields
if (empty($_POST['v_username'])) $errors[] = __('user');
if (empty($_POST['v_password'])) $errors[] = __('password');
Expand Down Expand Up @@ -93,8 +99,8 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('USER_CREATED_OK',$_POST['v_username'],$_POST['v_username']);
$_SESSION['ok_msg'] .= " / <a href=/login/?loginas=".$_POST['v_username'].">" . __('login as') ." ".$_POST['v_username']. "</a>";
$_SESSION['ok_msg'] = __('USER_CREATED_OK',htmlentities($_POST['v_username']),htmlentities($_POST['v_username']));
$_SESSION['ok_msg'] .= " / <a href=/login/?loginas=".htmlentities($_POST['v_username']).">" . __('login as') ." ".htmlentities($_POST['v_username']). "</a>";
unset($v_username);
unset($v_password);
unset($v_email);
Expand Down
10 changes: 8 additions & 2 deletions web/add/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
// Check POST request
if (!empty($_POST['ok'])) {

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check for empty fields
if (empty($_POST['v_domain'])) $errors[] = __('domain');
if (empty($_POST['v_ip'])) $errors[] = __('ip');
Expand Down Expand Up @@ -314,7 +320,7 @@
}

if (!empty($_SESSION['error_msg']) && $domain_added) {
$_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
$_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',htmlentities($_POST[v_domain]),htmlentities($_POST[v_domain]));
$_SESSION['flash_error_msg'] = $_SESSION['error_msg'];
$url = '/edit/web/?domain='.strtolower(preg_replace("/^www\./i", "", $_POST['v_domain']));
header('Location: ' . $url);
Expand All @@ -324,7 +330,7 @@

// Flush field values on success
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
$_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',htmlentities($_POST[v_domain]),htmlentities($_POST[v_domain]));
unset($v_domain);
unset($v_aliases);
unset($v_ssl);
Expand Down
6 changes: 6 additions & 0 deletions web/bulk/backup/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
$backup = $_POST['backup'];
$action = $_POST['action'];

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

switch ($action) {
case 'delete': $cmd='v-delete-user-backup';
break;
Expand Down
6 changes: 6 additions & 0 deletions web/bulk/cron/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$job = $_POST['job'];
$action = $_POST['action'];

Expand Down
6 changes: 6 additions & 0 deletions web/bulk/db/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$database = $_POST['database'];
$action = $_POST['action'];

Expand Down
6 changes: 6 additions & 0 deletions web/bulk/dns/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$domain = $_POST['domain'];
$record = $_POST['record'];
$action = $_POST['action'];
Expand Down
6 changes: 6 additions & 0 deletions web/bulk/firewall/banlist/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
Expand Down
6 changes: 6 additions & 0 deletions web/bulk/firewall/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
Expand Down
6 changes: 6 additions & 0 deletions web/bulk/ip/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$ip = $_POST['ip'];
$action = $_POST['action'];

Expand Down
6 changes: 6 additions & 0 deletions web/bulk/mail/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$domain = $_POST['domain'];
$account = $_POST['account'];
$action = $_POST['action'];
Expand Down
6 changes: 6 additions & 0 deletions web/bulk/package/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$package = $_POST['package'];
$action = $_POST['action'];

Expand Down
6 changes: 6 additions & 0 deletions web/bulk/restore/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$action = $_POST['action'];
$backup = escapeshellarg($_POST['backup']);

Expand Down
6 changes: 6 additions & 0 deletions web/bulk/service/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$service = $_POST['service'];
$action = $_POST['action'];

Expand Down
6 changes: 6 additions & 0 deletions web/bulk/user/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");

// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
}

$user = $_POST['user'];
$action = $_POST['action'];

Expand Down
Loading

0 comments on commit 527e4a9

Please sign in to comment.