Skip to content

Commit 60f9f27

Browse files
committed
UI improvements
1 parent f11c778 commit 60f9f27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+256
-125
lines changed

web/css/styles.min.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,10 @@ div.l-content > div.l-separator:nth-of-type(4) {
10801080
display: inline-block;
10811081
border-style: solid none solid solid;
10821082
}
1083+
.lang-ru .l-select {
1084+
width: 199px;
1085+
}
1086+
10831087
.l-select:after {
10841088
pointer-events: none;
10851089
background-image: url("/images/sprite.png");
@@ -1104,6 +1108,9 @@ div.l-content > div.l-separator:nth-of-type(4) {
11041108
border: 0;
11051109
outline: 0;
11061110
}
1111+
.lang-ru .l-select select {
1112+
min-width: 215px;
1113+
}
11071114
.l-select select option {
11081115
padding: 7px;
11091116
}
@@ -1342,6 +1349,7 @@ div.l-content > div.l-separator:nth-of-type(4) {
13421349

13431350
.l-unit__stat-col--right {
13441351
float: left;
1352+
max-width: 152px;
13451353
}
13461354

13471355
.l-unit-toolbar__col--left {
@@ -1988,7 +1996,7 @@ div.l-content > div.l-separator:nth-of-type(4) {
19881996
height: 16px;
19891997
overflow: hidden;
19901998
padding-top: 6px;
1991-
width: 600px;
1999+
max-width: 600px;
19922000
}
19932001

19942002
.vst-ok a {
@@ -2362,6 +2370,10 @@ td.hint {
23622370
vertical-align: top;
23632371
width: 500px;
23642372
}
2373+
2374+
.login a.error {
2375+
color: #BE5ABF;
2376+
}
23652377
.vestacp {
23662378
color: #505050;
23672379
font-size: 10px;

web/edit/db/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
$v_username = $user;
3636
$v_database = $_GET['database'];
3737
$v_dbuser = $data[$v_database]['DBUSER'];
38-
$v_password = "••••••••";
38+
$v_password = "";
3939
$v_host = $data[$v_database]['HOST'];
4040
$v_type = $data[$v_database]['TYPE'];
4141
$v_charset = $data[$v_database]['CHARSET'];
@@ -63,7 +63,7 @@
6363
}
6464

6565
// Change database password
66-
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
66+
if ((!empty($_POST['v_password'])) && (empty($_SESSION['error_msg']))) {
6767
$v_password = tempnam("/tmp","vst");
6868
$fp = fopen($v_password, "w");
6969
fwrite($fp, $_POST['v_password']."\n");
@@ -72,7 +72,7 @@
7272
check_return_code($return_var,$output);
7373
unset($output);
7474
unlink($v_password);
75-
$v_password = "••••••••";
75+
$v_password = escapeshellarg($_POST['v_password']);
7676
}
7777

7878
// Set success message

web/edit/mail/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
$v_username = $user;
6161
$v_domain = $_GET['domain'];
6262
$v_account = $_GET['account'];
63-
$v_password = "••••••••";
63+
$v_password = "";
6464
$v_aliases = str_replace(',', "\n", $data[$v_account]['ALIAS']);
6565
$valiases = explode(",", $data[$v_account]['ALIAS']);
6666
$v_fwd = str_replace(',', "\n", $data[$v_account]['FWD']);
@@ -177,7 +177,7 @@
177177
$v_account = escapeshellarg($_POST['v_account']);
178178

179179
// Change password
180-
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
180+
if ((!empty($_POST['v_password'])) && (empty($_SESSION['error_msg']))) {
181181
$v_password = tempnam("/tmp","vst");
182182
$fp = fopen($v_password, "w");
183183
fwrite($fp, $_POST['v_password']."\n");
@@ -186,7 +186,7 @@
186186
check_return_code($return_var,$output);
187187
unset($output);
188188
unlink($v_password);
189-
$v_password = "••••••••";
189+
$v_password = escapeshellarg($_POST['v_password']);;
190190
}
191191

192192
// Change quota

web/edit/user/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
unset($output);
3333

3434
// Parse user
35-
$v_password = "••••••••";
35+
$v_password = "";
3636
$v_email = $data[$v_username]['CONTACT'];
3737
$v_package = $data[$v_username]['PACKAGE'];
3838
$v_language = $data[$v_username]['LANGUAGE'];
@@ -75,7 +75,7 @@
7575
if (!empty($_POST['save'])) {
7676

7777
// Change password
78-
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
78+
if ((!empty($_POST['v_password'])) && (empty($_SESSION['error_msg']))) {
7979
$v_password = tempnam("/tmp","vst");
8080
$fp = fopen($v_password, "w");
8181
fwrite($fp, $_POST['v_password']."\n");
@@ -84,7 +84,7 @@
8484
check_return_code($return_var,$output);
8585
unset($output);
8686
unlink($v_password);
87-
$v_password = "••••••••";
87+
$v_password = escapeshellarg($_POST['v_password']);
8888
}
8989

9090
// Change package (admin only)

web/edit/web/index.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@
5151
$v_proxy_ext = str_replace(',', ', ', $data[$v_domain]['PROXY_EXT']);
5252
$v_stats = $data[$v_domain]['STATS'];
5353
$v_stats_user = $data[$v_domain]['STATS_USER'];
54-
if (!empty($v_stats_user)) $v_stats_password = "••••••••";
54+
if (!empty($v_stats_user)) $v_stats_password = "";
5555
$v_ftp_user = $data[$v_domain]['FTP_USER'];
56-
if (!empty($v_ftp_user)) $v_ftp_password = "••••••••";
56+
$v_ftp_path = $data[$v_domain]['FTP_PATH'];
57+
if (!empty($v_ftp_user)) $v_ftp_password = "";
5758
$v_ftp_user_prepath = $data[$v_domain]['DOCUMENT_ROOT'];
5859
$v_ftp_user_prepath = str_replace('/public_html', '', $v_ftp_user_prepath, $occurance = 1);
5960
$v_ftp_email = $panel[$user]['CONTACT'];
@@ -430,7 +431,6 @@
430431
// Change web stats user or password
431432
if ((empty($v_stats_user)) && (!empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
432433
if (empty($_POST['v_stats_user'])) $errors[] = __('stats username');
433-
if (empty($_POST['v_stats_password'])) $errors[] = __('stats password');
434434
if (!empty($errors[0])) {
435435
foreach ($errors as $i => $error) {
436436
if ( $i == 0 ) {
@@ -450,14 +450,13 @@
450450
check_return_code($return_var,$output);
451451
unset($output);
452452
unlink($v_stats_password);
453-
$v_stats_password = "••••••••";
453+
$v_stats_password = escapeshellarg($_POST['v_stats_password']);
454454
}
455455
}
456456

457457
// Add web stats authorization
458458
if ((!empty($v_stats_user)) && (!empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
459459
if (empty($_POST['v_stats_user'])) $errors[] = __('stats user');
460-
if (empty($_POST['v_stats_password'])) $errors[] = __('stats password');
461460
if (!empty($errors[0])) {
462461
foreach ($errors as $i => $error) {
463462
if ( $i == 0 ) {
@@ -468,7 +467,7 @@
468467
}
469468
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
470469
}
471-
if (($v_stats_user != $_POST['v_stats_user']) || ($_POST['v_stats_password'] != "••••••••" ) && (empty($_SESSION['error_msg']))) {
470+
if (($v_stats_user != $_POST['v_stats_user']) || (!empty($_POST['v_stats_password'])) && (empty($_SESSION['error_msg']))) {
472471
$v_stats_user = escapeshellarg($_POST['v_stats_user']);
473472
$v_stats_password = tempnam("/tmp","vst");
474473
$fp = fopen($v_stats_password, "w");
@@ -478,22 +477,22 @@
478477
check_return_code($return_var,$output);
479478
unset($output);
480479
unlink($v_stats_password);
481-
$v_stats_password = "••••••••";
480+
$v_stats_password = escapeshellarg($_POST['v_stats_password']);
482481
}
483482
}
484483

485-
// Change ftp accounts
484+
// Update ftp account
486485
if (!empty($_POST['v_ftp_user'])) {
487486
$v_ftp_users_updated = array();
488487
foreach ($_POST['v_ftp_user'] as $i => $v_ftp_user_data) {
489-
if (empty($v_ftp_user_data['v_ftp_user']) && empty($v_ftp_user_data['v_ftp_password'])) {
488+
if (empty($v_ftp_user_data['v_ftp_user'])) {
490489
continue;
491490
}
491+
492492
$v_ftp_user_data['v_ftp_user'] = preg_replace("/^".$user."_/i", "", $v_ftp_user_data['v_ftp_user']);
493493
if ($v_ftp_user_data['is_new'] == 1 && !empty($_POST['v_ftp'])) {
494494
if ((!empty($v_ftp_user_data['v_ftp_email'])) && (!filter_var($v_ftp_user_data['v_ftp_email'], FILTER_VALIDATE_EMAIL))) $_SESSION['error_msg'] = __('Please enter valid email address.');
495495
if (empty($v_ftp_user_data['v_ftp_user'])) $errors[] = 'ftp user';
496-
if (empty($v_ftp_user_data['v_ftp_password'])) $errors[] = 'ftp user password';
497496
if (!empty($errors[0])) {
498497
foreach ($errors as $i => $error) {
499498
if ( $i == 0 ) {
@@ -505,6 +504,7 @@
505504
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
506505
}
507506

507+
// Add ftp account
508508
$v_ftp_username = $v_ftp_user_data['v_ftp_user'];
509509
$v_ftp_username_full = $user . '_' . $v_ftp_user_data['v_ftp_user'];
510510
$v_ftp_user = escapeshellarg($v_ftp_username);
@@ -531,7 +531,7 @@
531531
}
532532

533533
if ($return_var == 0) {
534-
$v_ftp_password = "••••••••";
534+
$v_ftp_password = "";
535535
$v_ftp_user_data['is_new'] = 0;
536536
}
537537
else {
@@ -550,7 +550,7 @@
550550
continue;
551551
}
552552

553-
553+
// Delete FTP account
554554
if ($v_ftp_user_data['delete'] == 1) {
555555
$v_ftp_username = $user . '_' . $v_ftp_user_data['v_ftp_user'];
556556
exec (VESTA_CMD."v-delete-web-domain-ftp ".$v_username." ".$v_domain." ".$v_ftp_username, $output, $return_var);
@@ -561,9 +561,7 @@
561561
}
562562

563563
if (!empty($_POST['v_ftp'])) {
564-
// Change FTP Account
565564
if (empty($v_ftp_user_data['v_ftp_user'])) $errors[] = __('ftp user');
566-
if (empty($v_ftp_user_data['v_ftp_password'])) $errors[] = __('ftp user password');
567565
if (!empty($errors[0])) {
568566
foreach ($errors as $i => $error) {
569567
if ( $i == 0 ) {
@@ -575,19 +573,23 @@
575573
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
576574
}
577575

576+
// Change FTP account path
578577
$v_ftp_username = $user . '_' . $v_ftp_user_data['v_ftp_user']; //preg_replace("/^".$user."_/", "", $v_ftp_user_data['v_ftp_user']);
579578
$v_ftp_username = escapeshellarg($v_ftp_username);
580-
$v_ftp_user_data['v_ftp_password'] = escapeshellarg(trim($v_ftp_user_data['v_ftp_password']));
581-
$v_ftp_path = escapeshellarg(trim($v_ftp_user_data['v_ftp_path']));
582-
exec (VESTA_CMD."v-change-web-domain-ftp-path ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_path, $output, $return_var);
583-
if ($v_ftp_user_data['v_ftp_password'] != "'••••••••'" && $v_ftp_user_data['v_ftp_password'] != "••••••••" && !empty($v_ftp_user_data['v_ftp_password'])) {
579+
//if (!empty($v_ftp_user_data['v_ftp_path'])) {
580+
$v_ftp_path = escapeshellarg(trim($v_ftp_user_data['v_ftp_path']));
581+
exec (VESTA_CMD."v-change-web-domain-ftp-path ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_path, $output, $return_var);
582+
//}
583+
584+
// Change FTP account password
585+
if (!empty($v_ftp_user_data['v_ftp_password'])) {
584586
$v_ftp_password = tempnam("/tmp","vst");
585587
$fp = fopen($v_ftp_password, "w");
586588
fwrite($fp, $v_ftp_user_data['v_ftp_password']."\n");
587589
fclose($fp);
588-
exec (VESTA_CMD."v-change-web-domain-ftp-password ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_user_data['v_ftp_password'], $output, $return_var);
590+
exec (VESTA_CMD."v-change-web-domain-ftp-password ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_password, $output, $return_var);
589591
unlink($v_ftp_password);
590-
$v_ftp_user_data['v_ftp_password'] = escapeshellarg(trim($v_ftp_user_data['v_ftp_password']));
592+
591593
$to = $v_ftp_user_data['v_ftp_email'];
592594
$subject = __("FTP login credentials");
593595
$hostname = exec('hostname');
@@ -599,12 +601,10 @@
599601
check_return_code($return_var, $output);
600602
unset($output);
601603

602-
$v_ftp_password = "••••••••";
603-
604604
$v_ftp_users_updated[] = array(
605605
'is_new' => 0,
606606
'v_ftp_user' => $v_ftp_username,
607-
'v_ftp_password' => $v_ftp_password,
607+
'v_ftp_password' => $v_ftp_user_data['v_ftp_password'],
608608
'v_ftp_path' => $v_ftp_user_data['v_ftp_path'],
609609
'v_ftp_email' => $v_ftp_user_data['v_ftp_email'],
610610
'v_ftp_pre_path' => $v_ftp_user_prepath

web/inc/main.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,47 @@ function humanize_usage($usage) {
181181
return $usage;
182182
}
183183

184+
function humanize_usage_size($usage) {
185+
if ( $usage > 1024 ) {
186+
$usage = $usage / 1024;
187+
if ( $usage > 1024 ) {
188+
$usage = $usage / 1024 ;
189+
if ( $usage > 1024 ) {
190+
$usage = $usage / 1024 ;
191+
$usage = number_format($usage, 2);
192+
} else {
193+
$usage = number_format($usage, 2);
194+
}
195+
} else {
196+
$usage = number_format($usage, 2);
197+
}
198+
}
199+
200+
return $usage;
201+
}
202+
203+
function humanize_usage_measure($usage) {
204+
$measure = 'kb';
205+
if ( $usage > 1024 ) {
206+
$usage = $usage / 1024;
207+
if ( $usage > 1024 ) {
208+
$usage = $usage / 1024 ;
209+
if ( $usage > 1024 ) {
210+
$measure = __('pb');
211+
} else {
212+
$measure = __('tb');
213+
}
214+
} else {
215+
$measure = __('gb');
216+
}
217+
} else {
218+
$measure = __('mb');
219+
}
220+
221+
return $measure;
222+
}
223+
224+
184225
function get_percentage($used,$total) {
185226
if (!isset($total)) $total = 0;
186227
if (!isset($used)) $used = 0;

web/list/updates/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
session_start();
3-
$TAB = 'SERVER';
3+
$TAB = 'UPDATES';
44

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

web/templates/admin/add_package.html

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</tr>
5353
<tr>
5454
<td class="vst-text input-label">
55-
<?php print __('Web Template');?>
55+
<?php print __('Web Template') . "<span class='optional'>" . strtoupper($_SESSION['WEB_SYSTEM']) . "</span>" ;?>
5656
</td>
5757
</tr>
5858
<tr>
@@ -73,10 +73,37 @@
7373
</select>
7474
</td>
7575
</tr>
76+
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
77+
<tr>
78+
<td class="vst-text input-label">
79+
<?php print __('Backend Template') . "<span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']). "</span>" ;?>
80+
</td>
81+
</tr>
82+
<tr>
83+
<td>
84+
<select class="vst-list" name="v_backend_template">
85+
<?php
86+
foreach ($backend_templates as $key => $value) {
87+
echo "\t\t\t\t<option value=\"".$value."\"";
88+
if ((!empty($v_backend_template)) && ( $value == $v_backend_template)){
89+
echo 'selected' ;
90+
}
91+
if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
92+
echo 'selected' ;
93+
}
94+
echo ">".$value."</option>\n";
95+
}
96+
?>
97+
</select>
98+
</td>
99+
</tr>
100+
<?php echo ""; }?>
101+
76102
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
77103
<tr>
78104
<td class="vst-text input-label">
79-
<?php print __('Proxy Template');?>
105+
<?php print __('Proxy Template') . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>" ;?>
106+
80107
</td>
81108
</tr>
82109
<tr>
@@ -100,7 +127,7 @@
100127
<?php echo ""; }?>
101128
<tr>
102129
<td class="vst-text input-label">
103-
<?php print __('DNS Template');?>
130+
<?php print __('DNS Template') . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>" ;?>
104131
</td>
105132
</tr>
106133
<tr>

0 commit comments

Comments
 (0)