diff --git a/core/module/config/config.php b/core/module/config/config.php
index 6b2bc2cb..fa17a5ea 100644
--- a/core/module/config/config.php
+++ b/core/module/config/config.php
@@ -406,58 +406,15 @@ class config extends common {
$this->setData(['user',$this->getuser('id'),'accessCsrf',$_SESSION['csrf']]);
}
// Sauvegarder
- $this->setData([
- 'config',
- [
- 'analyticsId' => $this->getInput('configAdvancedAnalyticsId'),
- 'autoBackup' => $this->getInput('configAdvancedAutoBackup', helper::FILTER_BOOLEAN),
- 'maintenance' => $this->getInput('configAdvancedMaintenance', helper::FILTER_BOOLEAN),
- 'cookieConsent' => $this->getInput('configAdvancedCookieConsent', helper::FILTER_BOOLEAN),
- 'favicon' => $this->getInput('configAdvancedFavicon'),
- 'faviconDark' => $this->getInput('configAdvancedFaviconDark'),
- 'social' => [
- 'facebookId' => $this->getInput('configAdvancedSocialFacebookId'),
- 'linkedinId' => $this->getInput('configAdvancedSocialLinkedinId'),
- 'instagramId' => $this->getInput('configAdvancedSocialInstagramId'),
- 'pinterestId' => $this->getInput('configAdvancedSocialPinterestId'),
- 'twitterId' => $this->getInput('configAdvancedSocialTwitterId'),
- 'youtubeId' => $this->getInput('configAdvancedSocialYoutubeId'),
- 'youtubeUserId' => $this->getInput('configAdvancedSocialYoutubeUserId'),
- 'githubId' => $this->getInput('configAdvancedSocialGithubId')
- ],
- 'timezone' => $this->getInput('configAdvancedTimezone', helper::FILTER_STRING_SHORT, true),
- 'autoUpdate' => $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN),
- 'autoUpdateHtaccess' => $this->getInput('configAdvancedAutoUpdateHtaccess', helper::FILTER_BOOLEAN),
- 'proxyType' => $this->getInput('configAdvancedProxyType'),
- 'proxyUrl' => $this->getInput('configAdvancedProxyUrl'),
- 'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT),
- 'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN),
- 'autoDisconnect' => $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN),
- 'smtp' => [
- 'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN),
- 'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT),
- 'port' => $this->getInput('configAdvancedSmtpPort',helper::FILTER_INT),
- 'auth' => $this->getInput('configAdvancedSmtpAuth',helper::FILTER_BOOLEAN),
- 'secure' => $this->getInput('configAdvancedSmtpSecure'),
- 'username' => $this->getInput('configAdvancedSmtpUsername',helper::FILTER_STRING_SHORT),
- 'password' =>helper::encrypt($this->getData(['config','smtp','username']),$this->getInput('configAdvancedSmtpPassword')),
- 'sender' => $this->getInput('configAdvancedSmtpSender',helper::FILTER_MAIL)
- ],
- 'seo' => [
- 'robots' => $this->getInput('configAdvancedSeoRobots',helper::FILTER_BOOLEAN)
- ],
- 'connect' => [
- 'attempt' => $this->getInput('configAdvancedConnectAttempt',helper::FILTER_INT),
- 'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT),
- 'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN),
- 'anonymousIp' => $this->getInput('configAdvancedConnectAnonymousIp',helper::FILTER_INT),
- 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
- ],
- 'i18n' => [
- 'enable' => $this->getData(['config', 'i18n', 'enable'])
- ]
- ]
- ]);
+ $this->setData(['config', 'autoBackup', $this->getInput('configAdvancedAutoBackup', helper::FILTER_BOOLEAN)]);
+ $this->setData(['config', 'maintenance', $this->getInput('configAdvancedMaintenance', helper::FILTER_BOOLEAN)]);
+ $this->setData(['config', 'cookieConsent', $this->getInput('configAdvancedCookieConsent', helper::FILTER_BOOLEAN)]);
+ $this->setData(['config', 'favicon', $this->getInput('configAdvancedFavicon')]);
+ $this->setData(['config', 'faviconDark', $this->getInput('configAdvancedFaviconDark')]);
+ $this->setData(['config', 'timezone', $this->getInput('configAdvancedTimezone', helper::FILTER_STRING_SHORT, true)]);
+ $this->setData(['config', 'autoUpdate', $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN)]);
+ $this->setData(['config', 'autoUpdateHtaccess', $this->getInput('configAdvancedAutoUpdateHtaccess', helper::FILTER_BOOLEAN)]);
+
// Efface les fichiers de backup lorsque l'option est désactivée
if ($this->getInput('configAdvancedFileBackup', helper::FILTER_BOOLEAN) === false) {
$path = realpath('site/data');
@@ -561,14 +518,11 @@ class config extends common {
'sitemapPageLabel' => empty($this->getInput('configSitemapPageLabel', helper::FILTER_STRING_SHORT)) ? 'Plan du site' : $this->getInput('configSitemapPageLabel', helper::FILTER_STRING_SHORT),
'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true)
- ]
+ ],
]);
$this->setData(['config', 'i18n', 'enable', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]);
- // Générer robots.txt et sitemap
- $this->generateFiles();
-
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
@@ -607,6 +561,18 @@ class config extends common {
* Sécurité de la connexion
**/
public function safety() {
+ // Soumission du formulaire
+ if($this->isPost()) {
+ $this->setData([ 'config', 'captchaStrong', $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN)]);
+ $this->setData([ 'config', 'autoDisconnect', $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN)]);
+ $this->setData([ 'config', 'connect' => [
+ 'attempt' => $this->getInput('configAdvancedConnectAttempt',helper::FILTER_INT),
+ 'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT),
+ 'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN),
+ 'anonymousIp' => $this->getInput('configAdvancedConnectAnonymousIp',helper::FILTER_INT),
+ 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN)
+ ]]);
+ }
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration avancée',
@@ -620,68 +586,31 @@ class config extends common {
public function social() {
// Soumission du formulaire
if($this->isPost()) {
-
- // Répercuter la suppression de la page dans la configuration du footer
- if ( $this->getData(['theme','footer','displaySearch']) === true
- AND $this->getInput('configSearchPageId') === 'none'
- ){
- $this->setData(['theme', 'footer', 'displaySearch', false]);
- }
- if ( $this->getData(['theme','footer','displayLegal']) === true
- AND $this->getInput('configLegalPageId') === 'none'
- ){
- $this->setData(['theme', 'footer', 'displayLegal', false]);
- }
-
// Sauvegarder
- $this->setData([
- 'locale',
- [
- 'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true),
- 'page404' => $this->getInput('configPage404'),
- 'page403' => $this->getInput('configPage403'),
- 'page302' => $this->getInput('configPage302'),
- 'legalPageId' => $this->getInput('configLegalPageId'),
- 'searchPageId' => $this->getInput('configSearchPageId'),
- 'searchPageLabel' => empty($this->getInput('configSearchPageLabel', helper::FILTER_STRING_SHORT)) ? 'Rechercher' : $this->getInput('configSearchPageLabel', helper::FILTER_STRING_SHORT),
- 'legalPageLabel' => empty($this->getInput('configLegalPageLabel', helper::FILTER_STRING_SHORT)) ? 'Mentions légales' : $this->getInput('configLegalPageLabel', helper::FILTER_STRING_SHORT),
- 'sitemapPageLabel' => empty($this->getInput('configSitemapPageLabel', helper::FILTER_STRING_SHORT)) ? 'Plan du site' : $this->getInput('configSitemapPageLabel', helper::FILTER_STRING_SHORT),
- 'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true),
- 'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true)
- ]
- ]);
+ $this->setData([ 'config', 'analyticsId', $this->getInput('configAdvancedAnalyticsId')]);
+ $this->setData([ 'config', 'social' => [
+ 'facebookId' => $this->getInput('configAdvancedSocialFacebookId'),
+ 'linkedinId' => $this->getInput('configAdvancedSocialLinkedinId'),
+ 'instagramId' => $this->getInput('configAdvancedSocialInstagramId'),
+ 'pinterestId' => $this->getInput('configAdvancedSocialPinterestId'),
+ 'twitterId' => $this->getInput('configAdvancedSocialTwitterId'),
+ 'youtubeId' => $this->getInput('configAdvancedSocialYoutubeId'),
+ 'youtubeUserId' => $this->getInput('configAdvancedSocialYoutubeUserId'),
+ 'githubId' => $this->getInput('configAdvancedSocialGithubId')
+ ]]);
- $this->setData(['config', 'i18n', 'enable', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]);
-
- // Générer robots.txt et sitemap
- $this->generateFiles();
+ $this->setData([ 'config', 'seo' => [
+ 'robots' => $this->getInput('configAdvancedSeoRobots',helper::FILTER_BOOLEAN)
+ ]]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
- 'notification' => 'Modifications enregistrées',
+ 'notification' => 'Modifications enregistrées ' ,
'state' => true
]);
}
- // Liste des pages
- self::$pagesList = $this->getData(['page']);
- foreach(self::$pagesList as $page => $pageId) {
- if ($this->getData(['page',$page,'block']) === 'bar' ||
- $this->getData(['page',$page,'disable']) === true) {
- unset(self::$pagesList[$page]);
- }
- }
-
- self::$orphansList = $this->getData(['page']);
- foreach(self::$orphansList as $page => $pageId) {
- if ($this->getData(['page',$page,'block']) === 'bar' ||
- $this->getData(['page',$page,'disable']) === true ||
- $this->getdata(['page',$page, 'position']) !== 0) {
- unset(self::$orphansList[$page]);
- }
- }
-
// Valeurs en sortie
$this->addOutput([
'title' => 'Référencement',
@@ -696,125 +625,21 @@ class config extends common {
public function network() {
// Soumission du formulaire
if($this->isPost()) {
- // Basculement en mise à jour auto
- // Remise à 0 du compteur
- if ($this->getData(['config','autoUpdate']) === false &&
- $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN) === true) {
- $this->setData(['core','lastAutoUpdate',0]);
- }
- // Eviter déconnexion automatique après son activation
- if ( $this->getData(['config','autoDisconnect']) === false
- AND $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN) === true ) {
- $this->setData(['user',$this->getuser('id'),'accessCsrf',$_SESSION['csrf']]);
- }
// Sauvegarder
- $this->setData([
- 'config',
- [
- 'analyticsId' => $this->getInput('configAdvancedAnalyticsId'),
- 'autoBackup' => $this->getInput('configAdvancedAutoBackup', helper::FILTER_BOOLEAN),
- 'maintenance' => $this->getInput('configAdvancedMaintenance', helper::FILTER_BOOLEAN),
- 'cookieConsent' => $this->getInput('configAdvancedCookieConsent', helper::FILTER_BOOLEAN),
- 'favicon' => $this->getInput('configAdvancedFavicon'),
- 'faviconDark' => $this->getInput('configAdvancedFaviconDark'),
- 'social' => [
- 'facebookId' => $this->getInput('configAdvancedSocialFacebookId'),
- 'linkedinId' => $this->getInput('configAdvancedSocialLinkedinId'),
- 'instagramId' => $this->getInput('configAdvancedSocialInstagramId'),
- 'pinterestId' => $this->getInput('configAdvancedSocialPinterestId'),
- 'twitterId' => $this->getInput('configAdvancedSocialTwitterId'),
- 'youtubeId' => $this->getInput('configAdvancedSocialYoutubeId'),
- 'youtubeUserId' => $this->getInput('configAdvancedSocialYoutubeUserId'),
- 'githubId' => $this->getInput('configAdvancedSocialGithubId')
- ],
- 'timezone' => $this->getInput('configAdvancedTimezone', helper::FILTER_STRING_SHORT, true),
- 'autoUpdate' => $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN),
- 'autoUpdateHtaccess' => $this->getInput('configAdvancedAutoUpdateHtaccess', helper::FILTER_BOOLEAN),
- 'proxyType' => $this->getInput('configAdvancedProxyType'),
- 'proxyUrl' => $this->getInput('configAdvancedProxyUrl'),
- 'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT),
- 'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN),
- 'autoDisconnect' => $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN),
- 'smtp' => [
- 'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN),
- 'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT),
- 'port' => $this->getInput('configAdvancedSmtpPort',helper::FILTER_INT),
- 'auth' => $this->getInput('configAdvancedSmtpAuth',helper::FILTER_BOOLEAN),
- 'secure' => $this->getInput('configAdvancedSmtpSecure'),
- 'username' => $this->getInput('configAdvancedSmtpUsername',helper::FILTER_STRING_SHORT),
- 'password' =>helper::encrypt($this->getData(['config','smtp','username']),$this->getInput('configAdvancedSmtpPassword')),
- 'sender' => $this->getInput('configAdvancedSmtpSender',helper::FILTER_MAIL)
- ],
- 'seo' => [
- 'robots' => $this->getInput('configAdvancedSeoRobots',helper::FILTER_BOOLEAN)
- ],
- 'connect' => [
- 'attempt' => $this->getInput('configAdvancedConnectAttempt',helper::FILTER_INT),
- 'timeout' => $this->getInput('configAdvancedConnectTimeout',helper::FILTER_INT),
- 'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN),
- 'anonymousIp' => $this->getInput('configAdvancedConnectAnonymousIp',helper::FILTER_INT),
- 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
- ],
- 'i18n' => [
- 'enable' => $this->getData(['config', 'i18n', 'enable'])
- ]
- ]
- ]);
- // Efface les fichiers de backup lorsque l'option est désactivée
- if ($this->getInput('configAdvancedFileBackup', helper::FILTER_BOOLEAN) === false) {
- $path = realpath('site/data');
- foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename)
- {
- if (strpos($filename,'backup.json')) {
- unlink($filename);
- }
- }
- if (file_exists('site/data/.backup')) unlink('site/data/.backup');
- } else {
- touch('site/data/.backup');
- }
- // Notice
- if(self::$inputNotices === []) {
- // Active la réécriture d'URL
- $rewrite = $this->getInput('rewrite', helper::FILTER_BOOLEAN);
- if(
- $rewrite
- AND helper::checkRewrite() === false
- ) {
- // Ajout des lignes dans le .htaccess
- file_put_contents(
- '.htaccess',
- PHP_EOL .
- '
Les fichiers du site ne sont pas sauvegardés automatiquement. Activation recommandée.' - ]); ?> -
Les fichiers du site ne sont pas sauvegardés automatiquement. Activation recommandée.' + ]); ?> +