aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-10-12 22:10:42 -0700
committerzotlabs <mike@macgirvin.com>2017-10-12 22:10:42 -0700
commit29a29f277e4280efe88e70b66e42ff97ca967db9 (patch)
tree5b2d7dfaa6cd1186ccc1b9f35ea08ae4feabea71
parente5f1bcacc857561fb6edc580c2d9657a81fa0867 (diff)
downloadvolse-hubzilla-29a29f277e4280efe88e70b66e42ff97ca967db9.tar.gz
volse-hubzilla-29a29f277e4280efe88e70b66e42ff97ca967db9.tar.bz2
volse-hubzilla-29a29f277e4280efe88e70b66e42ff97ca967db9.zip
create an actual logout module instead of relying on internal variables
-rw-r--r--Zotlabs/Module/Logout.php12
-rw-r--r--include/channel.php9
2 files changed, 16 insertions, 5 deletions
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 @@
+<?php
+
+namespace Zotlabs\Module;
+
+class Logout extends \Zotlabs\Web\Controller {
+
+ function init() {
+ \App::$session->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;
}
/**