File tree Expand file tree Collapse file tree 3 files changed +30
-11
lines changed
Expand file tree Collapse file tree 3 files changed +30
-11
lines changed Original file line number Diff line number Diff line change 115115if [ " $aliases " = ' none' ]; then
116116 ALIAS=' '
117117else
118- ALIAS=" $aliases "
118+ ALIAS=" www.$domain "
119+ if [ -z " $aliases " ]; then
120+ # Check and skip www alias for subdomains.
121+ IFS=' .' read -r -a domain_elements <<< " $domain"
122+ if [ " ${# domain_elements[@]} " -gt 2 ]; then
123+ ALIAS=" "
124+ else
125+ ALIAS=" www.$domain "
126+ fi
127+ else
128+ ALIAS=" $aliases "
129+ fi
119130
120131 ip_alias=$( get_ip_alias $domain )
121132 if [ ! -z " $ip_alias " ]; then
Original file line number Diff line number Diff line change @@ -172,6 +172,14 @@ App.Listeners.WEB.keypress_domain_name();
172172
173173
174174$ ( function ( ) {
175+ $ ( '#v_domain' ) . change ( function ( ) {
176+ var prefix = 'www.' ;
177+ if ( ( ( document . getElementById ( 'v_domain' ) . value ) . split ( "." ) ) . length > 2 ) {
178+ document . getElementById ( 'v_aliases' ) . value = "" ;
179+ } else {
180+ document . getElementById ( 'v_aliases' ) . value = prefix + document . getElementById ( 'v_domain' ) . value ;
181+ }
182+ } ) ;
175183 App . Actions . WEB . toggle_letsencrypt ( $ ( 'input[name=v_letsencrypt]' ) )
176184
177185 $ ( 'select[name="v_stats"]' ) . change ( function ( evt ) {
Original file line number Diff line number Diff line change 6767 < input type ="text " size ="20 " class ="vst-input " name ="v_domain " id ="v_domain " value ="<?=htmlentities(trim($v_domain, "'"))?> ">
6868 </ td >
6969 </ tr >
70- < tr >
71- < td class ="vst-text input-label ">
72- < ?php print __('Aliases');?>
73- </ td >
74- </ tr >
75- < tr >
76- < td >
77- < textarea size ="20 " class ="vst-textinput short " name ="v_aliases " id ="v_aliases " > < ?=htmlentities(trim($v_aliases, "'"))?> </ textarea >
78- </ td >
79- </ tr >
8070 < tr >
8171 < td class ="vst-text input-label ">
8272 < ?php print __('IP address');?>
116106 </ tr >
117107 </ table >
118108 < table class ="data-col2 " width ="600px " style ="display:<?php if (empty($v_adv)) echo 'none';?> ; " id ="advtable ">
109+ < tr >
110+ < td class ="vst-text input-label ">
111+ < ?php print __('Aliases');?>
112+ </ td >
113+ </ tr >
114+ < tr >
115+ < td >
116+ < textarea size ="20 " class ="vst-textinput short " name ="v_aliases " id ="v_aliases " > < ?=htmlentities(trim($v_aliases, "'"))?> </ textarea >
117+ </ td >
118+ </ tr >
119119 < ?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
120120 < tr >
121121 < td class ="vst-text step-top " >
You can’t perform that action at this time.
0 commit comments