Merge branch '13000' of https://forge.chapril.org/ZwiiCMS-TEAM/ZwiiCMS into 13000
This commit is contained in:
commit
13af9832f7
@ -1,10 +1,16 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## Version 12.4.00
|
## Version 13.0.00
|
||||||
# Améliorations
|
# Améliorations
|
||||||
- Gestion des groupes de profils d'utilisateurs.
|
- Gestion des groupes de profils d'utilisateurs.
|
||||||
|
- Sécurise l'accès aux fonctions sensibles du CLMS.
|
||||||
- Améliore la gestion de la base de données et la génération du fichier de journalisation.
|
- Améliore la gestion de la base de données et la génération du fichier de journalisation.
|
||||||
- Stockage des données JSON, forçage au format objet.
|
- Stockage des données JSON, forçage au format objet.
|
||||||
|
- Correction de bugs mineurs dans la sauvegarde des modules installés.
|
||||||
|
|
||||||
|
## Version 12.4.00
|
||||||
|
- L'ID de session n'est plus transmise dans l'URL, les modules distribués ont été actualisés.
|
||||||
|
- Corrections de bug dans le module Blog, merci de consulter le fichier changes.log du module.
|
||||||
|
|
||||||
## Version 12.3.11
|
## Version 12.3.11
|
||||||
- Interdit la création d'une langue autrement que par un administrateur.
|
- Interdit la création d'une langue autrement que par un administrateur.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# ZwiiCMS 12.3.11
|
# ZwiiCMS 13.0.00
|
||||||
|
|
||||||
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
|
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# ZwiiCMS 12.3.11
|
# ZwiiCMS 13.0.00
|
||||||
|
|
||||||
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.
|
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.
|
||||||
|
|
||||||
|
@ -575,7 +575,7 @@ class layout extends common
|
|||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
and $this->getUser('group') < self::GROUP_MODERATOR
|
and $this->getUser('group') < self::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
||||||
@ -641,7 +641,7 @@ class layout extends common
|
|||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
and $this->getUser('group') < self::GROUP_MODERATOR
|
and $this->getUser('group') < self::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
||||||
@ -876,7 +876,7 @@ class layout extends common
|
|||||||
// Items de gauche
|
// Items de gauche
|
||||||
$leftItems = '';
|
$leftItems = '';
|
||||||
// Sélecteur de langues
|
// Sélecteur de langues
|
||||||
if ($this->getUser('group') >= self::GROUP_MODERATOR) {
|
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$leftItem = '';
|
$leftItem = '';
|
||||||
foreach (self::$languages as $key => $value) {
|
foreach (self::$languages as $key => $value) {
|
||||||
@ -893,7 +893,7 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Liste des pages
|
// Liste des pages
|
||||||
if ($this->getUser('group') >= self::GROUP_MODERATOR) {
|
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||||
$leftItems .= '<li><select id="barSelectPage">';
|
$leftItems .= '<li><select id="barSelectPage">';
|
||||||
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
||||||
$leftItems .= '<optgroup label="' . helper::translate('Pages orphelines') . '">';
|
$leftItems .= '<optgroup label="' . helper::translate('Pages orphelines') . '">';
|
||||||
@ -1006,7 +1006,7 @@ class layout extends common
|
|||||||
// Items de droite
|
// Items de droite
|
||||||
$rightItems = '';
|
$rightItems = '';
|
||||||
if (
|
if (
|
||||||
$this->getUser('group') >= self::GROUP_MODERATOR
|
$this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUser(
|
&& $this->getUser(
|
||||||
'permission',
|
'permission',
|
||||||
'filemanager'
|
'filemanager'
|
||||||
@ -1066,7 +1066,7 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
$this->getUser('group') >= self::GROUP_MODERATOR
|
$this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUser('permission', 'user', 'edit')
|
&& $this->getUser('permission', 'user', 'edit')
|
||||||
|
|
||||||
) {
|
) {
|
||||||
@ -1153,7 +1153,7 @@ class layout extends common
|
|||||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||||
if (
|
if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
and $this->getUser('group') >= self::GROUP_MODERATOR
|
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||||
) {
|
) {
|
||||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,7 @@ class core extends common
|
|||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
and $this->getUser('group') < self::GROUP_MODERATOR
|
and $this->getUser('group') < self::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$access = false;
|
$access = false;
|
||||||
|
@ -27,7 +27,7 @@ class common
|
|||||||
const GROUP_BANNED = -1;
|
const GROUP_BANNED = -1;
|
||||||
const GROUP_VISITOR = 0;
|
const GROUP_VISITOR = 0;
|
||||||
const GROUP_MEMBER = 1;
|
const GROUP_MEMBER = 1;
|
||||||
const GROUP_MODERATOR = 2;
|
const GROUP_EDITOR = 2;
|
||||||
const GROUP_ADMIN = 3;
|
const GROUP_ADMIN = 3;
|
||||||
const SIGNATURE_ID = 1;
|
const SIGNATURE_ID = 1;
|
||||||
const SIGNATURE_PSEUDO = 2;
|
const SIGNATURE_PSEUDO = 2;
|
||||||
@ -136,24 +136,24 @@ class common
|
|||||||
self::GROUP_BANNED => 'Banni',
|
self::GROUP_BANNED => 'Banni',
|
||||||
self::GROUP_VISITOR => 'Visiteur',
|
self::GROUP_VISITOR => 'Visiteur',
|
||||||
self::GROUP_MEMBER => 'Membre',
|
self::GROUP_MEMBER => 'Membre',
|
||||||
self::GROUP_MODERATOR => 'Éditeur',
|
self::GROUP_EDITOR => 'Éditeur',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
public static $groupEdits = [
|
public static $groupEdits = [
|
||||||
self::GROUP_BANNED => 'Banni',
|
self::GROUP_BANNED => 'Banni',
|
||||||
self::GROUP_MEMBER => 'Membre',
|
self::GROUP_MEMBER => 'Membre',
|
||||||
self::GROUP_MODERATOR => 'Éditeur',
|
self::GROUP_EDITOR => 'Éditeur',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
public static $groupNews = [
|
public static $groupNews = [
|
||||||
self::GROUP_MEMBER => 'Membre',
|
self::GROUP_MEMBER => 'Membre',
|
||||||
self::GROUP_MODERATOR => 'Éditeur',
|
self::GROUP_EDITOR => 'Éditeur',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
public static $groupPublics = [
|
public static $groupPublics = [
|
||||||
self::GROUP_VISITOR => 'Visiteur',
|
self::GROUP_VISITOR => 'Visiteur',
|
||||||
self::GROUP_MEMBER => 'Membre',
|
self::GROUP_MEMBER => 'Membre',
|
||||||
self::GROUP_MODERATOR => 'Éditeur',
|
self::GROUP_EDITOR => 'Éditeur',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -974,8 +974,8 @@ if ($this->getData(['core', 'dataVersion']) < 12309) {
|
|||||||
// tableau des langues installées
|
// tableau des langues installées
|
||||||
if (is_dir(self::DATA_DIR . $key)) {
|
if (is_dir(self::DATA_DIR . $key)) {
|
||||||
$d = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true);
|
$d = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true);
|
||||||
$d = array_merge($d['locale'],['poweredPageLabel' => 'Motorisé par']);
|
$d = array_merge($d['locale'], ['poweredPageLabel' => 'Motorisé par']);
|
||||||
$t ['locale'] = $d;
|
$t['locale'] = $d;
|
||||||
file_put_contents(self::DATA_DIR . $key . '/locale.json', json_encode($t));
|
file_put_contents(self::DATA_DIR . $key . '/locale.json', json_encode($t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -985,8 +985,8 @@ if ($this->getData(['core', 'dataVersion']) < 12309) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Version 12.4.00
|
// Version 12.4.00
|
||||||
if ($this->getData(['core', 'dataVersion']) < 12400) {
|
if ($this->getData(['core', 'dataVersion']) < 13000) {
|
||||||
|
|
||||||
// Nettoyage du dossier de langue d'installation'
|
// Nettoyage du dossier de langue d'installation'
|
||||||
if (file_exists('core/vendor/tinymce/langs/langs.zip'))
|
if (file_exists('core/vendor/tinymce/langs/langs.zip'))
|
||||||
unlink('core/vendor/tinymce/langs/langs.zip');
|
unlink('core/vendor/tinymce/langs/langs.zip');
|
||||||
@ -999,15 +999,27 @@ if ($this->getData(['core', 'dataVersion']) < 12400) {
|
|||||||
if (file_exists('core/module/install/ressource/i18n/gr_GR.json'))
|
if (file_exists('core/module/install/ressource/i18n/gr_GR.json'))
|
||||||
unlink('core/module/install/ressource/i18n/gr_GR.json');
|
unlink('core/module/install/ressource/i18n/gr_GR.json');
|
||||||
|
|
||||||
// Création du dossier partga pour les nouveaux droits
|
// Création du dossier partage pour les nouveaux droits
|
||||||
if (!is_dir(self::FILE_DIR . 'source/partage')) {
|
if (!is_dir(self::FILE_DIR . 'source/partage')) {
|
||||||
mkdir(self::FILE_DIR . 'source/partage');
|
mkdir(self::FILE_DIR . 'source/partage');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Efface le script router.php
|
// Efface le script router.php
|
||||||
if (file_exists('core/class/router.class.php'))
|
// if (file_exists('core/class/router.class.php'))
|
||||||
unlink('core/class/router.class.php');
|
// unlink('core/class/router.class.php');
|
||||||
|
|
||||||
|
// Ajouter le prénom comme pseudo et le pseudo comme signature
|
||||||
|
foreach ($this->getData(['user']) as $userId => $userIds) {
|
||||||
|
switch ($this->getData(['user', $userId, 'group'])) {
|
||||||
|
case '1':
|
||||||
|
case '2':
|
||||||
|
$this->setData(['user', $userId, 'profil', 1]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$this->setData(['user', $userId, 'profil', 0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Mise à jour
|
// Mise à jour
|
||||||
$this->setData(['core', 'dataVersion', 12400]);
|
$this->setData(['core', 'dataVersion', 13000]);
|
||||||
}
|
}
|
@ -367,10 +367,10 @@ class config extends common
|
|||||||
}
|
}
|
||||||
// Lire le contenu de l'archive dans le tableau files
|
// Lire le contenu de l'archive dans le tableau files
|
||||||
/*
|
/*
|
||||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||||
$stat = $zip->statIndex($i);
|
$stat = $zip->statIndex($i);
|
||||||
$files[] = (basename($stat['name']));
|
$files[] = (basename($stat['name']));
|
||||||
}*/
|
}*/
|
||||||
// Extraction de l'archive dans un dossier temporaire
|
// Extraction de l'archive dans un dossier temporaire
|
||||||
$tmpDir = uniqid(8);
|
$tmpDir = uniqid(8);
|
||||||
$success = $zip->extractTo(self::TEMP_DIR . $tmpDir);
|
$success = $zip->extractTo(self::TEMP_DIR . $tmpDir);
|
||||||
@ -647,26 +647,36 @@ class config extends common
|
|||||||
|
|
||||||
public function logReset()
|
public function logReset()
|
||||||
{
|
{
|
||||||
if (file_exists(self::DATA_DIR . 'journal.log')) {
|
// Action interdite
|
||||||
unlink(self::DATA_DIR . 'journal.log');
|
if (
|
||||||
// Créer les en-têtes des journaux
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
) {
|
||||||
file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Configuration'),
|
'access' => false
|
||||||
'view' => 'index',
|
|
||||||
'notification' => helper::translate('Journal réinitialisé avec succès'),
|
|
||||||
'state' => true
|
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Valeurs en sortie
|
if (file_exists(self::DATA_DIR . 'journal.log')) {
|
||||||
$this->addOutput([
|
unlink(self::DATA_DIR . 'journal.log');
|
||||||
'title' => helper::translate('Configuration'),
|
// Créer les en-têtes des journaux
|
||||||
'view' => 'index',
|
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
||||||
'notification' => helper::translate('Aucun journal à effacer'),
|
file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||||
'state' => false
|
// Valeurs en sortie
|
||||||
]);
|
$this->addOutput([
|
||||||
|
'title' => helper::translate('Configuration'),
|
||||||
|
'view' => 'index',
|
||||||
|
'notification' => helper::translate('Journal réinitialisé avec succès'),
|
||||||
|
'state' => true
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'title' => helper::translate('Configuration'),
|
||||||
|
'view' => 'index',
|
||||||
|
'notification' => helper::translate('Aucun journal à effacer'),
|
||||||
|
'state' => false
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -677,25 +687,35 @@ class config extends common
|
|||||||
*/
|
*/
|
||||||
public function logDownload()
|
public function logDownload()
|
||||||
{
|
{
|
||||||
$fileName = self::DATA_DIR . 'journal.log';
|
// Action interdite
|
||||||
if (file_exists($fileName)) {
|
if (
|
||||||
ob_start();
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
header('Content-Description: File Transfer');
|
) {
|
||||||
header('Content-Type: application/octet-stream');
|
|
||||||
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
|
||||||
header('Content-Length: ' . filesize($fileName));
|
|
||||||
ob_clean();
|
|
||||||
ob_end_flush();
|
|
||||||
readfile($fileName);
|
|
||||||
exit();
|
|
||||||
} else {
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Configuration'),
|
'access' => false
|
||||||
'view' => 'index',
|
|
||||||
'notification' => helper::translate('Aucun fichier journal à télécharger'),
|
|
||||||
'state' => false
|
|
||||||
]);
|
]);
|
||||||
|
} else {
|
||||||
|
$fileName = self::DATA_DIR . 'journal.log';
|
||||||
|
if (file_exists($fileName)) {
|
||||||
|
ob_start();
|
||||||
|
header('Content-Description: File Transfer');
|
||||||
|
header('Content-Type: application/octet-stream');
|
||||||
|
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
||||||
|
header('Content-Length: ' . filesize($fileName));
|
||||||
|
ob_clean();
|
||||||
|
ob_end_flush();
|
||||||
|
readfile($fileName);
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'title' => helper::translate('Configuration'),
|
||||||
|
'view' => 'index',
|
||||||
|
'notification' => helper::translate('Aucun fichier journal à télécharger'),
|
||||||
|
'state' => false
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,36 +724,46 @@ class config extends common
|
|||||||
*/
|
*/
|
||||||
public function blacklistDownload()
|
public function blacklistDownload()
|
||||||
{
|
{
|
||||||
ob_start();
|
// Action interdite
|
||||||
$fileName = self::TEMP_DIR . 'blacklist.log';
|
if (
|
||||||
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
file_put_contents($fileName, $d);
|
) {
|
||||||
if (file_exists($fileName)) {
|
|
||||||
$d = $this->getData(['blacklist']);
|
|
||||||
$data = '';
|
|
||||||
foreach ($d as $key => $item) {
|
|
||||||
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail']) . ' - ' . helper::dateUTF8('%H:%M', time());
|
|
||||||
$data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL;
|
|
||||||
}
|
|
||||||
file_put_contents($fileName, $data, FILE_APPEND);
|
|
||||||
header('Content-Description: File Transfer');
|
|
||||||
header('Content-Type: application/octet-stream');
|
|
||||||
header('Content-Transfer-Encoding: binary');
|
|
||||||
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
|
||||||
header('Content-Length: ' . filesize($fileName));
|
|
||||||
ob_clean();
|
|
||||||
ob_end_flush();
|
|
||||||
readfile($fileName);
|
|
||||||
unlink(self::TEMP_DIR . 'blacklist.log');
|
|
||||||
exit();
|
|
||||||
} else {
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Confighelper::translate(uration'),
|
'access' => false
|
||||||
'view' => 'index',
|
|
||||||
'notification' => helper::translate('Aucune liste noire à télécharger'),
|
|
||||||
'state' => false
|
|
||||||
]);
|
]);
|
||||||
|
} else {
|
||||||
|
ob_start();
|
||||||
|
$fileName = self::TEMP_DIR . 'blacklist.log';
|
||||||
|
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
|
||||||
|
file_put_contents($fileName, $d);
|
||||||
|
if (file_exists($fileName)) {
|
||||||
|
$d = $this->getData(['blacklist']);
|
||||||
|
$data = '';
|
||||||
|
foreach ($d as $key => $item) {
|
||||||
|
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail']) . ' - ' . helper::dateUTF8('%H:%M', time());
|
||||||
|
$data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL;
|
||||||
|
}
|
||||||
|
file_put_contents($fileName, $data, FILE_APPEND);
|
||||||
|
header('Content-Description: File Transfer');
|
||||||
|
header('Content-Type: application/octet-stream');
|
||||||
|
header('Content-Transfer-Encoding: binary');
|
||||||
|
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
||||||
|
header('Content-Length: ' . filesize($fileName));
|
||||||
|
ob_clean();
|
||||||
|
ob_end_flush();
|
||||||
|
readfile($fileName);
|
||||||
|
unlink(self::TEMP_DIR . 'blacklist.log');
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'title' => helper::translate('Confighelper::translate(uration'),
|
||||||
|
'view' => 'index',
|
||||||
|
'notification' => helper::translate('Aucune liste noire à télécharger'),
|
||||||
|
'state' => false
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,23 +773,33 @@ class config extends common
|
|||||||
|
|
||||||
public function blacklistReset()
|
public function blacklistReset()
|
||||||
{
|
{
|
||||||
if (file_exists(self::DATA_DIR . 'blacklist.json')) {
|
// Action interdite
|
||||||
$this->setData(['blacklist', []]);
|
if (
|
||||||
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Configuration'),
|
'access' => false
|
||||||
'view' => 'index',
|
|
||||||
'notification' => helper::translate('Liste noire réinitialisée avec succès'),
|
|
||||||
'state' => true
|
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Valeurs en sortie
|
if (file_exists(self::DATA_DIR . 'blacklist.json')) {
|
||||||
$this->addOutput([
|
$this->setData(['blacklist', []]);
|
||||||
'title' => helper::translate('Configuration'),
|
// Valeurs en sortie
|
||||||
'view' => 'index',
|
$this->addOutput([
|
||||||
'notification' => helper::translate('Aucune liste noire à effacer'),
|
'title' => helper::translate('Configuration'),
|
||||||
'state' => false
|
'view' => 'index',
|
||||||
]);
|
'notification' => helper::translate('Liste noire réinitialisée avec succès'),
|
||||||
|
'state' => true
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'title' => helper::translate('Configuration'),
|
||||||
|
'view' => 'index',
|
||||||
|
'notification' => helper::translate('Aucune liste noire à effacer'),
|
||||||
|
'state' => false
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -768,16 +808,26 @@ class config extends common
|
|||||||
*/
|
*/
|
||||||
public function copyBackups()
|
public function copyBackups()
|
||||||
{
|
{
|
||||||
|
// Action interdite
|
||||||
|
if (
|
||||||
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
|
) {
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'access' => false
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
|
||||||
$success = $this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup');
|
$success = $this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup');
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Configuration'),
|
'title' => helper::translate('Configuration'),
|
||||||
'view' => 'index',
|
'view' => 'index',
|
||||||
'notification' => $success ? helper::translate('Copie terminée avec succès') : helper::translate('Copie terminée avec des erreurs'),
|
'notification' => $success ? helper::translate('Copie terminée avec succès') : helper::translate('Copie terminée avec des erreurs'),
|
||||||
'state' => $success
|
'state' => $success
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -785,22 +835,32 @@ class config extends common
|
|||||||
*/
|
*/
|
||||||
public function delBackups()
|
public function delBackups()
|
||||||
{
|
{
|
||||||
$path = realpath(self::BACKUP_DIR);
|
// Action interdite
|
||||||
$success = $fail = 0;
|
if (
|
||||||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) {
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
if (strpos($filename, '.zip')) {
|
) {
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'access' => false
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$path = realpath(self::BACKUP_DIR);
|
||||||
|
$success = $fail = 0;
|
||||||
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) {
|
||||||
|
if (strpos($filename, '.zip')) {
|
||||||
|
|
||||||
$r = unlink($filename);
|
$r = unlink($filename);
|
||||||
$success = $r === true ? $success + 1 : $success;
|
$success = $r === true ? $success + 1 : $success;
|
||||||
$fail = $r === false ? $fail + 1 : $fail;
|
$fail = $r === false ? $fail + 1 : $fail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'title' => helper::translate('Configuration'),
|
||||||
|
'view' => 'index',
|
||||||
|
'notification' => $success . helper::translate('Fichiers effacés') . ' - ' . helper::translate('Échecs') . ': ' . $fail,
|
||||||
|
'state' => true
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
// Valeurs en sortie
|
|
||||||
$this->addOutput([
|
|
||||||
'title' => helper::translate('Configuration'),
|
|
||||||
'view' => 'index',
|
|
||||||
'notification' => $success . helper::translate('Fichiers effacés') . ' - ' . helper::translate('Échecs') . ': ' . $fail,
|
|
||||||
'state' => true
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -273,147 +273,157 @@ class install extends common
|
|||||||
*/
|
*/
|
||||||
public function steps()
|
public function steps()
|
||||||
{
|
{
|
||||||
switch ($this->getInput('step', helper::FILTER_INT)) {
|
// Action interdite
|
||||||
// Préparation
|
if (
|
||||||
case 1:
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
$success = true;
|
) {
|
||||||
$message = '';
|
// Valeurs en sortie
|
||||||
// RAZ la mise à jour auto
|
$this->addOutput([
|
||||||
$this->setData(['core', 'updateAvailable', false]);
|
'access' => false
|
||||||
// Backup du dossier Data
|
]);
|
||||||
helper::autoBackup(self::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
} else {
|
||||||
// Sauvegarde htaccess
|
switch ($this->getInput('step', helper::FILTER_INT)) {
|
||||||
if ($this->getData(['config', 'autoUpdateHtaccess'])) {
|
// Préparation
|
||||||
$success = copy('.htaccess', '.htaccess' . '.bak');
|
case 1:
|
||||||
$message = 'Erreur de copie du fichier htaccess';
|
$success = true;
|
||||||
}
|
$message = '';
|
||||||
// Nettoyage des fichiers d'installation précédents
|
// RAZ la mise à jour auto
|
||||||
if (file_exists(self::TEMP_DIR . 'update.tar.gz') && $success) {
|
$this->setData(['core', 'updateAvailable', false]);
|
||||||
$success = $success || unlink(self::TEMP_DIR . 'update.tar.gz');
|
// Backup du dossier Data
|
||||||
$message = 'Impossible d\'effacer la mise à jour précédente';
|
helper::autoBackup(self::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
||||||
}
|
// Sauvegarde htaccess
|
||||||
if (file_exists(self::TEMP_DIR . 'update.tar') && $success) {
|
if ($this->getData(['config', 'autoUpdateHtaccess'])) {
|
||||||
$success = $success || unlink(self::TEMP_DIR . 'update.tar');
|
$success = copy('.htaccess', '.htaccess' . '.bak');
|
||||||
$message = 'Impossible d\'effacer la mise à jour précédente';
|
$message = 'Erreur de copie du fichier htaccess';
|
||||||
}
|
}
|
||||||
// Valeurs en sortie
|
// Nettoyage des fichiers d'installation précédents
|
||||||
$this->addOutput([
|
if (file_exists(self::TEMP_DIR . 'update.tar.gz') && $success) {
|
||||||
'display' => self::DISPLAY_JSON,
|
$success = $success || unlink(self::TEMP_DIR . 'update.tar.gz');
|
||||||
'content' => [
|
$message = 'Impossible d\'effacer la mise à jour précédente';
|
||||||
'success' => $success,
|
}
|
||||||
'data' => $success ? null : json_encode($message, JSON_UNESCAPED_UNICODE)
|
if (file_exists(self::TEMP_DIR . 'update.tar') && $success) {
|
||||||
]
|
$success = $success || unlink(self::TEMP_DIR . 'update.tar');
|
||||||
]);
|
$message = 'Impossible d\'effacer la mise à jour précédente';
|
||||||
break;
|
}
|
||||||
// Téléchargement
|
// Valeurs en sortie
|
||||||
case 2:
|
$this->addOutput([
|
||||||
file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
'display' => self::DISPLAY_JSON,
|
||||||
$md5origin = helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.md5');
|
'content' => [
|
||||||
$md5origin = explode(' ', $md5origin);
|
'success' => $success,
|
||||||
$md5target = md5_file(self::TEMP_DIR . 'update.tar.gz');
|
'data' => $success ? null : json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||||
// Valeurs en sortie
|
]
|
||||||
$this->addOutput([
|
]);
|
||||||
'display' => self::DISPLAY_JSON,
|
break;
|
||||||
'content' => [
|
// Téléchargement
|
||||||
'success' => $md5origin[0] === $md5target,
|
case 2:
|
||||||
'data' => $md5origin[0] === $md5target ? null : json_encode('Erreur de téléchargement ou de somme de contrôle', JSON_UNESCAPED_UNICODE)
|
file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
||||||
]
|
$md5origin = helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.md5');
|
||||||
]);
|
$md5origin = explode(' ', $md5origin);
|
||||||
break;
|
$md5target = md5_file(self::TEMP_DIR . 'update.tar.gz');
|
||||||
// Installation
|
// Valeurs en sortie
|
||||||
case 3:
|
$this->addOutput([
|
||||||
$success = true;
|
'display' => self::DISPLAY_JSON,
|
||||||
// Check la réécriture d'URL avant d'écraser les fichiers
|
'content' => [
|
||||||
$rewrite = helper::checkRewrite();
|
'success' => $md5origin[0] === $md5target,
|
||||||
// Décompression et installation
|
'data' => $md5origin[0] === $md5target ? null : json_encode('Erreur de téléchargement ou de somme de contrôle', JSON_UNESCAPED_UNICODE)
|
||||||
try {
|
]
|
||||||
// Décompression dans le dossier de fichier temporaires
|
]);
|
||||||
$pharData = new PharData(self::TEMP_DIR . 'update.tar.gz');
|
break;
|
||||||
$pharData->decompress();
|
// Installation
|
||||||
// Installation
|
case 3:
|
||||||
$pharData->extractTo(__DIR__ . '/../../../', null, true);
|
$success = true;
|
||||||
} catch (Exception $e) {
|
// Check la réécriture d'URL avant d'écraser les fichiers
|
||||||
$success = $e->getMessage();
|
$rewrite = helper::checkRewrite();
|
||||||
}
|
// Décompression et installation
|
||||||
// Nettoyage du dossier
|
try {
|
||||||
if (file_exists(self::TEMP_DIR . 'update.tar.gz')) {
|
// Décompression dans le dossier de fichier temporaires
|
||||||
unlink(self::TEMP_DIR . 'update.tar.gz');
|
$pharData = new PharData(self::TEMP_DIR . 'update.tar.gz');
|
||||||
}
|
$pharData->decompress();
|
||||||
if (file_exists(self::TEMP_DIR . 'update.tar')) {
|
// Installation
|
||||||
unlink(self::TEMP_DIR . 'update.tar');
|
$pharData->extractTo(__DIR__ . '/../../../', null, true);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
// Valeurs en sortie
|
$success = $e->getMessage();
|
||||||
$this->addOutput([
|
}
|
||||||
'display' => self::DISPLAY_JSON,
|
// Nettoyage du dossier
|
||||||
'content' => [
|
if (file_exists(self::TEMP_DIR . 'update.tar.gz')) {
|
||||||
'success' => $success,
|
unlink(self::TEMP_DIR . 'update.tar.gz');
|
||||||
'data' => $rewrite
|
}
|
||||||
]
|
if (file_exists(self::TEMP_DIR . 'update.tar')) {
|
||||||
]);
|
unlink(self::TEMP_DIR . 'update.tar');
|
||||||
break;
|
}
|
||||||
// Configuration
|
// Valeurs en sortie
|
||||||
case 4:
|
$this->addOutput([
|
||||||
$success = true;
|
'display' => self::DISPLAY_JSON,
|
||||||
$message = '';
|
'content' => [
|
||||||
$rewrite = $this->getInput('data');
|
'success' => $success,
|
||||||
// Réécriture d'URL
|
'data' => $rewrite
|
||||||
if ($rewrite === 'true') { // Ajout des lignes dans le .htaccess
|
]
|
||||||
$fileContent = file_get_contents('.htaccess');
|
]);
|
||||||
$rewriteData = PHP_EOL .
|
break;
|
||||||
'# URL rewriting' . PHP_EOL .
|
// Configuration
|
||||||
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
case 4:
|
||||||
"\tRewriteEngine on" . PHP_EOL .
|
$success = true;
|
||||||
"\tRewriteBase " . helper::baseUrl(false, false) . PHP_EOL .
|
$message = '';
|
||||||
"\tRewriteCond %{REQUEST_FILENAME} !-f" . PHP_EOL .
|
$rewrite = $this->getInput('data');
|
||||||
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
// Réécriture d'URL
|
||||||
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
if ($rewrite === 'true') { // Ajout des lignes dans le .htaccess
|
||||||
'</IfModule>' . PHP_EOL .
|
$fileContent = file_get_contents('.htaccess');
|
||||||
'# URL rewriting' . PHP_EOL;
|
$rewriteData = PHP_EOL .
|
||||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
'# URL rewriting' . PHP_EOL .
|
||||||
$r = file_put_contents(
|
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
||||||
'.htaccess',
|
"\tRewriteEngine on" . PHP_EOL .
|
||||||
$fileContent
|
"\tRewriteBase " . helper::baseUrl(false, false) . PHP_EOL .
|
||||||
);
|
"\tRewriteCond %{REQUEST_FILENAME} !-f" . PHP_EOL .
|
||||||
$success = $r === false ? false : true;
|
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
||||||
$message = $r === false ? 'Le fichier htaccess n\'a pas été restauré' : null;
|
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
||||||
}
|
'</IfModule>' . PHP_EOL .
|
||||||
// Recopie htaccess
|
'# URL rewriting' . PHP_EOL;
|
||||||
if (
|
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||||
$this->getData(['config', 'autoUpdateHtaccess']) &&
|
$r = file_put_contents(
|
||||||
$success && file_exists('.htaccess.bak')
|
'.htaccess',
|
||||||
) {
|
$fileContent
|
||||||
// L'écraser avec le backup
|
);
|
||||||
$success = $success || copy('.htaccess.bak', '.htaccess');
|
$success = $r === false ? false : true;
|
||||||
// Effacer le backup
|
$message = $r === false ? 'Le fichier htaccess n\'a pas été restauré' : null;
|
||||||
unlink('.htaccess.bak');
|
}
|
||||||
}
|
// Recopie htaccess
|
||||||
|
if (
|
||||||
/**
|
$this->getData(['config', 'autoUpdateHtaccess']) &&
|
||||||
* Met à jour les dictionnaires des langues depuis les modèles installés
|
$success && file_exists('.htaccess.bak')
|
||||||
*/
|
) {
|
||||||
|
// L'écraser avec le backup
|
||||||
// Langues installées
|
$success = $success || copy('.htaccess.bak', '.htaccess');
|
||||||
$installedUI = $this->getData(['language']);
|
// Effacer le backup
|
||||||
|
unlink('.htaccess.bak');
|
||||||
// Langues disponibles avec la mise à jour
|
|
||||||
require_once('core/module/install/ressource/defaultdata.php');
|
|
||||||
$default = init::$defaultData['language'];
|
|
||||||
|
|
||||||
foreach ($installedUI as $key => $value) {
|
|
||||||
if ($default[$key]['version'] > $value['version']) {
|
|
||||||
copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json');
|
|
||||||
$this->setData(['language', $key, $default[$key]]);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Valeurs en sortie
|
/**
|
||||||
$this->addOutput([
|
* Met à jour les dictionnaires des langues depuis les modèles installés
|
||||||
'display' => self::DISPLAY_JSON,
|
*/
|
||||||
'content' => [
|
|
||||||
'success' => $success,
|
// Langues installées
|
||||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
$installedUI = $this->getData(['language']);
|
||||||
]
|
|
||||||
]);
|
// Langues disponibles avec la mise à jour
|
||||||
|
require_once('core/module/install/ressource/defaultdata.php');
|
||||||
|
$default = init::$defaultData['language'];
|
||||||
|
|
||||||
|
foreach ($installedUI as $key => $value) {
|
||||||
|
if ($default[$key]['version'] > $value['version']) {
|
||||||
|
copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json');
|
||||||
|
$this->setData(['language', $key, $default[$key]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'display' => self::DISPLAY_JSON,
|
||||||
|
'content' => [
|
||||||
|
'success' => $success,
|
||||||
|
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ class init extends common
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
'2' => [
|
'2' => [
|
||||||
'name' => 'Membre',
|
'name' => 'Membre avec droit de partage',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => 'Accède aux pages réservées et à un dossier partagé',
|
'comment' => 'Accède aux pages réservées et à un dossier partagé',
|
||||||
'filemanager' => true,
|
'filemanager' => true,
|
||||||
@ -475,7 +475,7 @@ class init extends common
|
|||||||
],
|
],
|
||||||
'2' => [
|
'2' => [
|
||||||
'1' => [
|
'1' => [
|
||||||
'name' => 'Modérateur',
|
'name' => 'Editeur simple',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => 'Édition des pages',
|
'comment' => 'Édition des pages',
|
||||||
'filemanager' => true,
|
'filemanager' => true,
|
||||||
|
@ -18,12 +18,12 @@ class page extends common
|
|||||||
{
|
{
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'add' => self::GROUP_MODERATOR,
|
'add' => self::GROUP_EDITOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_EDITOR,
|
||||||
'edit' => self::GROUP_MODERATOR,
|
'edit' => self::GROUP_EDITOR,
|
||||||
'duplicate' => self::GROUP_MODERATOR,
|
'duplicate' => self::GROUP_EDITOR,
|
||||||
'jsEditor' => self::GROUP_MODERATOR,
|
'jsEditor' => self::GROUP_EDITOR,
|
||||||
'cssEditor' => self::GROUP_MODERATOR
|
'cssEditor' => self::GROUP_EDITOR
|
||||||
];
|
];
|
||||||
public static $pagesNoParentId = [
|
public static $pagesNoParentId = [
|
||||||
'' => 'Aucune'
|
'' => 'Aucune'
|
||||||
|
@ -580,7 +580,7 @@ class plugin extends common
|
|||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Créer un dossier temporaire
|
// Créer un dossier temporaire
|
||||||
$tmpFolder = self::TEMP_DIR . uniqid();
|
$tmpFolder = self::TEMP_DIR . uniqid() . '/';
|
||||||
if (!is_dir($tmpFolder)) {
|
if (!is_dir($tmpFolder)) {
|
||||||
mkdir($tmpFolder, 0755);
|
mkdir($tmpFolder, 0755);
|
||||||
}
|
}
|
||||||
@ -590,21 +590,19 @@ class plugin extends common
|
|||||||
|
|
||||||
// Descripteur de l'archive
|
// Descripteur de l'archive
|
||||||
$infoModule = helper::getModules();
|
$infoModule = helper::getModules();
|
||||||
//Nom de l'archive
|
|
||||||
$fileName = $moduleId . $infoModule[$moduleId]['version'] . '.zip';
|
|
||||||
|
|
||||||
// Régénération du module
|
//Nom de l'archive
|
||||||
$success = file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', json_encode($infoModule[$moduleId], JSON_UNESCAPED_UNICODE));
|
$fileName = $moduleId . str_replace('.', '-', $infoModule[$moduleId]['version']) . '.zip';
|
||||||
|
|
||||||
|
// Régénération du descripteur du module
|
||||||
|
file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', json_encode($infoModule[$moduleId], JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
// Construire l'archive
|
// Construire l'archive
|
||||||
$this->makeZip(self::TEMP_DIR . $fileName, self::MODULE_DIR . $moduleId);
|
$this->makeZip( $tmpFolder . $fileName, self::MODULE_DIR . $moduleId);
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'filemanager':
|
case 'filemanager':
|
||||||
if (!file_exists(self::FILE_DIR . 'source/modules')) {
|
$success = copy($tmpFolder . $fileName, self::FILE_DIR . 'source/modules/' . $fileName );
|
||||||
mkdir(self::FILE_DIR . 'source/modules');
|
|
||||||
}
|
|
||||||
$success = $success || copy(self::TEMP_DIR . $fileName, self::FILE_DIR . 'source/modules/' . $moduleId . '.zip');
|
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -612,24 +610,20 @@ class plugin extends common
|
|||||||
'notification' => $success ? helper::translate('Archive copiée dans le dossier Modules du gestionnaire de fichier') : helper::translate('Erreur de copie'),
|
'notification' => $success ? helper::translate('Archive copiée dans le dossier Modules du gestionnaire de fichier') : helper::translate('Erreur de copie'),
|
||||||
'state' => $success
|
'state' => $success
|
||||||
]);
|
]);
|
||||||
// Nettoyage
|
|
||||||
unlink(self::TEMP_DIR . $fileName);
|
|
||||||
$this->removeDir($tmpFolder);
|
|
||||||
break;
|
break;
|
||||||
case 'download':
|
case 'download':
|
||||||
default:
|
|
||||||
|
|
||||||
// Téléchargement du ZIP
|
// Téléchargement du ZIP
|
||||||
header('Content-Description: File Transfer');
|
header('Content-Description: File Transfer');
|
||||||
header('Content-Type: application/octet-stream');
|
header('Content-Type: application/octet-stream');
|
||||||
header('Content-Transfer-Encoding: binary');
|
header('Content-Transfer-Encoding: binary');
|
||||||
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
header('Content-Disposition: attachment; filename="' . $fileName . '"');
|
||||||
header('Content-Length: ' . filesize(self::TEMP_DIR . $fileName));
|
header('Content-Length: ' . filesize($tmpFolder. $fileName));
|
||||||
readfile(self::TEMP_DIR . $fileName);
|
readfile($tmpFolder . $fileName);
|
||||||
// Nettoyage du dossier
|
|
||||||
unlink(self::TEMP_DIR . $fileName);
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
// Nettoyage
|
||||||
|
unlink(self::TEMP_DIR . $fileName);
|
||||||
|
$this->removeDir($tmpFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1016,81 +1016,91 @@ class theme extends common
|
|||||||
|
|
||||||
public function import($zipName = '')
|
public function import($zipName = '')
|
||||||
{
|
{
|
||||||
|
// Action interdite
|
||||||
if (
|
if (
|
||||||
$zipName !== '' &&
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
file_exists($zipName)
|
|
||||||
) {
|
) {
|
||||||
// Init variables de retour
|
// Valeurs en sortie
|
||||||
$success = false;
|
$this->addOutput([
|
||||||
$notification = '';
|
'access' => false
|
||||||
// Dossier temporaire
|
]);
|
||||||
$tempFolder = uniqid();
|
} else {
|
||||||
// Ouvrir le zip
|
|
||||||
$zip = new ZipArchive();
|
|
||||||
if ($zip->open($zipName) === TRUE) {
|
|
||||||
mkdir(self::TEMP_DIR . $tempFolder, 0755);
|
|
||||||
$zip->extractTo(self::TEMP_DIR . $tempFolder);
|
|
||||||
$modele = '';
|
|
||||||
// Archive de thème ?
|
|
||||||
if (
|
|
||||||
file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css')
|
|
||||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css')
|
|
||||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json')
|
|
||||||
) {
|
|
||||||
$modele = 'theme';
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.json')
|
|
||||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.css')
|
|
||||||
) {
|
|
||||||
$modele = 'admin';
|
|
||||||
}
|
|
||||||
if (!empty($modele)) {
|
|
||||||
// traiter l'archive
|
|
||||||
$success = $zip->extractTo('.');
|
|
||||||
|
|
||||||
// Substitution des fontes Google
|
if (
|
||||||
if ($modele = 'theme') {
|
$zipName !== '' &&
|
||||||
$c = $this->subFont(self::DATA_DIR . 'theme.json');
|
file_exists($zipName)
|
||||||
// Un remplacement nécessite la régénération de la feuille de style
|
) {
|
||||||
if (
|
// Init variables de retour
|
||||||
$c > 0
|
|
||||||
and file_exists(self::DATA_DIR . 'theme.css')
|
|
||||||
) {
|
|
||||||
unlink(self::DATA_DIR . 'theme.css');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($modele = 'admin') {
|
|
||||||
$c = $this->subFont(self::DATA_DIR . 'admin.json');
|
|
||||||
// Un remplacement nécessite la régénération de la feuille de style
|
|
||||||
if (
|
|
||||||
$c > 0
|
|
||||||
and file_exists(self::DATA_DIR . 'admin.css')
|
|
||||||
) {
|
|
||||||
unlink(self::DATA_DIR . 'admin.css');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// traitement d'erreur
|
|
||||||
$notification = $success ? helper::translate('Thème importé') : helper::translate('Erreur lors de l\'extraction, vérifiez les permissions');
|
|
||||||
} else {
|
|
||||||
// pas une archive de thème
|
|
||||||
$success = false;
|
|
||||||
$notification = helper::translate('Archive de thème invalide');
|
|
||||||
}
|
|
||||||
// Supprimer le dossier temporaire même si le thème est invalide
|
|
||||||
$this->removeDir(self::TEMP_DIR . $tempFolder);
|
|
||||||
$zip->close();
|
|
||||||
} else {
|
|
||||||
// erreur à l'ouverture
|
|
||||||
$success = false;
|
$success = false;
|
||||||
$notification = helper::translate('Impossible d\'ouvrir l\'archive');
|
$notification = '';
|
||||||
}
|
// Dossier temporaire
|
||||||
return (['success' => $success, 'notification' => $notification]);
|
$tempFolder = uniqid();
|
||||||
}
|
// Ouvrir le zip
|
||||||
|
$zip = new ZipArchive();
|
||||||
|
if ($zip->open($zipName) === TRUE) {
|
||||||
|
mkdir(self::TEMP_DIR . $tempFolder, 0755);
|
||||||
|
$zip->extractTo(self::TEMP_DIR . $tempFolder);
|
||||||
|
$modele = '';
|
||||||
|
// Archive de thème ?
|
||||||
|
if (
|
||||||
|
file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css')
|
||||||
|
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css')
|
||||||
|
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json')
|
||||||
|
) {
|
||||||
|
$modele = 'theme';
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.json')
|
||||||
|
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.css')
|
||||||
|
) {
|
||||||
|
$modele = 'admin';
|
||||||
|
}
|
||||||
|
if (!empty($modele)) {
|
||||||
|
// traiter l'archive
|
||||||
|
$success = $zip->extractTo('.');
|
||||||
|
|
||||||
return (['success' => false, 'notification' => helper::translate('Archive non spécifiée ou introuvable')]);
|
// Substitution des fontes Google
|
||||||
|
if ($modele = 'theme') {
|
||||||
|
$c = $this->subFont(self::DATA_DIR . 'theme.json');
|
||||||
|
// Un remplacement nécessite la régénération de la feuille de style
|
||||||
|
if (
|
||||||
|
$c > 0
|
||||||
|
and file_exists(self::DATA_DIR . 'theme.css')
|
||||||
|
) {
|
||||||
|
unlink(self::DATA_DIR . 'theme.css');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($modele = 'admin') {
|
||||||
|
$c = $this->subFont(self::DATA_DIR . 'admin.json');
|
||||||
|
// Un remplacement nécessite la régénération de la feuille de style
|
||||||
|
if (
|
||||||
|
$c > 0
|
||||||
|
and file_exists(self::DATA_DIR . 'admin.css')
|
||||||
|
) {
|
||||||
|
unlink(self::DATA_DIR . 'admin.css');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// traitement d'erreur
|
||||||
|
$notification = $success ? helper::translate('Thème importé') : helper::translate('Erreur lors de l\'extraction, vérifiez les permissions');
|
||||||
|
} else {
|
||||||
|
// pas une archive de thème
|
||||||
|
$success = false;
|
||||||
|
$notification = helper::translate('Archive de thème invalide');
|
||||||
|
}
|
||||||
|
// Supprimer le dossier temporaire même si le thème est invalide
|
||||||
|
$this->removeDir(self::TEMP_DIR . $tempFolder);
|
||||||
|
$zip->close();
|
||||||
|
} else {
|
||||||
|
// erreur à l'ouverture
|
||||||
|
$success = false;
|
||||||
|
$notification = helper::translate('Impossible d\'ouvrir l\'archive');
|
||||||
|
}
|
||||||
|
return (['success' => $success, 'notification' => $notification]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (['success' => false, 'notification' => helper::translate('Archive non spécifiée ou introuvable')]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class user extends common
|
|||||||
|
|
||||||
public static $groupProfils = [
|
public static $groupProfils = [
|
||||||
self::GROUP_MEMBER => 'Membre',
|
self::GROUP_MEMBER => 'Membre',
|
||||||
self::GROUP_MODERATOR => 'Editeur'
|
self::GROUP_EDITOR => 'Editeur'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,8 +98,8 @@ class user extends common
|
|||||||
|
|
||||||
// Profil
|
// Profil
|
||||||
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
||||||
$profil = null;
|
$profil = 0;
|
||||||
if ($group > 1 || $group < 2) {
|
if ($group === 1 || $group === 2) {
|
||||||
$profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT);
|
$profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class user extends common
|
|||||||
// L'utilisateur n'existe pas
|
// L'utilisateur n'existe pas
|
||||||
$this->getData(['user', $this->getUrl(2)]) === null
|
$this->getData(['user', $this->getUrl(2)]) === null
|
||||||
// Groupe insuffisant
|
// Groupe insuffisant
|
||||||
and ($this->getUrl('group') < self::GROUP_MODERATOR)
|
and ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -251,7 +251,7 @@ class user extends common
|
|||||||
and $this->getUrl('group') <= self::GROUP_VISITOR
|
and $this->getUrl('group') <= self::GROUP_VISITOR
|
||||||
)
|
)
|
||||||
// Impossible d'éditer un autre utilisateur
|
// Impossible d'éditer un autre utilisateur
|
||||||
or ($this->getUrl('group') < self::GROUP_MODERATOR)
|
or ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -303,8 +303,8 @@ class user extends common
|
|||||||
$newlastname = $this->getData(['user', $this->getUrl(2), 'lastname']);
|
$newlastname = $this->getData(['user', $this->getUrl(2), 'lastname']);
|
||||||
}
|
}
|
||||||
// Profil
|
// Profil
|
||||||
$profil = null;
|
$profil = 0;
|
||||||
if ($newGroup > 1 || $newGroup < 2) {
|
if ($newGroup === 1 || $newGroup === 2) {
|
||||||
$profil = $this->getInput('userEditProfil' . $newGroup, helper::FILTER_INT);
|
$profil = $this->getInput('userEditProfil' . $newGroup, helper::FILTER_INT);
|
||||||
}
|
}
|
||||||
// Modifie l'utilisateur
|
// Modifie l'utilisateur
|
||||||
@ -503,7 +503,7 @@ class user extends common
|
|||||||
];
|
];
|
||||||
} elseif (
|
} elseif (
|
||||||
$groupId == self::GROUP_MEMBER ||
|
$groupId == self::GROUP_MEMBER ||
|
||||||
$groupId == self::GROUP_MODERATOR
|
$groupId == self::GROUP_EDITOR
|
||||||
) {
|
) {
|
||||||
// Enumérer les sous groupes MEMBER et MODERATOR
|
// Enumérer les sous groupes MEMBER et MODERATOR
|
||||||
foreach ($groupData as $subGroupId => $subGroupData) {
|
foreach ($groupData as $subGroupId => $subGroupData) {
|
||||||
@ -1014,7 +1014,8 @@ class user extends common
|
|||||||
else {
|
else {
|
||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
// Tous les suers peuvent réinitialiser
|
||||||
|
// $this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
// Double vérification pour le mot de passe
|
// Double vérification pour le mot de passe
|
||||||
|
@ -102,8 +102,8 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="userAddGroupProfil displayNone"
|
<div class="userAddGroupProfil displayNone"
|
||||||
id="userAddGroupProfil<?php echo self::GROUP_MODERATOR; ?>">
|
id="userAddGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||||
<?php echo template::select('userAddProfil' . self::GROUP_MODERATOR, $module::$userProfils[self::GROUP_MODERATOR], [
|
<?php echo template::select('userAddProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -116,9 +116,9 @@
|
|||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div id="userCommentProfil<?php echo self::GROUP_MODERATOR; ?>" class="col12 displayNone userCommentProfil">
|
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 displayNone userCommentProfil">
|
||||||
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_MODERATOR, [
|
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [
|
||||||
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MODERATOR])
|
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_EDITOR])
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -123,8 +123,8 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="userEditGroupProfil displayNone"
|
<div class="userEditGroupProfil displayNone"
|
||||||
id="userEditGroupProfil<?php echo self::GROUP_MODERATOR; ?>">
|
id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||||
<?php echo template::select('userEditProfil' . self::GROUP_MODERATOR, $module::$userProfils[self::GROUP_MODERATOR], [
|
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil'])
|
'selected' => $this->getData(['user', $this->getUrl(2), 'profil'])
|
||||||
]); ?>
|
]); ?>
|
||||||
@ -138,9 +138,9 @@
|
|||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div id="userCommentProfil<?php echo self::GROUP_MODERATOR; ?>" class="col12 displayNone userCommentProfil">
|
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 displayNone userCommentProfil">
|
||||||
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_MODERATOR, [
|
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [
|
||||||
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MODERATOR])
|
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_EDITOR])
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($this->getUrl(2) >= self::GROUP_MODERATOR): ?>
|
<?php if ($this->getUrl(2) >= self::GROUP_EDITOR): ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
|
@ -27,15 +27,15 @@ class blog extends common
|
|||||||
const EDIT_ALL = 'all';
|
const EDIT_ALL = 'all';
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'add' => self::GROUP_MODERATOR,
|
'add' => self::GROUP_EDITOR,
|
||||||
'comment' => self::GROUP_MODERATOR,
|
'comment' => self::GROUP_EDITOR,
|
||||||
'commentApprove' => self::GROUP_MODERATOR,
|
'commentApprove' => self::GROUP_EDITOR,
|
||||||
'commentDelete' => self::GROUP_MODERATOR,
|
'commentDelete' => self::GROUP_EDITOR,
|
||||||
'commentDeleteAll' => self::GROUP_MODERATOR,
|
'commentDeleteAll' => self::GROUP_EDITOR,
|
||||||
'config' => self::GROUP_MODERATOR,
|
'config' => self::GROUP_EDITOR,
|
||||||
'option' => self::GROUP_MODERATOR,
|
'option' => self::GROUP_EDITOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_EDITOR,
|
||||||
'edit' => self::GROUP_MODERATOR,
|
'edit' => self::GROUP_EDITOR,
|
||||||
'index' => self::GROUP_VISITOR,
|
'index' => self::GROUP_VISITOR,
|
||||||
'rss' => self::GROUP_VISITOR
|
'rss' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
@ -697,7 +697,7 @@ class blog extends common
|
|||||||
ksort(self::$users);
|
ksort(self::$users);
|
||||||
foreach (self::$users as $userId => &$userFirstname) {
|
foreach (self::$users as $userId => &$userFirstname) {
|
||||||
// Les membres ne sont pas éditeurs, les exclure de la liste
|
// Les membres ne sont pas éditeurs, les exclure de la liste
|
||||||
if ($this->getData(['user', $userId, 'group']) < self::GROUP_MODERATOR) {
|
if ($this->getData(['user', $userId, 'group']) < self::GROUP_EDITOR) {
|
||||||
unset(self::$users[$userId]);
|
unset(self::$users[$userId]);
|
||||||
}
|
}
|
||||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
|
||||||
@ -904,24 +904,21 @@ class blog extends common
|
|||||||
*/
|
*/
|
||||||
public function signature($userId)
|
public function signature($userId)
|
||||||
{
|
{
|
||||||
if ($this->getUser('permission', __CLASS__, __FUNCTION__) !== true) {
|
switch ($this->getData(['user', $userId, 'signature'])) {
|
||||||
switch ($this->getData(['user', $userId, 'signature'])) {
|
case 1:
|
||||||
case 1:
|
return $userId;
|
||||||
return $userId;
|
break;
|
||||||
break;
|
case 2:
|
||||||
case 2:
|
return $this->getData(['user', $userId, 'pseudo']);
|
||||||
return $this->getData(['user', $userId, 'pseudo']);
|
break;
|
||||||
break;
|
case 3:
|
||||||
case 3:
|
return $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']);
|
||||||
return $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']);
|
break;
|
||||||
break;
|
case 4:
|
||||||
case 4:
|
return $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
|
||||||
return $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
return $this->getData(['user', $userId, 'firstname']);
|
||||||
return $this->getData(['user', $userId, 'firstname']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1 +1 @@
|
|||||||
{"name":"blog","realName":"Blog","version":"6.8","update":"0.0","delete":true,"dataDirectory":""}
|
{"name":"blog","realName":"Blog","version":"6.9","update":"0.0","delete":true,"dataDirectory":""}
|
@ -29,7 +29,7 @@
|
|||||||
or (
|
or (
|
||||||
// Groupe
|
// Groupe
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
|
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
|
||||||
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_MODERATOR)
|
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_EDITOR)
|
||||||
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
|
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
|
||||||
)
|
)
|
||||||
or (
|
or (
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
or (
|
or (
|
||||||
// Groupe
|
// Groupe
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
|
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
|
||||||
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_MODERATOR)
|
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_EDITOR)
|
||||||
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
|
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
|
||||||
)
|
)
|
||||||
or (
|
or (
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Version 3.10
|
# Version 3.10
|
||||||
- Bloque l'effacement selon le profil
|
- Bloque l'effacement selon le profil
|
||||||
- Masque le code de vérification
|
- Masque le code de vérification
|
||||||
|
- Export des données en CSV impossible
|
||||||
# Version 3.9
|
# Version 3.9
|
||||||
- Redirection des pages orphelines
|
- Redirection des pages orphelines
|
||||||
# Version 3.8
|
# Version 3.8
|
||||||
|
@ -1 +1 @@
|
|||||||
{"name":"form","realName":"Formulaire","version":"3.9","update":"0.0","delete":true,"dataDirectory":""}
|
{"name":"form","realName":"Formulaire","version":"3.10","update":"0.0","delete":true,"dataDirectory":""}
|
@ -22,13 +22,13 @@ class form extends common
|
|||||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'config' => self::GROUP_MODERATOR,
|
'config' => self::GROUP_EDITOR,
|
||||||
'option' => self::GROUP_MODERATOR,
|
'option' => self::GROUP_EDITOR,
|
||||||
'data' => self::GROUP_MODERATOR,
|
'data' => self::GROUP_EDITOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_EDITOR,
|
||||||
'deleteall' => self::GROUP_MODERATOR,
|
'deleteall' => self::GROUP_EDITOR,
|
||||||
'index' => self::GROUP_VISITOR,
|
'index' => self::GROUP_VISITOR,
|
||||||
'export2csv' => self::GROUP_MODERATOR,
|
'export2csv' => self::GROUP_EDITOR,
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $data = [];
|
public static $data = [];
|
||||||
@ -235,7 +235,7 @@ class form extends common
|
|||||||
{
|
{
|
||||||
$data = $this->getData(['module', $this->getUrl(0), 'data']);
|
$data = $this->getData(['module', $this->getUrl(0), 'data']);
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true &&
|
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||||
$data
|
$data
|
||||||
) {
|
) {
|
||||||
// Pagination
|
// Pagination
|
||||||
@ -297,7 +297,7 @@ class form extends common
|
|||||||
fclose($fp);
|
fclose($fp);
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => sprintf(helper::translate('Export CSV effectué dans %1 '), $csvfilename),
|
'notification' => sprintf(helper::translate('Export CSV effectué dans %s '), $csvfilename ),
|
||||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
|
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
|
@ -1 +1 @@
|
|||||||
{"name":"gallery","realName":"Galerie","version":"3.8","update":"0.0","delete":true,"dataDirectory":"site\/data\/gallery\/"}
|
{"name":"gallery","realName":"Galerie","version":"3.9","update":"0.0","delete":true,"dataDirectory":"site\/data\/gallery\/"}
|
@ -44,15 +44,15 @@ class gallery extends common
|
|||||||
public static $config = [];
|
public static $config = [];
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'config' => self::GROUP_MODERATOR,
|
'config' => self::GROUP_EDITOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_EDITOR,
|
||||||
'dirs' => self::GROUP_MODERATOR,
|
'dirs' => self::GROUP_EDITOR,
|
||||||
'sortGalleries' => self::GROUP_MODERATOR,
|
'sortGalleries' => self::GROUP_EDITOR,
|
||||||
'sortPictures' => self::GROUP_MODERATOR,
|
'sortPictures' => self::GROUP_EDITOR,
|
||||||
'edit' => self::GROUP_MODERATOR,
|
'edit' => self::GROUP_EDITOR,
|
||||||
'add' => self::GROUP_MODERATOR,
|
'add' => self::GROUP_EDITOR,
|
||||||
'theme' => self::GROUP_MODERATOR,
|
'theme' => self::GROUP_EDITOR,
|
||||||
'option' => self::GROUP_MODERATOR,
|
'option' => self::GROUP_EDITOR,
|
||||||
'index' => self::GROUP_VISITOR
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
{"name":"news","realName":"News","version":"4.3","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}
|
{"name":"news","realName":"News","version":"4.4","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}
|
@ -21,13 +21,13 @@ class news extends common
|
|||||||
const DATADIRECTORY = self::DATA_DIR . 'news/';
|
const DATADIRECTORY = self::DATA_DIR . 'news/';
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'add' => self::GROUP_MODERATOR,
|
'add' => self::GROUP_EDITOR,
|
||||||
'config' => self::GROUP_MODERATOR,
|
'config' => self::GROUP_EDITOR,
|
||||||
// Edition des news
|
// Edition des news
|
||||||
'option' => self::GROUP_MODERATOR,
|
'option' => self::GROUP_EDITOR,
|
||||||
// paramétrage des news
|
// paramétrage des news
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_EDITOR,
|
||||||
'edit' => self::GROUP_MODERATOR,
|
'edit' => self::GROUP_EDITOR,
|
||||||
'index' => self::GROUP_VISITOR,
|
'index' => self::GROUP_VISITOR,
|
||||||
'rss' => self::GROUP_VISITOR
|
'rss' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
@ -21,7 +21,7 @@ class redirection extends common
|
|||||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'config' => self::GROUP_MODERATOR,
|
'config' => self::GROUP_EDITOR,
|
||||||
'index' => self::GROUP_VISITOR
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class redirection extends common
|
|||||||
if (
|
if (
|
||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
&& $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
&& $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
&& $this->getUser('group') >= self::GROUP_MODERATOR
|
&& $this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUrl(1) !== 'force'
|
&& $this->getUrl(1) !== 'force'
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
|
@ -26,7 +26,7 @@ class search extends common
|
|||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'index' => self::GROUP_VISITOR,
|
'index' => self::GROUP_VISITOR,
|
||||||
'config' => self::GROUP_MODERATOR
|
'config' => self::GROUP_EDITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
// Variables pour l'affichage des résultats
|
// Variables pour l'affichage des résultats
|
||||||
@ -177,7 +177,6 @@ class search extends common
|
|||||||
$this->update();
|
$this->update();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
|
||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
//Initialisations variables
|
//Initialisations variables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user