aboutsummaryrefslogtreecommitdiffstats
path: root/admin/user/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/user/delete.php')
-rw-r--r--admin/user/delete.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/admin/user/delete.php b/admin/user/delete.php
index 5a38b53..31389a2 100644
--- a/admin/user/delete.php
+++ b/admin/user/delete.php
@@ -25,13 +25,17 @@ if(!$User = $UserRepository->find(HTTP::GET('id'))) {
#===============================================================================
# Check for delete request
#===============================================================================
-if(HTTP::issetPOST(['token' => Application::getSecurityToken()], 'delete')) {
- try {
- if($UserRepository->delete($User)) {
- HTTP::redirect(Application::getAdminURL('user/'));
+if(HTTP::issetPOST('delete')) {
+ if(HTTP::issetPOST(['token' => Application::getSecurityToken()])) {
+ try {
+ if($UserRepository->delete($User)) {
+ HTTP::redirect(Application::getAdminURL('user/'));
+ }
+ } catch(PDOException $Exception) {
+ $messages[] = $Exception->getMessage();
}
- } catch(PDOException $Exception) {
- $messages[] = $Exception->getMessage();
+ } else {
+ $messages[] = $Language->text('error_security_csrf');
}
}