Просмотр исходного кода

Hint working on load, correct path shown + optional text

Jaap Marcus 5 лет назад
Родитель
Сommit
cfe6c772a4
3 измененных файлов с 12 добавлено и 3 удалено
  1. 4 1
      web/add/web/index.php
  2. 6 0
      web/js/pages/add_web.js
  3. 2 2
      web/templates/admin/add_web.html

+ 4 - 1
web/add/web/index.php

@@ -96,6 +96,7 @@ if (!empty($_POST['ok'])) {
     $v_stats_password = $data[$v_domain]['STATS_PASSWORD'];
     $v_custom_doc_domain = $_POST['v-custom-doc-domain'];
     $v_custom_doc_folder = $_POST['v-custom-doc-folder'];
+    $v_custom_doc_root_prepath = '/home/'.$user.'/web/';
     
     $v_ftp = $_POST['v_ftp'];
     $v_ftp_user = $_POST['v_ftp_user'];
@@ -231,7 +232,8 @@ if (!empty($_POST['ok'])) {
         unlink($v_stats_password);
         $v_stats_password = escapeshellarg($_POST['v_stats_password']);
     }
-     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){
+    
+    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){
         if($_POST['v-custom-doc-domain'] == $v_domain && empty($_POST['v-custom-doc-folder'])){
 
         }else{
@@ -375,6 +377,7 @@ if (!empty($_POST['ok'])) {
 // Define user variables
 $v_ftp_user_prepath = $panel[$user]['HOME'] . "/web";
 $v_ftp_email = $panel[$user]['CONTACT'];
+$v_custom_doc_root_prepath = '/home/'.$user.'/web/';
 
 // List IP addresses
 exec (HESTIA_CMD."v-list-user-ips ".$user." json", $output, $return_var);

+ 6 - 0
web/js/pages/add_web.js

@@ -33,6 +33,11 @@ App.Listeners.DB.change_custom_doc = function() {
     });
 }
 
+// Page entry point
+// Trigger listeners
+App.Listeners.DB.keypress_custom_folder();
+App.Listeners.DB.change_custom_doc();
+
 App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
     if (hint.trim() == '') {
         $(elm).parent().find('.hint').html('');
@@ -75,6 +80,7 @@ App.Listeners.WEB.keypress_domain_name = function() {
             var domain = $('.ftp-path-prefix').text(GLOBAL.FTP_USER_PREPATH + '/' + $('#v_domain').val());
             $('#v-custom-doc-domain-main').text($('#v_domain').val());
             $('#v-custom-doc-domain-main').val($('#v_domain').val());
+            App.Actions.WEB.update_custom_doc_root(13, 12);
             
         }, 100);
     });

+ 2 - 2
web/templates/admin/add_web.html

@@ -210,7 +210,7 @@
                                         </tr>
                                         <tr>
                                             <td>
-                                                <input type="hidden" name="v-custom-doc-root_prepath"" value="<?php echo $v_custom_doc_root_prepath;?>">
+                                                <input type="hidden" name="v-custom-doc-root_prepath" value="<?php echo $v_custom_doc_root_prepath;?>">
                                                 <select class="vst-list" name="v-custom-doc-domain">
                                                     <option value="<?=htmlentities(trim($v_domain, "'"))?>" id="v-custom-doc-domain-main"><?=htmlentities(trim($v_domain, "'"))?></option>
                                                     <?php
@@ -233,7 +233,7 @@
                                         </tr>
                                         <tr>
                                             <td class="vst-text input-label">
-                                                <?php print( __('Folder'));?>
+                                                <?php print( __('Folder'));?> <span class="optional">(<?php print __('optional');?>)</span>
                                             </td>
                                         </tr>
                                         <tr>