2019-12-10 10:53:31 +01:00
|
|
|
/**
|
|
|
|
* This file is part of Zwii.
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*
|
|
|
|
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
2021-02-17 13:49:58 +01:00
|
|
|
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
2019-12-10 10:53:31 +01:00
|
|
|
* @license GNU General Public License, version 3
|
2020-09-01 20:48:40 +02:00
|
|
|
* @link http://zwiicms.fr/
|
2019-12-10 10:53:31 +01:00
|
|
|
*/
|
|
|
|
|
2020-05-29 17:53:30 +02:00
|
|
|
$( document).ready(function() {
|
2020-05-11 17:02:32 +02:00
|
|
|
/**
|
|
|
|
* Afficher et masquer options SMTP
|
|
|
|
*/
|
2021-10-30 12:48:29 +02:00
|
|
|
if ($("input[name=SmtpEnable]").is(':checked')) {
|
|
|
|
$("#SmtpParam").addClass("disabled");
|
|
|
|
$("#SmtpParam").slideDown();
|
2020-05-11 17:02:32 +02:00
|
|
|
} else {
|
2021-10-30 12:48:29 +02:00
|
|
|
$("#SmtpParam").removeClass("disabled");
|
|
|
|
$("#SmtpParam").slideUp();
|
2020-05-11 17:02:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Afficher et masquer options Auth
|
|
|
|
*/
|
|
|
|
|
2021-10-30 12:48:29 +02:00
|
|
|
if ($("select[name=SmtpEnable]").val() == true) {
|
|
|
|
$("#SmtpAuthParam").addClass("disabled");
|
|
|
|
$("#SmtpAuthParam").slideDown();
|
2020-05-29 17:53:30 +02:00
|
|
|
} else {
|
2021-10-30 12:48:29 +02:00
|
|
|
$("#SmtpAuthParam").removeClass("disabled");
|
|
|
|
$("#SmtpAuthParam").slideUp();
|
2020-05-11 17:02:32 +02:00
|
|
|
}
|
|
|
|
|
2020-06-11 11:25:53 +02:00
|
|
|
|
2021-10-29 18:34:01 +02:00
|
|
|
|
2020-06-05 07:23:36 +02:00
|
|
|
|
2020-06-07 09:25:54 +02:00
|
|
|
/**
|
|
|
|
* Afficher et masquer options SMTP
|
|
|
|
*/
|
2021-10-30 12:48:29 +02:00
|
|
|
$("input[name=SmtpEnable]").on("change", function() {
|
|
|
|
if ($("input[name=SmtpEnable]").is(':checked')) {
|
|
|
|
$("#SmtpParam").addClass("disabled");
|
|
|
|
$("#SmtpParam").slideDown();
|
2020-06-07 09:25:54 +02:00
|
|
|
} else {
|
2021-10-30 12:48:29 +02:00
|
|
|
$("#SmtpParam").removeClass("disabled");
|
|
|
|
$("#SmtpParam").slideUp();
|
2020-06-07 09:25:54 +02:00
|
|
|
}
|
|
|
|
});
|
2020-06-05 07:23:36 +02:00
|
|
|
|
2020-06-07 09:25:54 +02:00
|
|
|
/**
|
|
|
|
* Afficher et masquer options Auth
|
|
|
|
*/
|
2020-06-05 07:23:36 +02:00
|
|
|
|
2021-10-30 12:48:29 +02:00
|
|
|
$("select[name=SmtpAuth]").on("change", function() {
|
|
|
|
if ($("select[name=SmtpAuth]").val() == true) {
|
|
|
|
$("#SmtpAuthParam").addClass("disabled");
|
|
|
|
$("#SmtpAuthParam").slideDown();
|
2020-06-07 09:25:54 +02:00
|
|
|
} else {
|
2021-10-30 12:48:29 +02:00
|
|
|
$("#SmtpAuthParam").removeClass("disabled");
|
|
|
|
$("#SmtpAuthParam").slideUp();
|
2020-06-07 09:25:54 +02:00
|
|
|
}
|
|
|
|
});
|
2020-06-05 07:23:36 +02:00
|
|
|
|
2020-06-07 09:25:54 +02:00
|
|
|
/**
|
|
|
|
* Options de blocage de connexions
|
|
|
|
* Contrôle la cohérence des sélections et interdit une seule valeur Aucune
|
|
|
|
*/
|
|
|
|
$("select[name=configConnectAttempt]").on("change", function() {
|
|
|
|
if ($("select[name=configConnectAttempt]").val() === "999") {
|
|
|
|
$("select[name=configConnectTimeout]").val(0);
|
|
|
|
} else {
|
|
|
|
if ($("select[name=configConnectTimeout]").val() === "0") {
|
|
|
|
$("select[name=configConnectTimeout]").val(300);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("select[name=configConnectTimeout]").on("change", function() {
|
|
|
|
if ($("select[name=configConnectTimeout]").val() === "0") {
|
|
|
|
$("select[name=configConnectAttempt]").val(999);
|
|
|
|
} else {
|
|
|
|
if ($("select[name=configConnectAttempt]").val() === "999") {
|
|
|
|
$("select[name=configConnectAttempt]").val(3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2020-06-05 07:23:36 +02:00
|
|
|
|
2021-10-30 18:12:34 +02:00
|
|
|
/**
|
|
|
|
* Captcha strong si captcha sélectionné
|
|
|
|
*/
|
|
|
|
$("input[name=configConnectCaptcha]").on("change", function() {
|
|
|
|
|
|
|
|
if ($("input[name=configConnectCaptcha]").is(':checked')) {
|
|
|
|
$("#configConnectCaptchaStrongWrapper").addClass("disabled");
|
|
|
|
$("#configConnectCaptchaStrongWrapper").slideDown();
|
|
|
|
$( "#configConnectCaptchaStrong" ).prop( "checked", false );
|
|
|
|
} else {
|
|
|
|
$("#configConnectCaptchaStrongWrapper").removeClass("disabled");
|
|
|
|
$("#configConnectCaptchaStrongWrapper").slideUp();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sélection de la page de configuration à afficher
|
|
|
|
*/
|
|
|
|
$("#configSetupButton").on("click", function() {
|
|
|
|
$("#localeContainer").slideUp();
|
|
|
|
$("#socialContainer").slideUp();
|
|
|
|
$("#connectContainer").slideUp();
|
|
|
|
$("#networkContainer").slideUp();
|
|
|
|
$("#setupContainer").slideDown();
|
|
|
|
});
|
|
|
|
$("#configLocalButton").on("click", function() {
|
|
|
|
$("#setupContainer").slideUp();
|
|
|
|
$("#socialContainer").slideUp();
|
|
|
|
$("#connectContainer").slideUp();
|
|
|
|
$("#networkContainer").slideUp();
|
|
|
|
$("#localeContainer").slideDown();
|
|
|
|
});
|
|
|
|
$("#configSocialButton").on("click", function() {
|
|
|
|
$("#connectContainer").slideUp();
|
|
|
|
$("#setupContainer").slideUp();
|
|
|
|
$("#localeContainer").slideUp();
|
|
|
|
$("#networkContainer").slideUp();
|
|
|
|
$("#socialContainer").slideDown();
|
|
|
|
});
|
|
|
|
$("#configConnectButton").on("click", function() {
|
|
|
|
$("#setupContainer").slideUp();
|
|
|
|
$("#localeContainer").slideUp();
|
|
|
|
$("#socialContainer").slideUp();
|
|
|
|
$("#networkContainer").slideUp();
|
|
|
|
$("#connectContainer").slideDown();
|
|
|
|
});
|
|
|
|
$("#configNetworkButton").on("click", function() {
|
|
|
|
$("#setupContainer").slideUp();
|
|
|
|
$("#localeContainer").slideUp();
|
|
|
|
$("#socialContainer").slideUp();
|
|
|
|
$("#connectContainer").slideUp();
|
|
|
|
$("#networkContainer").slideDown();
|
|
|
|
});
|
|
|
|
|
2020-06-11 11:25:53 +02:00
|
|
|
});
|