aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-05 21:39:55 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-05 21:39:55 -0700
commit6817c5d59ad578370a2b60dbdcdba16e43dbac65 (patch)
tree3c24b1b920273fcd57455c6ab73a16650772be01 /include
parent3713a9291cfb5d9fad160abd8f4a167693171998 (diff)
downloadvolse-hubzilla-6817c5d59ad578370a2b60dbdcdba16e43dbac65.tar.gz
volse-hubzilla-6817c5d59ad578370a2b60dbdcdba16e43dbac65.tar.bz2
volse-hubzilla-6817c5d59ad578370a2b60dbdcdba16e43dbac65.zip
lots of work, 2way friends, comments...
Diffstat (limited to 'include')
-rw-r--r--include/auth.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/auth.php b/include/auth.php
index e22651cdd..973aabe65 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -8,6 +8,7 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] == 'login'))) {
unset($_SESSION['uid']);
unset($_SESSION['visitor_id']);
unset($_SESSION['administrator']);
+ unset($_SESSION['cid']);
$_SESSION['sysmsg'] = "Logged out." . EOL;
goaway($a->get_baseurl());
}
@@ -21,6 +22,12 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] == 'login'))) {
if(strlen($a->user['timezone']))
date_default_timezone_set($a->user['timezone']);
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1",
+ intval($_SESSION['uid']));
+ if(count($r)) {
+ $a->cid = $r[0]['id'];
+ $_SESSION['cid'] = $a->cid;
+ }
}
}
else {
@@ -28,6 +35,7 @@ else {
unset($_SESSION['uid']);
unset($_SESSION['visitor_id']);
unset($_SESSION['administrator']);
+ unset($_SESSION['cid']);
$encrypted = hash('whirlpool',trim($_POST['password']));
if((x($_POST,'auth-params')) && $_POST['auth-params'] == 'login') {
@@ -52,6 +60,14 @@ else {
if(strlen($a->user['timezone']))
date_default_timezone_set($a->user['timezone']);
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1",
+ intval($_SESSION['uid']));
+ if(count($r)) {
+ $a->cid = $r[0]['id'];
+ $_SESSION['cid'] = $a->cid;
+ }
+
+
}
}