From 54f4ac6ae05d256d5eab25a62dedf69407d83381 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 24 Nov 2018 20:58:41 -0500 Subject: [PATCH] Remove redirection from User::remove --- mod/removeme.php | 4 ++++ src/Model/User.php | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mod/removeme.php b/mod/removeme.php index 2f0eb2d37e..ee0b66db8a 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -59,6 +59,10 @@ function removeme_post(App $a) if (User::getIdFromPasswordAuthentication($a->user, trim($_POST['qxz_password']))) { User::remove($a->user['uid']); + + unset($_SESSION['authenticated']); + unset($_SESSION['uid']); + $a->internalRedirect(); // NOTREACHED } } diff --git a/src/Model/User.php b/src/Model/User.php index 43227a86da..d162b27b6a 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -783,7 +783,7 @@ class User public static function remove($uid) { if (!$uid) { - return; + return false; } $a = get_app(); @@ -809,11 +809,7 @@ class User // Remove the user relevant data Worker::add(PRIORITY_LOW, 'RemoveUser', $uid); - if ($uid == local_user()) { - unset($_SESSION['authenticated']); - unset($_SESSION['uid']); - $a->internalRedirect(); - } + return true; } /** -- 2.39.5