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

View File

@ -68,21 +68,21 @@ $( document).ready(function() {
* Options de blocage de connexions * Options de blocage de connexions
* Contrôle la cohérence des sélections et interdit une seule valeur Aucune * Contrôle la cohérence des sélections et interdit une seule valeur Aucune
*/ */
$("select[name=configConnectAttempt]").on("change", function() { $("select[name=connectAttempt]").on("change", function() {
if ($("select[name=configConnectAttempt]").val() === "999") { if ($("select[name=connectAttempt]").val() === "999") {
$("select[name=configConnectTimeout]").val(0); $("select[name=connectTimeout]").val(0);
} else { } else {
if ($("select[name=configConnectTimeout]").val() === "0") { if ($("select[name=connectTimeout]").val() === "0") {
$("select[name=configConnectTimeout]").val(300); $("select[name=connectTimeout]").val(300);
} }
} }
}); });
$("select[name=configConnectTimeout]").on("change", function() { $("select[name=connectTimeout]").on("change", function() {
if ($("select[name=configConnectTimeout]").val() === "0") { if ($("select[name=connectTimeout]").val() === "0") {
$("select[name=configConnectAttempt]").val(999); $("select[name=connectAttempt]").val(999);
} else { } else {
if ($("select[name=configConnectAttempt]").val() === "999") { if ($("select[name=connectAttempt]").val() === "999") {
$("select[name=configConnectAttempt]").val(3); $("select[name=connectAttempt]").val(3);
} }
} }
}); });
@ -90,15 +90,15 @@ $( document).ready(function() {
/** /**
* Captcha strong si captcha sélectionné * Captcha strong si captcha sélectionné
*/ */
$("input[name=configConnectCaptcha]").on("change", function() { $("input[name=connectCaptcha]").on("change", function() {
if ($("input[name=configConnectCaptcha]").is(':checked')) { if ($("input[name=connectCaptcha]").is(':checked')) {
$("#configConnectCaptchaStrongWrapper").addClass("disabled"); $("#connectCaptchaStrongWrapper").addClass("disabled");
$("#configConnectCaptchaStrongWrapper").slideDown(); $("#connectCaptchaStrongWrapper").slideDown();
$( "#configConnectCaptchaStrong" ).prop( "checked", false ); $( "#connectCaptchaStrong" ).prop( "checked", false );
} else { } else {
$("#configConnectCaptchaStrongWrapper").removeClass("disabled"); $("#connectCaptchaStrongWrapper").removeClass("disabled");
$("#configConnectCaptchaStrongWrapper").slideUp(); $("#connectCaptchaStrongWrapper").slideUp();
} }
}); });

View File

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

View File

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