[9.2.23] Proxy Web

This commit is contained in:
Fred Tempez 2020-03-02 13:08:03 +01:00
parent 83801a175c
commit 7bba87fed9
5 changed files with 79 additions and 4 deletions

View File

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

View File

@ -221,6 +221,25 @@ class common {
// Mise à jour des données core // Mise à jour des données core
$this->update(); $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);
}
} }
/** /**
@ -1061,6 +1080,16 @@ class common {
$this->setData(['core', 'dataVersion', 9221]); $this->setData(['core', 'dataVersion', 9221]);
$this->saveData(); $this->saveData();
} }
// 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();
}
} }
} }

View File

@ -147,6 +147,11 @@ class config extends common {
15 => '15 articles', 15 => '15 articles',
20 => '20 articles' 20 => '20 articles'
]; ];
// Type de proxy
public static $proxyType = [
'tcp://' => 'TCP',
'http://' => 'HTTP'
];
public function generateFiles() { public function generateFiles() {
@ -288,6 +293,9 @@ class config extends common {
$this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN) === true) { $this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN) === true) {
$this->setData(['core','lastAutoUpdate',0]); $this->setData(['core','lastAutoUpdate',0]);
} }
// Vérification du proxy
$proxy = $this->getData(['config','proxyType']) . $this->getData(['config','proxyUrl']) . ':' . $this->getData(['config','proxyPort']);
$this->setData([ $this->setData([
'config', 'config',
[ [
@ -310,9 +318,12 @@ class config extends common {
], ],
'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true), 'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true), 'title' => $this->getInput('configTitle', 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'), 'legalPageId' => $this->getInput('configLegalPageId'),
'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)
] ]
]); ]);
if(self::$inputNotices === []) { if(self::$inputNotices === []) {

View File

@ -53,7 +53,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::select('itemsperPage', $module::$ItemsList, [ <?php echo template::select('configItemsperPage', $module::$ItemsList, [
'label' => 'Articles par page', 'label' => 'Articles par page',
'selected' => $this->getData(['config', 'itemsperPage']), 'selected' => $this->getData(['config', 'itemsperPage']),
'help' => 'Modules Blog et News' 'help' => 'Modules Blog et News'
@ -285,6 +285,35 @@
</div> </div>
</div> </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="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">

View File

@ -21,12 +21,16 @@ class install extends common {
'timezone' => 'Europe/Paris', 'timezone' => 'Europe/Paris',
'title' => 'Zwii, votre site en quelques clics !', 'title' => 'Zwii, votre site en quelques clics !',
'itemsperPage' => 10, 'itemsperPage' => 10,
'legalPageId' => 'mentions-legales' 'legalPageId' => 'mentions-legales',
'proxyUrl' => "",
'proxyPort' => "",
'proxyType' => "tcp://"
], ],
'core' => [ 'core' => [
'dataVersion' => 0, 'dataVersion' => 0,
'lastBackup' => 0, 'lastBackup' => 0,
'lastClearTmp' => 0, 'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
'baseUrl' => '' 'baseUrl' => ''
], ],
'page' => [ 'page' => [