Skip to content

Commit cfe6c77

Browse files
committed
Hint working on load, correct path shown + optional text
1 parent 2c1acbe commit cfe6c77

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

web/add/web/index.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
$v_stats_password = $data[$v_domain]['STATS_PASSWORD'];
9797
$v_custom_doc_domain = $_POST['v-custom-doc-domain'];
9898
$v_custom_doc_folder = $_POST['v-custom-doc-folder'];
99+
$v_custom_doc_root_prepath = '/home/'.$user.'/web/';
99100

100101
$v_ftp = $_POST['v_ftp'];
101102
$v_ftp_user = $_POST['v_ftp_user'];
@@ -231,7 +232,8 @@
231232
unlink($v_stats_password);
232233
$v_stats_password = escapeshellarg($_POST['v_stats_password']);
233234
}
234-
if ( !empty($_POST['v-custom-doc-domain']) && !empty($_POST['v_custom_doc_root_check']) && $v_custom_doc_root_prepath.$v_custom_doc_domain.'/public_html'.$v_custom_doc_folder != $v_custom_doc_root){
235+
236+
if ( !empty($_POST['v-custom-doc-domain']) && !empty($_POST['v_custom_doc_root_check']) && $v_custom_doc_root_prepath.$v_custom_doc_domain.'/public_html'.$v_custom_doc_folder != $v_custom_doc_root){
235237
if($_POST['v-custom-doc-domain'] == $v_domain && empty($_POST['v-custom-doc-folder'])){
236238

237239
}else{
@@ -375,6 +377,7 @@
375377
// Define user variables
376378
$v_ftp_user_prepath = $panel[$user]['HOME'] . "/web";
377379
$v_ftp_email = $panel[$user]['CONTACT'];
380+
$v_custom_doc_root_prepath = '/home/'.$user.'/web/';
378381

379382
// List IP addresses
380383
exec (HESTIA_CMD."v-list-user-ips ".$user." json", $output, $return_var);

web/js/pages/add_web.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ App.Listeners.DB.change_custom_doc = function() {
3333
});
3434
}
3535

36+
// Page entry point
37+
// Trigger listeners
38+
App.Listeners.DB.keypress_custom_folder();
39+
App.Listeners.DB.change_custom_doc();
40+
3641
App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
3742
if (hint.trim() == '') {
3843
$(elm).parent().find('.hint').html('');
@@ -75,6 +80,7 @@ App.Listeners.WEB.keypress_domain_name = function() {
7580
var domain = $('.ftp-path-prefix').text(GLOBAL.FTP_USER_PREPATH + '/' + $('#v_domain').val());
7681
$('#v-custom-doc-domain-main').text($('#v_domain').val());
7782
$('#v-custom-doc-domain-main').val($('#v_domain').val());
83+
App.Actions.WEB.update_custom_doc_root(13, 12);
7884

7985
}, 100);
8086
});

web/templates/admin/add_web.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
</tr>
211211
<tr>
212212
<td>
213-
<input type="hidden" name="v-custom-doc-root_prepath"" value="<?php echo $v_custom_doc_root_prepath;?>">
213+
<input type="hidden" name="v-custom-doc-root_prepath" value="<?php echo $v_custom_doc_root_prepath;?>">
214214
<select class="vst-list" name="v-custom-doc-domain">
215215
<option value="<?=htmlentities(trim($v_domain, "'"))?>" id="v-custom-doc-domain-main"><?=htmlentities(trim($v_domain, "'"))?></option>
216216
<?php
@@ -233,7 +233,7 @@
233233
</tr>
234234
<tr>
235235
<td class="vst-text input-label">
236-
<?php print( __('Folder'));?>
236+
<?php print( __('Folder'));?> <span class="optional">(<?php print __('optional');?>)</span>
237237
</td>
238238
</tr>
239239
<tr>

0 commit comments

Comments
 (0)