securité des modules du coeur
This commit is contained in:
parent
1bd9cf41ef
commit
b0e8cfbb9e
|
@ -4,6 +4,7 @@
|
|||
- Modifications :
|
||||
- Une troisième langue d'administration est disponible : espagnol / castillan,
|
||||
- Thème / Menu : le menu en petit écran (burger) dispose maintenant de ses propres paramètres,
|
||||
- Modules du coeur et de page : renforcement de la sécurité,
|
||||
- Langues : la traduction automatique est supprimée, ce qui parachève la dégooglisation de Deltacms,
|
||||
- Edition de page / emplacement dans le menu : une page désactivée est signalée par le curseur 'not-allowed' et par une typographie italique en petit écran, son lien est inactif,
|
||||
- Nouveaux gabarits pour l'éditeur Tinymce : accordéon à 3 et 4 paragraphes,
|
||||
|
|
|
@ -48,6 +48,15 @@ class addon extends common {
|
|||
* Effacement d'un module installé et non utilisé
|
||||
*/
|
||||
public function delete() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['delete'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/addon/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_addon.php');
|
||||
|
||||
|
@ -86,6 +95,7 @@ class addon extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* Installation d'un module
|
||||
|
@ -206,6 +216,15 @@ class addon extends common {
|
|||
* Installation d'un module à partir du gestionnaire de fichier
|
||||
*/
|
||||
public function upload() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['upload'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/addon/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_addon.php');
|
||||
|
||||
|
@ -233,11 +252,21 @@ class addon extends common {
|
|||
'view' => 'upload'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* Installation d'un module par le catalogue
|
||||
*/
|
||||
public function uploadItem() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['uploadItem'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Jeton incorrect
|
||||
if ($this->getUrl(3) !== $_SESSION['csrf']) {
|
||||
// Valeurs en sortie
|
||||
|
@ -287,11 +316,21 @@ class addon extends common {
|
|||
'view' => 'store'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Catalogue des modules sur le site DeltaCMS.fr
|
||||
*/
|
||||
public function store() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['store'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
$store = json_decode(helper::urlGetContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true);
|
||||
if ($store) {
|
||||
// Modules installés
|
||||
|
@ -332,18 +371,27 @@ class addon extends common {
|
|||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => 'Catalogue de modules en ligne',
|
||||
'view' => 'store'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Détail d'un objet du catalogue
|
||||
*/
|
||||
public function item() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['item'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
$store = json_decode(helper::urlGetContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true);
|
||||
self::$storeItem = $store [$this->getUrl(2)] ;
|
||||
self::$storeItem ['fileDate'] = mb_detect_encoding(strftime('%d %B %Y',self::$storeItem ['fileDate']), 'UTF-8', true)
|
||||
|
@ -355,11 +403,21 @@ class addon extends common {
|
|||
'view' => 'item'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion des modules
|
||||
*/
|
||||
public function index() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['index'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/addon/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_addon.php');
|
||||
|
||||
|
@ -410,11 +468,21 @@ class addon extends common {
|
|||
'view' => 'index'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Export des données d'un module externes ou interne à module.json
|
||||
*/
|
||||
public function export(){
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['export'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/addon/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_addon.php');
|
||||
|
||||
|
@ -510,11 +578,21 @@ class addon extends common {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Importer des données d'un module externes ou interne à module.json
|
||||
*/
|
||||
public function import(){
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < addon::$actions['import'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/addon/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_addon.php');
|
||||
|
||||
|
@ -605,5 +683,6 @@ class addon extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -167,6 +167,15 @@ class config extends common {
|
|||
* Robots.txt
|
||||
*/
|
||||
public function generateFiles() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['generateFiles'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -182,12 +191,22 @@ class config extends common {
|
|||
'state' => $successSitemap
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sauvegarde des données
|
||||
*/
|
||||
public function backup() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['backup'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -217,11 +236,21 @@ class config extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Active ou désactive le mode Open Graph
|
||||
*/
|
||||
public function configOpenGraph() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['configOpenGraph'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -241,11 +270,21 @@ class config extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Procédure d'importation
|
||||
*/
|
||||
public function restore() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['restore'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -317,12 +356,22 @@ class config extends common {
|
|||
'view' => 'restore'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configuration
|
||||
*/
|
||||
public function index() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['index'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -552,9 +601,19 @@ class config extends common {
|
|||
'view' => 'index'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function script() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['script'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -586,6 +645,7 @@ class config extends common {
|
|||
'view' => 'script'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -593,6 +653,15 @@ class config extends common {
|
|||
*/
|
||||
|
||||
public function logReset() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['logReset'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -617,7 +686,7 @@ class config extends common {
|
|||
'state' => false
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -626,6 +695,15 @@ class config extends common {
|
|||
* Télécharger le fichier de log
|
||||
*/
|
||||
public function logDownload() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['logDownload'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -649,11 +727,21 @@ class config extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tableau des IP blacklistés
|
||||
*/
|
||||
public function blacklistDownload () {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['blacklistDownload'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -689,12 +777,22 @@ class config extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Réinitialiser les ip blacklistées
|
||||
*/
|
||||
|
||||
public function blacklistReset() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['blacklistReset'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -717,11 +815,21 @@ class config extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupération des backups auto dans le gestionnaire de fichiers
|
||||
*/
|
||||
public function copyBackups() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < config::$actions['copyBackups'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
|
||||
|
||||
|
@ -738,6 +846,7 @@ class config extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -205,6 +205,15 @@ class install extends common {
|
|||
* Étapes de mise à jour
|
||||
*/
|
||||
public function steps() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < install::$actions['steps'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
switch($this->getInput('step', helper::FILTER_INT)) {
|
||||
// Préparation
|
||||
case 1:
|
||||
|
@ -315,11 +324,21 @@ class install extends common {
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mise à jour
|
||||
*/
|
||||
public function update() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < install::$actions['update'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/install/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_install.php');
|
||||
// Nouvelle version
|
||||
|
@ -331,6 +350,7 @@ class install extends common {
|
|||
'view' => 'update'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -47,7 +47,7 @@ $text['core_page_view']['edit'][43] = " will be deleted. Do you confirm?";
|
|||
$text['core_page_view']['edit'][44] = "Group required to edit the page :";
|
||||
$text['core_page_view']['edit'][45] = "You do not have editing rights, contact an administrator.";
|
||||
$text['core_page']['duplicate'][0] = "Invalid token";
|
||||
$text['core_page']['duplicate'][1] = "Unauthorized deletion";
|
||||
$text['core_page']['duplicate'][1] = "Unauthorised duplication";
|
||||
$text['core_page']['duplicate'][2] = "The page has been duplicated";
|
||||
$text['core_page']['duplicate'][3] = "The page and its module have been duplicated";
|
||||
$text['core_page']['add'][0] = "New page";
|
||||
|
|
|
@ -47,7 +47,7 @@ $text['core_page_view']['edit'][43] = "será eliminado. ¿Confirmas?";
|
|||
$text['core_page_view']['edit'][44] = "Se requiere grupo para editar la página:";
|
||||
$text['core_page_view']['edit'][45] = "No tiene derechos de edición, póngase en contacto con un administrador.";
|
||||
$text['core_page']['duplicate'][0] = "Token no válido";
|
||||
$text['core_page']['duplicate'][1] = "Eliminación no autorizada";
|
||||
$text['core_page']['duplicate'][1] = "Duplicación no autorizada";
|
||||
$text['core_page']['duplicate'][2] = "La página ha sido duplicada";
|
||||
$text['core_page']['duplicate'][3] = "La página y su módulo han sido duplicados";
|
||||
$text['core_page']['add'][0] = "Nueva página";
|
||||
|
|
|
@ -47,7 +47,7 @@ $text['core_page_view']['edit'][43] = " seront effacées. Confirmez-vous ?";
|
|||
$text['core_page_view']['edit'][44] = "Groupe requis pour modifier la page :";
|
||||
$text['core_page_view']['edit'][45] = "Vous n'avez pas les droits d'édition, contactez un administrateur.";
|
||||
$text['core_page']['duplicate'][0] = "Jeton invalide";
|
||||
$text['core_page']['duplicate'][1] = "Suppression non autorisée";
|
||||
$text['core_page']['duplicate'][1] = "Duplication non autorisée";
|
||||
$text['core_page']['duplicate'][2] = "La page a été dupliquée";
|
||||
$text['core_page']['duplicate'][3] = "La page et son module ont été dupliqués";
|
||||
$text['core_page']['add'][0] = "Nouvelle page";
|
||||
|
|
|
@ -33,6 +33,15 @@ class page extends common {
|
|||
* Duplication
|
||||
*/
|
||||
public function duplicate() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < page::$actions['duplicate'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/page/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_page.php');
|
||||
// Adresse sans le token
|
||||
|
@ -57,7 +66,7 @@ class page extends common {
|
|||
'redirect' => helper::baseUrl() . 'page/edit/' . $url[0],
|
||||
'notification' => $text['core_page']['duplicate'][1]
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// Duplication de la page
|
||||
$pageTitle = $this->getData(['page',$url[0],'title']);
|
||||
$pageId = helper::increment(helper::filter($pageTitle, helper::FILTER_ID), $this->getData(['page']));
|
||||
|
@ -87,12 +96,23 @@ class page extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Création
|
||||
*/
|
||||
public function add() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < page::$actions['add'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/page/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_page.php');
|
||||
$pageTitle = $text['core_page']['add'][0];
|
||||
|
@ -140,11 +160,21 @@ class page extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Suppression
|
||||
*/
|
||||
public function delete() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < page::$actions['delete'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/page/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_page.php');
|
||||
// $url prend l'adresse sans le token
|
||||
|
@ -273,12 +303,22 @@ class page extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Édition
|
||||
*/
|
||||
public function edit() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < page::$actions['edit'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/page/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_page.php');
|
||||
// La page n'existe pas
|
||||
|
@ -497,3 +537,4 @@ class page extends common {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,15 @@ class theme extends common {
|
|||
* Thème des écrans d'administration
|
||||
*/
|
||||
public function admin() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['admin'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -103,11 +112,21 @@ class theme extends common {
|
|||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mode avancé
|
||||
*/
|
||||
public function advanced() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['advanced'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -130,11 +149,21 @@ class theme extends common {
|
|||
'view' => 'advanced'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion des polices / affichage principal
|
||||
*/
|
||||
public function fonts() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['fonts'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Préparation du tableau d'affichage des polices
|
||||
|
@ -166,11 +195,21 @@ class theme extends common {
|
|||
'view' => 'fonts'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion des polices / édition
|
||||
*/
|
||||
public function editfonts() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['editfonts'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Retour du formulaire
|
||||
|
@ -228,11 +267,21 @@ class theme extends common {
|
|||
'view' => 'editFonts'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion des polices / suppression
|
||||
*/
|
||||
public function deleteFonts() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['deleteFonts'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
//Suppression de la police passée en paramètre
|
||||
|
@ -246,11 +295,21 @@ class theme extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion des polices / ajout
|
||||
*/
|
||||
public function addFonts() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['addFonts'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Retour du formulaire
|
||||
|
@ -307,12 +366,22 @@ class theme extends common {
|
|||
'view' => 'addFonts'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Options de l'arrière plan
|
||||
*/
|
||||
public function body() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['body'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -344,11 +413,21 @@ class theme extends common {
|
|||
'view' => 'body'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Options du pied de page
|
||||
*/
|
||||
public function footer() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['footer'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -425,11 +504,21 @@ class theme extends common {
|
|||
'view' => 'footer'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Options de la bannière
|
||||
*/
|
||||
public function header() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['header'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Liste des dossiers dans site/file/source triés et non vides
|
||||
|
@ -532,11 +621,21 @@ class theme extends common {
|
|||
'view' => 'header'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Accueil de la personnalisation
|
||||
*/
|
||||
public function index() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['index'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Valeurs en sortie
|
||||
|
@ -545,11 +644,21 @@ class theme extends common {
|
|||
'view' => 'index'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Options du menu
|
||||
*/
|
||||
public function menu() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['menu'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -635,11 +744,21 @@ class theme extends common {
|
|||
'view' => 'menu'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Réinitialisation de la personnalisation avancée
|
||||
*/
|
||||
public function reset() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['reset'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// $url prend l'adresse sans le token
|
||||
|
@ -680,12 +799,22 @@ class theme extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Options du site
|
||||
*/
|
||||
public function site() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['site'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -739,11 +868,21 @@ class theme extends common {
|
|||
'view' => 'site'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Import du thème
|
||||
*/
|
||||
public function manage() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['manage'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
|
||||
|
@ -784,6 +923,7 @@ class theme extends common {
|
|||
'view' => 'manage'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Importe un thème
|
||||
|
@ -792,6 +932,15 @@ class theme extends common {
|
|||
*/
|
||||
|
||||
public function import($zipName = '') {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['import'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
|
||||
|
@ -857,6 +1006,7 @@ class theme extends common {
|
|||
|
||||
return (['success' => false, 'notification' => $text['core_theme']['import'][4]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -864,6 +1014,15 @@ class theme extends common {
|
|||
* Export du thème
|
||||
*/
|
||||
public function export($modele, $name) {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['export'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Make zip
|
||||
$zipFilename = $this->zipTheme($modele, $name);
|
||||
// Téléchargement du ZIP
|
||||
|
@ -877,11 +1036,21 @@ class theme extends common {
|
|||
unlink (self::TEMP_DIR . $zipFilename);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export du thème
|
||||
*/
|
||||
public function save($modele, $name) {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < theme::$actions['save'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/theme/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_theme.php');
|
||||
// Make zip
|
||||
|
@ -900,6 +1069,7 @@ class theme extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sauvegarde du thème du site ou de l'administration avant application d'un nouveau thème
|
||||
|
|
|
@ -37,6 +37,15 @@ class translate extends common {
|
|||
* Configuration avancée des langues
|
||||
*/
|
||||
public function copy() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < translate::$actions['copy'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/translate/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_translate.php');
|
||||
|
||||
|
@ -95,11 +104,21 @@ class translate extends common {
|
|||
'view' => 'copy'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration
|
||||
*/
|
||||
public function index() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < translate::$actions['index'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/translate/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_translate.php');
|
||||
|
||||
|
@ -187,6 +206,7 @@ class translate extends common {
|
|||
'view' => 'index'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -47,6 +47,15 @@ class user extends common {
|
|||
* Ajout
|
||||
*/
|
||||
public function add() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < user::$actions['add'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_user.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -128,11 +137,21 @@ class user extends common {
|
|||
'view' => 'add'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Suppression
|
||||
*/
|
||||
public function delete() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < user::$actions['delete'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_user.php');
|
||||
// Accès refusé
|
||||
|
@ -174,11 +193,21 @@ class user extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Édition
|
||||
*/
|
||||
public function edit() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < user::$actions['edit'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_user.php');
|
||||
|
||||
|
@ -314,6 +343,7 @@ class user extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mot de passe perdu
|
||||
|
@ -365,6 +395,15 @@ class user extends common {
|
|||
* Liste des utilisateurs
|
||||
*/
|
||||
public function index() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < user::$actions['index'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_user.php');
|
||||
|
||||
|
@ -394,6 +433,7 @@ class user extends common {
|
|||
'view' => 'index'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connexion
|
||||
|
@ -581,6 +621,15 @@ class user extends common {
|
|||
* Déconnexion
|
||||
*/
|
||||
public function logout() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < user::$actions['logout'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_user.php');
|
||||
// Ne pas effacer l'identifiant mais seulement le mot de passe
|
||||
|
@ -598,6 +647,7 @@ class user extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Réinitialisation du mot de passe
|
||||
|
@ -662,6 +712,15 @@ class user extends common {
|
|||
* Importation CSV d'utilisateurs
|
||||
*/
|
||||
public function import() {
|
||||
// Autorisation
|
||||
$group = $this->getUser('group');
|
||||
if ($group === false ) $group = 0;
|
||||
if( $group < user::$actions['import'] ) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// Lexique
|
||||
include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_user.php');
|
||||
// Soumission du formulaire
|
||||
|
@ -785,5 +844,6 @@ class user extends common {
|
|||
'state' => $success
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue