From 29a29f277e4280efe88e70b66e42ff97ca967db9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 12 Oct 2017 22:10:42 -0700 Subject: [PATCH] create an actual logout module instead of relying on internal variables --- Zotlabs/Module/Logout.php | 12 ++++++++++++ include/channel.php | 9 ++++----- 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 Zotlabs/Module/Logout.php diff --git a/Zotlabs/Module/Logout.php b/Zotlabs/Module/Logout.php new file mode 100644 index 000000000..6aa11d110 --- /dev/null +++ b/Zotlabs/Module/Logout.php @@ -0,0 +1,12 @@ +nuke(); + goaway(z_root()); + + } +} \ No newline at end of file diff --git a/include/channel.php b/include/channel.php index 488bdeef0..d7116ce28 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2308,7 +2308,7 @@ function profile_store_lowlevel($arr) { // It is the caller's responsibility to confirm the requestor's intent and // authorisation to do this. -function account_remove($account_id,$local = true,$unset_session=true) { +function account_remove($account_id,$local = true,$unset_session = true) { logger('account_remove: ' . $account_id); @@ -2353,13 +2353,12 @@ function account_remove($account_id,$local = true,$unset_session=true) { if ($unset_session) { - unset($_SESSION['authenticated']); - unset($_SESSION['uid']); - notice( sprintf(t("User '%s' deleted"),$account_email) . EOL); + App::$session->nuke(); + notice( sprintf(t('Account \'%s\' deleted'),$account_email) . EOL); goaway(z_root()); } - return $r; + return $r; } /**