Skip to content

Commit a1e3933

Browse files
jaapmarcusScIT-Raphael
authored andcommitted
Allow SSL checked on default
1 parent 8deac9c commit a1e3933

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

web/js/pages/edit_web.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
168168
}
169169
}
170170

171+
App.Actions.WEB.toggle_ssl = function (elm){
172+
elementHideShow('ssltable');
173+
if($('#ssl_crt').val().length > 0 || $('#ssl_hsts').prop('checked') || $('#letsencrypt').prop('checked')){
174+
return false;
175+
}
176+
$('#v_ssl_forcessl').prop('checked', true);
177+
}
178+
171179
App.Actions.WEB.toggle_letsencrypt = function(elm) {
172180
if ($(elm).attr('checked')) {
173181
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').attr('disabled', 'disabled');

web/templates/admin/edit_web.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,25 +302,25 @@
302302

303303
<tr>
304304
<td class="vst-text step-top">
305-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print _('SSL Support');?></label>
305+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:App.Actions.WEB.toggle_ssl(this);"> <?php print _('SSL Support');?></label>
306306
</td>
307307
</tr>
308308
<tr>
309309
<td class="step-left">
310310
<table style="display:<?php if ($v_ssl == 'no' ) { echo 'none';} else {echo 'block';}?> ;" id="ssltable">
311311
<tr>
312312
<td class="input-label vst-text">
313-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" <?php if($v_letsencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_letsencrypt(this)"> <?php print _('Lets Encrypt Support');?></label>
313+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" id="letsencrypt" <?php if($v_letsencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_letsencrypt(this)"> <?php print _('Lets Encrypt Support');?></label>
314314
</td>
315315
</tr>
316316
<tr>
317317
<td class="input-label vst-text">
318-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_forcessl" <?php if($v_ssl_forcessl == 'yes') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_forcessl(this)"> <?php print _('Force SSL/HTTPS');?></label>
318+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_forcessl" id="v_ssl_forcessl" <?php if($v_ssl_forcessl == 'yes') echo "checked=yes" ?> onclick=""> <?php print _('Force SSL/HTTPS');?></label>
319319
</td>
320320
</tr>
321321
<tr>
322322
<td class="input-label vst-text">
323-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_hsts" <?php if($v_ssl_hsts == 'yes') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_hsts(this)"> <?php print _('Enable SSL HSTS');?></label>
323+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_hsts" id="ssl_hsts" <?php if($v_ssl_hsts == 'yes') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_hsts(this)"> <?php print _('Enable SSL HSTS');?></label>
324324
</td>
325325
</tr>
326326
<tr style="display: none;">
@@ -345,7 +345,7 @@
345345
</tr>
346346
<tr>
347347
<td>
348-
<textarea size="20" class="vst-textinput short" name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
348+
<textarea size="20" class="vst-textinput short" name="v_ssl_crt" id="ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
349349
</td>
350350
</tr>
351351
<tr>

0 commit comments

Comments
 (0)