Vérif toute saisie data

This commit is contained in:
Fred Tempez 2021-10-30 18:59:58 +02:00
parent 3d928d866b
commit cbb43f9174
4 changed files with 69 additions and 71 deletions

View File

@ -443,45 +443,43 @@ class config extends common {
'cookieConsent' => $this->getInput('configCookieConsent', helper::FILTER_BOOLEAN),
'autoUpdate' => $this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN),
'autoUpdateHtaccess' => $this->getInput('configAutoUpdateHtaccess', helper::FILTER_BOOLEAN),
'autoBackup' => $this->getInput('configAutoBackup', helper::FILTER_BOOLEAN),
'maintenance' => $this->getInput('configMaintenance', helper::FILTER_BOOLEAN),
'proxyType' => $this->getInput('configProxyType'),
'proxyUrl' => $this->getInput('configProxyUrl'),
'proxyPort' => $this->getInput('configProxyPort',helper::FILTER_INT),
'social' => [
'facebookId' => $this->getInput('configSocialFacebookId'),
'linkedinId' => $this->getInput('configSocialLinkedinId'),
'instagramId' => $this->getInput('configSocialInstagramId'),
'pinterestId' => $this->getInput('configSocialPinterestId'),
'twitterId' => $this->getInput('configSocialTwitterId'),
'youtubeId' => $this->getInput('configSocialYoutubeId'),
'youtubeUserId' => $this->getInput('configSocialYoutubeUserId'),
'githubId' => $this->getInput('configSocialGithubId')
'facebookId' => $this->getInput('socialFacebookId'),
'linkedinId' => $this->getInput('socialLinkedinId'),
'instagramId' => $this->getInput('socialInstagramId'),
'pinterestId' => $this->getInput('socialPinterestId'),
'twitterId' => $this->getInput('socialTwitterId'),
'youtubeId' => $this->getInput('socialYoutubeId'),
'youtubeUserId' => $this->getInput('socialYoutubeUserId'),
'githubId' => $this->getInput('socialGithubId')
],
'smtp' => [
'enable' => $this->getInput('configSmtpEnable',helper::FILTER_BOOLEAN),
'host' => $this->getInput('configSmtpHost',helper::FILTER_STRING_SHORT),
'port' => $this->getInput('configSmtpPort',helper::FILTER_INT),
'auth' => $this->getInput('configSmtpAuth',helper::FILTER_BOOLEAN),
'secure' => $this->getInput('configSmtpSecure'),
'username' => $this->getInput('configSmtpUsername',helper::FILTER_STRING_SHORT),
'password' =>helper::encrypt($this->getData(['config','smtp','username']),$this->getInput('configSmtpPassword')),
'sender' => $this->getInput('configSmtpSender',helper::FILTER_MAIL)
'enable' => $this->getInput('smtpEnable',helper::FILTER_BOOLEAN),
'host' => $this->getInput('smtpHost',helper::FILTER_STRING_SHORT),
'port' => $this->getInput('smtpPort',helper::FILTER_INT),
'auth' => $this->getInput('smtpAuth',helper::FILTER_BOOLEAN),
'secure' => $this->getInput('smtpSecure'),
'username' => $this->getInput('smtpUsername',helper::FILTER_STRING_SHORT),
'password' =>helper::encrypt($this->getData(['config','smtp','username']),$this->getInput('smtpPassword')),
'sender' => $this->getInput('smtpSender',helper::FILTER_MAIL)
],
'seo' => [
'robots' => $this->getInput('SeoRobots',helper::FILTER_BOOLEAN),
'analyticsId' => $this->getInput('SeoAnalyticsId')
'robots' => $this->getInput('seoRobots',helper::FILTER_BOOLEAN),
'analyticsId' => $this->getInput('seoAnalyticsId')
],
'safety' => [
'attempt' => $this->getInput('configConnectAttempt',helper::FILTER_INT),
'timeout' => $this->getInput('configConnectTimeout',helper::FILTER_INT),
'log' => $this->getInput('configConnectLog',helper::FILTER_BOOLEAN),
'anonymousIp' => $this->getInput('configConnectAnonymousIp',helper::FILTER_INT),
'captcha' => $this->getInput('configConnectCaptcha',helper::FILTER_BOOLEAN),
'captchaStrong' => $this->getInput('configConnectCaptchaStrong',helper::FILTER_BOOLEAN),
'autoDisconnect' => $this->getInput('configConnectAutoDisconnect',helper::FILTER_BOOLEAN),
'connect' => [
'attempt' => $this->getInput('connectAttempt',helper::FILTER_INT),
'timeout' => $this->getInput('connectTimeout',helper::FILTER_INT),
'log' => $this->getInput('connectLog',helper::FILTER_BOOLEAN),
'anonymousIp' => $this->getInput('connectAnonymousIp',helper::FILTER_INT),
'captcha' => $this->getInput('connectCaptcha',helper::FILTER_BOOLEAN),
'captchaStrong' => $this->getInput('connectCaptchaStrong',helper::FILTER_BOOLEAN),
'autoDisconnect' => $this->getInput('connectAutoDisconnect',helper::FILTER_BOOLEAN),
],
'i18n' => [
'enable' => $this->getData(['config', 'i18n', 'enable'])

View File

@ -68,21 +68,21 @@ $( document).ready(function() {
* 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);
$("select[name=connectAttempt]").on("change", function() {
if ($("select[name=connectAttempt]").val() === "999") {
$("select[name=connectTimeout]").val(0);
} else {
if ($("select[name=configConnectTimeout]").val() === "0") {
$("select[name=configConnectTimeout]").val(300);
if ($("select[name=connectTimeout]").val() === "0") {
$("select[name=connectTimeout]").val(300);
}
}
});
$("select[name=configConnectTimeout]").on("change", function() {
if ($("select[name=configConnectTimeout]").val() === "0") {
$("select[name=configConnectAttempt]").val(999);
$("select[name=connectTimeout]").on("change", function() {
if ($("select[name=connectTimeout]").val() === "0") {
$("select[name=connectAttempt]").val(999);
} else {
if ($("select[name=configConnectAttempt]").val() === "999") {
$("select[name=configConnectAttempt]").val(3);
if ($("select[name=connectAttempt]").val() === "999") {
$("select[name=connectAttempt]").val(3);
}
}
});
@ -90,15 +90,15 @@ $( document).ready(function() {
/**
* Captcha strong si captcha sélectionné
*/
$("input[name=configConnectCaptcha]").on("change", function() {
$("input[name=connectCaptcha]").on("change", function() {
if ($("input[name=configConnectCaptcha]").is(':checked')) {
$("#configConnectCaptchaStrongWrapper").addClass("disabled");
$("#configConnectCaptchaStrongWrapper").slideDown();
$( "#configConnectCaptchaStrong" ).prop( "checked", false );
if ($("input[name=connectCaptcha]").is(':checked')) {
$("#connectCaptchaStrongWrapper").addClass("disabled");
$("#connectCaptchaStrongWrapper").slideDown();
$( "#connectCaptchaStrong" ).prop( "checked", false );
} else {
$("#configConnectCaptchaStrongWrapper").removeClass("disabled");
$("#configConnectCaptchaStrongWrapper").slideUp();
$("#connectCaptchaStrongWrapper").removeClass("disabled");
$("#connectCaptchaStrongWrapper").slideUp();
}
});

View File

@ -5,20 +5,20 @@
<h4>Réseau</h4>
<div class="row">
<div class="col2">
<?php echo template::select('ProxyType', $module::$proxyType, [
<?php echo template::select('configProxyType', $module::$proxyType, [
'label' => 'Type de proxy',
'selected' => $this->getData(['config', 'proxyType'])
]); ?>
</div>
<div class="col8">
<?php echo template::text('ProxyUrl', [
<?php echo template::text('configProxyUrl', [
'label' => 'Adresse du proxy',
'placeholder' => 'cache.proxy.fr',
'value' => $this->getData(['config', 'proxyUrl'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('ProxyPort', [
<?php echo template::text('configProxyPort', [
'label' => 'Port du proxy',
'placeholder' => '6060',
'value' => $this->getData(['config', 'proxyPort'])
@ -34,52 +34,52 @@
<h4>SMTP</h4>
<div class="row">
<div class="col12">
<?php echo template::checkbox('SmtpEnable', true, 'Activer SMTP', [
<?php echo template::checkbox('smtpEnable', true, 'Activer SMTP', [
'checked' => $this->getData(['config', 'smtp','enable']),
'help' => 'Paramètres à utiliser lorsque votre hébergeur ne propose pas la fonctionnalité d\'envoi de mail.'
]); ?>
</div>
</div>
<div id="SmtpParam">
<div id="smtpParam">
<div class="row">
<div class="col8">
<?php echo template::text('SmtpHost', [
<?php echo template::text('smtpHost', [
'label' => 'Adresse SMTP',
'placeholder' => 'smtp.fr',
'value' => $this->getData(['config', 'smtp','host'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('SmtpPort', [
<?php echo template::text('smtpPort', [
'label' => 'Port SMTP',
'placeholder' => '589',
'value' => $this->getData(['config', 'smtp','port'])
]); ?>
</div>
<div class="col2">
<?php echo template::select('SmtpAuth', $module::$SMTPauth, [
<?php echo template::select('smtpAuth', $module::$SMTPauth, [
'label' => 'Authentification',
'selected' => $this->getData(['config', 'smtp','auth'])
]); ?>
</div>
</div>
<div id="SmtpAuthParam">
<div id="smtpAuthParam">
<div class="row">
<div class="col5">
<?php echo template::text('SmtpUsername', [
<?php echo template::text('smtpUsername', [
'label' => 'Nom utilisateur',
'value' => $this->getData(['config', 'smtp','username' ])
]); ?>
</div>
<div class="col5">
<?php echo template::password('SmtpPassword', [
<?php echo template::password('smtpPassword', [
'label' => 'Mot de passe',
'autocomplete' => 'off',
'value' => $this->getData(['config', 'smtp','username' ]) ? helper::decrypt ($this->getData(['config', 'smtp','username' ]),$this->getData(['config','smtp','password'])) : ''
]); ?>
</div>
<div class="col2">
<?php echo template::select('SmtpSecure', $module::$SMTPEnc , [
<?php echo template::select('smtpSecure', $module::$SMTPEnc , [
'label' => 'Sécurité',
'selected' => $this->getData(['config', 'smtp','secure'])
]); ?>

View File

@ -7,7 +7,7 @@
<div class="col4 offset1">
<div class="row">
<div class="col12">
<?php echo template::button('SocialMetaImage', [
<?php echo template::button('socialMetaImage', [
'href' => helper::baseUrl() . 'config/configMetaImage',
'value' => 'Générer une capture Open Graph'
]); ?>
@ -15,7 +15,7 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::button('SocialSiteMap', [
<?php echo template::button('socialSiteMap', [
'href' => helper::baseUrl() . 'config/generateFiles',
'value' => 'Générer sitemap.xml et robots.txt'
]); ?>
@ -23,7 +23,7 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::checkbox('SeoRobots', true, 'Autoriser les robots à référencer le site', [
<?php echo template::checkbox('seoRobots', true, 'Autoriser les robots à référencer le site', [
'checked' => $this->getData(['config', 'seo','robots'])
]); ?>
</div>
@ -48,28 +48,28 @@
<h4>Réseaux sociaux</h4>
<div class="row">
<div class="col3">
<?php echo template::text('SocialFacebookId', [
<?php echo template::text('socialFacebookId', [
'help' => 'Saisissez votre ID : https://www.facebook.com/[ID].',
'label' => 'Facebook',
'value' => $this->getData(['config', 'social', 'facebookId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('SocialInstagramId', [
<?php echo template::text('socialInstagramId', [
'help' => 'Saisissez votre ID : https://www.instagram.com/[ID].',
'label' => 'Instagram',
'value' => $this->getData(['config', 'social', 'instagramId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('SocialYoutubeId', [
<?php echo template::text('socialYoutubeId', [
'help' => 'ID de la chaîne : https://www.youtube.com/channel/[ID].',
'label' => 'Chaîne Youtube',
'value' => $this->getData(['config', 'social', 'youtubeId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('SocialYoutubeUserId', [
<?php echo template::text('socialYoutubeUserId', [
'help' => 'Saisissez votre ID Utilisateur : https://www.youtube.com/user/[ID].',
'label' => 'Youtube',
'value' => $this->getData(['config', 'social', 'youtubeUserId'])
@ -78,28 +78,28 @@
</div>
<div class="row">
<div class="col3">
<?php echo template::text('SocialTwitterId', [
<?php echo template::text('socialTwitterId', [
'help' => 'Saisissez votre ID : https://twitter.com/[ID].',
'label' => 'Twitter',
'value' => $this->getData(['config', 'social', 'twitterId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('SocialPinterestId', [
<?php echo template::text('socialPinterestId', [
'help' => 'Saisissez votre ID : https://pinterest.com/[ID].',
'label' => 'Pinterest',
'value' => $this->getData(['config', 'social', 'pinterestId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('SocialLinkedinId', [
<?php echo template::text('socialLinkedinId', [
'help' => 'Saisissez votre ID Linkedin : https://fr.linkedin.com/in/[ID].',
'label' => 'Linkedin',
'value' => $this->getData(['config', 'social', 'linkedinId'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('SocialGithubId', [
<?php echo template::text('socialGithubId', [
'help' => 'Saisissez votre ID Github : https://github.com/[ID].',
'label' => 'Github',
'value' => $this->getData(['config', 'social', 'githubId'])
@ -115,7 +115,7 @@
<h4>Scripts externes</h4>
<div class="row">
<div class="col3">
<?php echo template::text('SeoAnalyticsId', [
<?php echo template::text('seoAnalyticsId', [
'help' => 'Saisissez l\'ID de suivi.',
'label' => 'Google Analytics',
'placeholder' => 'UA-XXXXXXXX-X',
@ -123,14 +123,14 @@
]); ?>
</div>
<div class="col3 offset3 verticalAlignBottom">
<?php echo template::button('SocialScriptHead', [
<?php echo template::button('socialScriptHead', [
'href' => helper::baseUrl() . 'config/script/head',
'value' => 'Script dans head',
'ico' => 'pencil'
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('SocialScriptBody', [
<?php echo template::button('socialScriptBody', [
'href' => helper::baseUrl() . 'config/script/body',
'value' => 'Script dans body',
'ico' => 'pencil'