aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/auth.php23
-rw-r--r--include/dba.php4
2 files changed, 15 insertions, 12 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') {
diff --git a/include/dba.php b/include/dba.php
index 133b596ef..9d0896a35 100644
--- a/include/dba.php
+++ b/include/dba.php
@@ -36,8 +36,8 @@ class dba {
$mesg = '';
- if($this->db->mysqli->errno)
- $debug_text .= $this->db->mysqli->error . EOL;
+ if($this->db->errno)
+ $debug_text .= $this->db->error . EOL;
if($result === false)
$mesg = 'false';