Skip to content

Commit

Permalink
removeMessage(s) only if user is an admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekiro-kost committed Oct 24, 2024
1 parent e247eff commit d9e09f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/ajax/message.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
ajax::init();

if (init('action') == 'clearMessage') {
if(!isConnect('admin')){
throw new Exception(__('Vous n\'êtes pas autorisé à effectuer cette action', __FILE__));
}
message::removeAll(init('plugin'));
ajax::success();
}
Expand All @@ -46,6 +49,9 @@
}

if (init('action') == 'removeMessage') {
if(!isConnect('admin')){
throw new Exception(__('Vous n\'êtes pas autorisé à effectuer cette action', __FILE__));
}
$message = message::byId(init('id'));
if (!is_object($message)) {
throw new Exception(__('Message inconnu. Vérifiez l\'ID', __FILE__));
Expand Down

0 comments on commit d9e09f6

Please sign in to comment.