message action interdite

This commit is contained in:
Fred Tempez 2023-06-20 20:34:43 +02:00
parent 119063342b
commit 1aaf68b3d6
9 changed files with 44 additions and 45 deletions

View File

@ -79,7 +79,7 @@ class page extends common
$this->addOutput([ $this->addOutput([
'access' => false 'access' => false
]); ]);
} // Jeton incorrect } // Action interdite
elseif ($this->checkCSRF()) { elseif ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -187,7 +187,7 @@ class page extends common
$this->addOutput([ $this->addOutput([
'access' => false 'access' => false
]); ]);
} // Jeton incorrect } // Action interdite
elseif ($this->checkCSRF()) { elseif ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -62,8 +62,8 @@ class plugin extends common
public function delete() public function delete()
{ {
// Jeton incorrect // Action interdite
if ($this->getUrl(3) !== $_SESSION['csrf']) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'plugin', 'redirect' => helper::baseUrl() . 'plugin',
@ -291,8 +291,8 @@ class plugin extends common
*/ */
public function uploadItem() public function uploadItem()
{ {
// Jeton incorrect // Action interdite
if ($this->getUrl(3) !== $_SESSION['csrf']) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'store', 'redirect' => helper::baseUrl() . 'store',
@ -383,7 +383,7 @@ class plugin extends common
implode(' - ', $pageInfos), implode(' - ', $pageInfos),
template::button('moduleExport' . $key, [ template::button('moduleExport' . $key, [
'class' => $class, 'class' => $class,
'href' => helper::baseUrl() . $this->getUrl(0) . '/uploadItem/' . $key , 'href' => helper::baseUrl() . $this->getUrl(0) . '/uploadItem/' . $key,
'value' => $ico, 'value' => $ico,
'help' => $help 'help' => $help
]) ])
@ -454,7 +454,6 @@ class plugin extends common
$pagesInfos[$keyi18n][$key]['moduleId'] = $value; $pagesInfos[$keyi18n][$key]['moduleId'] = $value;
} }
} }
} }
// Recherche des modules orphelins dans toutes les langues // Recherche des modules orphelins dans toutes les langues
@ -482,7 +481,7 @@ class plugin extends common
$infoModules[$key]['delete'] === true $infoModules[$key]['delete'] === true
? template::button('moduleDelete' . $key, [ ? template::button('moduleDelete' . $key, [
'class' => 'moduleDelete buttonRed', 'class' => 'moduleDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $key , 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $key,
'value' => template::ico('trash'), 'value' => template::ico('trash'),
'help' => 'Supprimer le module' 'help' => 'Supprimer le module'
]) ])
@ -503,12 +502,12 @@ class plugin extends common
$infoModules[$key]['version'], $infoModules[$key]['version'],
'', '',
template::button('moduleSave' . $key, [ template::button('moduleSave' . $key, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/save/filemanager/' . $key , 'href' => helper::baseUrl() . $this->getUrl(0) . '/save/filemanager/' . $key,
'value' => template::ico('download-cloud'), 'value' => template::ico('download-cloud'),
'help' => 'Sauvegarder le module dans le gestionnaire de fichiers' 'help' => 'Sauvegarder le module dans le gestionnaire de fichiers'
]), ]),
template::button('moduleDownload' . $key, [ template::button('moduleDownload' . $key, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/save/download/' . $key , 'href' => helper::baseUrl() . $this->getUrl(0) . '/save/download/' . $key,
'value' => template::ico('download'), 'value' => template::ico('download'),
'help' => 'Sauvegarder et télécharger le module' 'help' => 'Sauvegarder et télécharger le module'
]) ])
@ -534,19 +533,19 @@ class plugin extends common
$infoModules[$pagesInfos[$keyi18n][$keyPage]['moduleId']]['version'], $infoModules[$pagesInfos[$keyi18n][$keyPage]['moduleId']]['version'],
template::flag($keyi18n, '20px') . '&nbsp<a href ="' . helper::baseUrl() . $keyPage . '" target="_blank">' . $pagesInfos[$keyi18n][$keyPage]['title'] . ' (' . $keyPage . ')</a>', template::flag($keyi18n, '20px') . '&nbsp<a href ="' . helper::baseUrl() . $keyPage . '" target="_blank">' . $pagesInfos[$keyi18n][$keyPage]['title'] . ' (' . $keyPage . ')</a>',
template::button('dataExport' . $keyPage, [ template::button('dataExport' . $keyPage, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/filemanager/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage , 'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/filemanager/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
// appel de fonction vaut exécution, utiliser un paramètre // appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('download-cloud'), 'value' => template::ico('download-cloud'),
'help' => 'Sauvegarder les données du module dans le gestionnaire de fichiers' 'help' => 'Sauvegarder les données du module dans le gestionnaire de fichiers'
]), ]),
template::button('dataExport' . $keyPage, [ template::button('dataExport' . $keyPage, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/download/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage , 'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/download/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
// appel de fonction vaut exécution, utiliser un paramètre // appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('download'), 'value' => template::ico('download'),
'help' => 'Sauvegarder et télécharger les données du module' 'help' => 'Sauvegarder et télécharger les données du module'
]), ]),
template::button('dataDelete' . $keyPage, [ template::button('dataDelete' . $keyPage, [
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataDelete/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage , 'href' => helper::baseUrl() . $this->getUrl(0) . '/dataDelete/' . self::$i18nContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
// appel de fonction vaut exécution, utiliser un paramètre // appel de fonction vaut exécution, utiliser un paramètre
'value' => template::ico('trash'), 'value' => template::ico('trash'),
'class' => 'buttonRed dataDelete', 'class' => 'buttonRed dataDelete',
@ -572,8 +571,8 @@ class plugin extends common
*/ */
public function save() public function save()
{ {
// Jeton incorrect // Action interdite
if ($this->getUrl(4) !== $_SESSION['csrf']) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'plugin', 'redirect' => helper::baseUrl() . 'plugin',
@ -646,8 +645,8 @@ class plugin extends common
*/ */
public function dataDelete() public function dataDelete()
{ {
// Jeton incorrect // Action interdite
if ($this->getUrl(5) !== $_SESSION['csrf']) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'plugin', 'redirect' => helper::baseUrl() . 'plugin',
@ -677,8 +676,8 @@ class plugin extends common
*/ */
public function dataExport() public function dataExport()
{ {
// Jeton incorrect // Action interdite
if ($this->getUrl(6) !== $_SESSION['csrf']) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'plugin', 'redirect' => helper::baseUrl() . 'plugin',
@ -818,8 +817,8 @@ class plugin extends common
} }
// Bouton d'importation des données d'un module spécifique // Bouton d'importation des données d'un module spécifique
if (count(explode('/', $this->getUrl())) === 6) { if (count(explode('/', $this->getUrl())) === 6) {
// Jeton incorrect // Action interdite
if ($this->getUrl(3) !== $_SESSION['csrf']) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'plugin', 'redirect' => helper::baseUrl() . 'plugin',

View File

@ -796,7 +796,7 @@ class theme extends common
*/ */
public function fontDelete() public function fontDelete()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -67,7 +67,7 @@ class translate extends common
public function update() public function update()
{ {
$lang = $this->getUrl(2); $lang = $this->getUrl(2);
// Jeton incorrect ou URl avec le code langue incorrecte // Action interdite ou URl avec le code langue incorrecte
if ( if (
array_key_exists($lang, self::$languages) === false array_key_exists($lang, self::$languages) === false
) { ) {
@ -364,7 +364,7 @@ class translate extends common
*/ */
public function locale() public function locale()
{ {
// Jeton incorrect ou URl avec le code langue incorrecte // Action interdite ou URl avec le code langue incorrecte
$lang = $this->getUrl(2); $lang = $this->getUrl(2);
if ( if (
array_key_exists($lang, self::$languages) === false array_key_exists($lang, self::$languages) === false
@ -469,7 +469,7 @@ class translate extends common
public function edit() public function edit()
{ {
$lang = $this->getUrl(2); $lang = $this->getUrl(2);
// Jeton incorrect ou URl avec le code langue incorrecte // Action interdite ou URl avec le code langue incorrecte
if ( if (
array_key_exists($lang, self::$languages) === false array_key_exists($lang, self::$languages) === false
) { ) {
@ -558,7 +558,7 @@ class translate extends common
*/ */
public function delete() public function delete()
{ {
// Jeton incorrect ou URl avec le code langue incorrecte // Action interdite ou URl avec le code langue incorrecte
$target = $this->getUrl(2); $target = $this->getUrl(2);
$lang = $this->getUrl(3); $lang = $this->getUrl(3);
if ( if (
@ -613,7 +613,7 @@ class translate extends common
*/ */
public function default() public function default()
{ {
// Jeton incorrect ou URl avec le code langue incorrecte // Action interdite ou URl avec le code langue incorrecte
$lang = $this->getUrl(2); $lang = $this->getUrl(2);
if ( if (
array_key_exists($lang, self::$languages) === false array_key_exists($lang, self::$languages) === false

View File

@ -156,14 +156,14 @@ class user extends common
'access' => false 'access' => false
]); ]);
} }
// Jeton incorrect // Action interdite
elseif ( elseif (
$this->checkCSRF() $this->checkCSRF()
) { ) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'user', 'redirect' => helper::baseUrl() . 'user',
'notification' => helper::translate('Jeton incorrect') 'notification' => helper::translate('Action interdite')
]); ]);
} }
// Bloque la suppression de son propre compte // Bloque la suppression de son propre compte

View File

@ -378,7 +378,7 @@ class blog extends common
'access' => false 'access' => false
]); ]);
} }
// Jeton incorrect // Action interdite
elseif ($this->checkCSRF()) { elseif ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -403,7 +403,7 @@ class blog extends common
*/ */
public function commentDeleteAll() public function commentDeleteAll()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -435,7 +435,7 @@ class blog extends common
'access' => false 'access' => false
]); ]);
} }
// Jeton incorrect // Action interdite
elseif ($this->checkCSRF()) { elseif ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -599,7 +599,7 @@ class blog extends common
'access' => false 'access' => false
]); ]);
} }
// Jeton incorrect // Action interdite
elseif ($this->checkCSRF()) { elseif ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -624,7 +624,7 @@ class blog extends common
*/ */
public function edit() public function edit()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -266,7 +266,7 @@ class form extends common
*/ */
public function export2csv() public function export2csv()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -307,7 +307,7 @@ class form extends common
*/ */
public function deleteall() public function deleteall()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -343,7 +343,7 @@ class form extends common
*/ */
public function delete() public function delete()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -506,7 +506,7 @@ class gallery extends common
'access' => false 'access' => false
]); ]);
} }
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -543,7 +543,7 @@ class gallery extends common
*/ */
public function edit() public function edit()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -853,7 +853,7 @@ class gallery extends common
*/ */
public function theme() public function theme()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -934,7 +934,7 @@ class gallery extends common
* Options applicables à toutes les galeries du module * Options applicables à toutes les galeries du module
*/ */
if ($this->getUrl(2) === 'galleries') { if ($this->getUrl(2) === 'galleries') {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -975,7 +975,7 @@ class gallery extends common
* Enregistre les options de configuration de la galerie d'images sélectionnée * Enregistre les options de configuration de la galerie d'images sélectionnée
*/ */
} elseif ($this->getUrl(2) === 'gallery') { } elseif ($this->getUrl(2) === 'gallery') {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -371,7 +371,7 @@ class news extends common
'access' => false 'access' => false
]); ]);
} }
// Jeton incorrect // Action interdite
elseif ($this->checkCSRF()) { elseif ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -396,7 +396,7 @@ class news extends common
*/ */
public function edit() public function edit()
{ {
// Jeton incorrect // Action interdite
if ($this->checkCSRF()) { if ($this->checkCSRF()) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([