Merge branch 'master' into dev10

This commit is contained in:
Fred Tempez 2020-03-02 13:11:16 +01:00
commit f6b607248c
5 changed files with 81 additions and 5 deletions

View File

@ -22,6 +22,8 @@
- Chargement paresseux des images.
## version 9.2.23
- Nouveauté :
- Configuration du réseau : proxy http ou tcp sans authentification
- Corrections :
- Fonction magic_quotes dépréciée supprimée.
- Mise à jour en ligne :

View File

@ -234,6 +234,25 @@ class common {
// Mise à jour des données core
$this->update();
// Données de proxy
$proxy = $this->getData(['config','proxyType']) . $this->getData(['config','proxyUrl']) . ':' . $this->getData(['config','proxyPort']);
if (!empty($this->getData(['config','proxyUrl'])) &&
!empty($this->getData(['config','proxyPort'])) ) {
$context = array(
'http' => array(
'proxy' => $proxy,
'request_fulluri' => true,
'verify_peer' => false,
'verify_peer_name' => false,
),
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false
)
);
stream_context_set_default($context);
}
}
/**
@ -1078,12 +1097,23 @@ class common {
$this->setData(['theme', 'body', 'toTopbackgroundColor', 'rgba(33, 34, 35, .8)' ]);
$this->setData(['theme', 'body', 'toTopColor', 'rgba(255, 255, 255, 1)' ]);
$this->setData(['core', 'dataVersion', 9221]);
}
}
// Version 9.2.23
if($this->getData(['core', 'dataVersion']) < 9223) {
// Utile pour l'installation d'un backup sur un autre serveur
// mais avec la réécriture d'URM
$this->setData(['config', 'proxyUrl', '' ]);
$this->setData(['config', 'proxyPort', '' ]);
$this->setData(['config', 'proxyType', 'tcp://' ]);
$this->setData(['core', 'dataVersion', 9223]);
$this->saveData();
}
// Version 10.0.00
if($this->getData(['core', 'dataVersion']) < 10000) {
$this->setData(['config', 'faviconDark','faviconDark.ico']);
$this->setData(['core', 'dataVersion', 10000]);
}
$this->saveData();
}
}
}

View File

@ -148,6 +148,11 @@ class config extends common {
15 => '15 articles',
20 => '20 articles'
];
// Type de proxy
public static $proxyType = [
'tcp://' => 'TCP',
'http://' => 'HTTP'
];
public function generateFiles() {
@ -371,6 +376,9 @@ class config extends common {
$this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN) === true) {
$this->setData(['core','lastAutoUpdate',0]);
}
// Vérification du proxy
$proxy = $this->getData(['config','proxyType']) . $this->getData(['config','proxyUrl']) . ':' . $this->getData(['config','proxyPort']);
$this->setData([
'config',
[
@ -392,11 +400,14 @@ class config extends common {
'githubId' => $this->getInput('configSocialGithubId')
],
'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true),
'itemsperPage' => $this->getInput('itemsperPage', helper::FILTER_INT,true),
'itemsperPage' => $this->getInput('ConfigItemsperPage', helper::FILTER_INT,true),
'legalPageId' => $this->getInput('configLegalPageId'),
'metaDescription' => $this->getInput('configMetaDescription', helper::FILTER_STRING_LONG, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true),
'autoUpdate' => $this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN)
'autoUpdate' => $this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN),
'proxyType' => $this->getInput('configProxyType'),
'proxyUrl' => $this->getInput('configProxyUrl'),
'proxyPort' => $this->getInput('configProxyPort',helper::FILTER_INT)
]
]);

View File

@ -71,7 +71,7 @@
]); ?>
</div>
<div class="col6">
<?php echo template::select('itemsperPage', $module::$ItemsList, [
<?php echo template::select('configItemsperPage', $module::$ItemsList, [
'label' => 'Articles par page',
'selected' => $this->getData(['config', 'itemsperPage']),
'help' => 'Modules Blog et News'
@ -307,6 +307,35 @@
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres réseaux</h4>
<div class="row">
<div class="col2">
<?php echo template::select('configProxyType', $module::$proxyType, [
'label' => 'Type de proxy',
'selected' => $this->getData(['config', 'proxyType'])
]); ?>
</div>
<div class="col6">
<?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('configProxyPort', [
'label' => 'Port du proxy',
'placeholder' => '6060',
'value' => $this->getData(['config', 'proxyPort'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">

View File

@ -22,11 +22,15 @@ class init extends common {
'legalPageId' => 'mentions-legales',
'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
'title' => 'Votre site en quelques clics !'
'proxyUrl' => "",
'proxyPort' => "",
'proxyType' => "tcp://"
],
'core' => [
'dataVersion' => 10000,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
'baseUrl' => ''
],
'page' => [