| Current Path : /home/jeromecohp/www/aesecure/template/ |
| Current File : /home/jeromecohp/www/aesecure/template/form_72_enable_www.default.aec |
<p class="text-info"><strong>%PREFACE%</strong></p>
<div>
%CHECKBOXES%
<form id="form%ID%" role="form">
<input type="hidden" name="w" value="%ID%" size="4"/>
<input type="hidden" name="a" value="1" size="1"/>
<input type="hidden" name="%AESECURETOKEN%" value="%TOKEN%"/>
</form>
<br/><span class="text-success"><em><strong>%RECOMMANDED_STATE%:</strong> %RECOMMANDED_STATE_VALUE%</em></span>
</div>
<div id="div%ID%" class="ajaxResult"/>
<script type="text/javascript">
function postProcessing%ID%() { return true; }
// The option with or without www. shouldn't be activated on the localhost
var url_host=window.location.host;
var bStop=((url_host=='127.0.0.1') || (url_host=='localhost'));
if (!bStop) {
// url_host can be aesecure.com, www.aesecure.com, forum.aesecure.com, ...
// Detect if a subdomain is there and is the subdomain is different than www
var parts = url_host.split('.')
// parts[0] is the first part and thus the subdomain
if (parts.length==3) bStop=(parts[0]!='www');
}
if (bStop) {
$('#tab%ID%Result').html('<strong><span class="text-info">%CANT_BE_USED%</span></strong>');
} else { // if (bStop)
// Initialize Pro functionnalities (if present)
if (typeof initaeSecurePro !== 'undefined' && $.isFunction(initaeSecurePro)) initaeSecurePro(%ID%);
$('#tab%ID%switch input[type=checkbox]').checkboxpicker();
$('#tab%ID%switch input[type=checkbox]').on("change", function() {
var checked = $(this).prop("checked");
if (checked==true) {
// Enable the protection
$('#form%ID% input[name=a]').val(1);
var formData=$('#form%ID%').serialize();
SetupTask(%ID%, 'div%ID%',formData,'%FEATURE_ENABLED%','','',true, 'POST','tab%ID%switch','','','%TAG%');
} else {
// Disable the protection
$('#form%ID% input[name=a]').val(0);
var formData=$('#form%ID%').serialize();
SetupTask(%ID%, 'div%ID%',formData,'%FEATURE_DISABLED%','','',true, 'POST','tab%ID%switch','','','%TAG%');
}
});
$('[data-toggle="popover"]').popover({trigger:'hover','placement':'top','html':true});
} // if (bStop)
</script>