aboutsummaryrefslogtreecommitdiffstats
path: root/include/auth.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-30 13:25:37 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-30 13:25:37 -0700
commitfab63ca751beac91d12e06c194101cacd1f909e5 (patch)
tree524fc265d0dbc29db44146b6b26032ca815d605a /include/auth.php
parent768acb0a3faf2c2f2a523420710673aaacb64f76 (diff)
downloadvolse-hubzilla-fab63ca751beac91d12e06c194101cacd1f909e5.tar.gz
volse-hubzilla-fab63ca751beac91d12e06c194101cacd1f909e5.tar.bz2
volse-hubzilla-fab63ca751beac91d12e06c194101cacd1f909e5.zip
-Wall cleanup
Diffstat (limited to 'include/auth.php')
-rw-r--r--include/auth.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/include/auth.php b/include/auth.php
index a54b24f08..4813bb45b 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -2,7 +2,7 @@
// login/logout
-if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
+if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
if($_POST['auth-params'] === 'logout' || $a->module === 'logout') {
@@ -53,16 +53,19 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
}
else {
- unset($_SESSION['authenticated']);
- unset($_SESSION['uid']);
- unset($_SESSION['visitor_id']);
- unset($_SESSION['administrator']);
- unset($_SESSION['cid']);
- unset($_SESSION['theme']);
- unset($_SESSION['my_url']);
- unset($_SESSION['page_flags']);
+ if(isset($_SESSION)) {
+ unset($_SESSION['authenticated']);
+ unset($_SESSION['uid']);
+ unset($_SESSION['visitor_id']);
+ unset($_SESSION['administrator']);
+ unset($_SESSION['cid']);
+ unset($_SESSION['theme']);
+ unset($_SESSION['my_url']);
+ unset($_SESSION['page_flags']);
+ }
- $encrypted = hash('whirlpool',trim($_POST['password']));
+ if(x($_POST,'password'))
+ $encrypted = hash('whirlpool',trim($_POST['password']));
if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {