@@ -95,6 +95,7 @@ App.HTML.Build.user_form = function (options, id) {
9595 tpl . set ( ':DELETE_ACTION' , App . Templates . get ( 'DELETE_ACTION' , 'general' ) . finalize ( ) ) ;
9696 }
9797 options = ! App . Helpers . isEmpty ( options ) ? options : App . Empty . USER ;
98+
9899 if ( in_edit == true ) {
99100 options . PASSWORD = App . Settings . PASSWORD_IMMUTE ;
100101 var ns = [ ] ;
@@ -146,6 +147,15 @@ App.HTML.Build.web_domain_form = function (options, id) {
146147 tpl . set ( ':title' , 'Edit WEB domain' ) ;
147148 tpl . set ( ':save_button' , 'SAVE' ) ;
148149 tpl . set ( ':DELETE_ACTION' , App . Templates . get ( 'DELETE_ACTION' , 'general' ) . finalize ( ) ) ;
150+
151+ if ( options . SSL_CRT == '' || options . SSL_KEY == '' ) {
152+ options . SSL = '' ;
153+ options . SSL_HOME = '' ;
154+ options . SSL_CRT = '' ;
155+ options . SSL_KEY = '' ;
156+ options . SSL_CA = '' ;
157+ }
158+
149159 if ( options . SSL == 'on' ) {
150160 tpl . set ( ':ssl_checked' , 'checked="checked"' ) ;
151161 }
@@ -167,7 +177,7 @@ App.HTML.Build.web_domain_form = function (options, id) {
167177 tpl = App . HTML . setTplKeys ( tpl , options , true ) ;
168178 tpl = App . HTML . Build . web_domain_selects ( tpl , options ) ;
169179 tpl = App . HTML . toggle_suspended_form ( tpl , options ) ;
170- if ( options . CGI == 'yes' ) {
180+ if ( options . CGI == 'yes' || ! in_edit ) {
171181 tpl . set ( ':CHECKED_CGI' , 'checked="checked"' ) ;
172182 }
173183 if ( options . ELOG == 'yes' ) {
@@ -384,8 +394,11 @@ App.HTML.Build.web_domain_entry = function (o, key) {
384394 'DISK_QUOTA_MEASURE' : App . Helpers . getMbHumanMeasure ( App . Env . initialParams . user_data . DISK_QUOTA ) ,
385395 'BANDWIDTH_MEASURE' : App . Helpers . getMbHumanMeasure ( App . Env . initialParams . user_data . BANDWIDTH ) ,
386396 'BANDWIDTH' : App . Helpers . getMbHuman ( App . Env . initialParams . user_data . BANDWIDTH ) ,
387- 'DISK_QUOTA' : App . Helpers . getMbHuman ( App . Env . initialParams . user_data . DISK_QUOTA )
397+ 'DISK_QUOTA' : App . Helpers . getMbHuman ( App . Env . initialParams . user_data . DISK_QUOTA ) ,
398+ 'SSL' : ( o . SSL_CRT == '' || o . SSL_KEY == '' || o . SSL != 'on' ) ? 'off' : 'on'
388399 } ;
400+
401+
389402 var o = $ . extend ( o , processed_data ) ;
390403 o . U_DISK_PERCENTAGE_2 = o . U_DISK_PERCENTAGE ;
391404 o . U_DISK_PERCENTAGE_3 = o . U_DISK_PERCENTAGE ;
@@ -651,27 +664,14 @@ App.HTML.Build.db_selects = function (tpl, options) {
651664 } ) ;
652665 tpl . set ( ':TYPE_OPTIONS' , acc . done ( ) ) ;
653666
654- acc = [ ] ;
655- var items = App . Env . initialParams . DB . HOST ;
656- $ . each ( items , function ( val ) {
657- var tpl = App . Templates . get ( 'select_option' , 'general' ) ;
658- tpl . set ( ':VALUE' , val ) ;
659- tpl . set ( ':TEXT' , items [ val ] ) ;
660- tpl . set ( ':SELECTED' , val == options . HOST ? 'selected="selected"' : '' ) ;
661- acc [ acc . length ++ ] = tpl . finalize ( ) ;
662- } ) ;
663- tpl . set ( ':HOST_OPTIONS' , acc . done ( ) ) ;
667+ var obj = App . Env . initialParams . DB . HOST ;
668+ var opts = App . HTML . Build . options ( obj , options . HOST ) ;
669+ tpl . set ( ':HOST_OPTIONS' , opts ) ;
664670
665- acc = [ ] ;
666- var items = App . Env . initialParams . DB . ENCODING ;
667- $ . each ( items , function ( val ) {
668- var tpl = App . Templates . get ( 'select_option' , 'general' ) ;
669- tpl . set ( ':VALUE' , val ) ;
670- tpl . set ( ':TEXT' , items [ val ] ) ;
671- tpl . set ( ':SELECTED' , val == options . ENCODING ? 'selected="selected"' : '' ) ;
672- acc [ acc . length ++ ] = tpl . finalize ( ) ;
673- } ) ;
674- tpl . set ( ':ENCODING_OPTIONS' , acc . done ( ) ) ;
671+
672+ var obj = App . Env . initialParams . DB . CHARSET ;
673+ var opts = App . HTML . Build . options ( obj , options . CHARSET ) ;
674+ tpl . set ( ':CHARSET_OPTIONS' , opts ) ;
675675
676676 return tpl ;
677677}
@@ -691,9 +691,11 @@ App.HTML.Build.dns_selects = function (tpl, options) {
691691 $ . each ( App . Env . initialParams . DNS . TPL , function ( key ) {
692692 obj [ key ] = key ;
693693 } ) ;
694- var opts = App . HTML . Build . options ( obj , options . PACKAGE ) ;
694+
695+ var opts = App . HTML . Build . options ( obj , options . TPL ) ;
695696 tpl . set ( ':TPL' , opts ) ;
696- tpl . set ( ':TPL_DEFAULT_VALUE' , options . TPL || App . Helpers . getFirstKey ( obj ) ) ;
697+ // tpl.set(':TPL_DEFAULT_VALUE', options.TPL || App.Helpers.getFirstKey(obj));
698+
697699 } catch ( e ) {
698700 return tpl ;
699701 }
0 commit comments