[geeklog-cvs] geeklog: Fixed E_ALL error when permanent cookie expired

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Apr 13 06:47:46 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9974c9c57e3c
changeset: 6937:9974c9c57e3c
user:      Dirk Haun <dirk at haun-online.de>
date:      Mon Apr 13 11:34:54 2009 +0200
description:
Fixed E_ALL error when permanent cookie expired

diffstat:

1 file changed, 9 insertions(+), 8 deletions(-)
system/lib-sessions.php |   17 +++++++++--------

diffs (38 lines):

diff -r 135118e76d96 -r 9974c9c57e3c system/lib-sessions.php
--- a/system/lib-sessions.php	Mon Apr 13 11:30:14 2009 +0200
+++ b/system/lib-sessions.php	Mon Apr 13 11:34:54 2009 +0200
@@ -130,12 +130,13 @@
                     $userid = COM_applyFilter ($userid, true);
                     $cookie_password = '';
                     $userpass = '';
-                    if ($userid > 1) {
+                    if (($userid > 1) &&
+                            isset($_COOKIE[$_CONF['cookie_password']])) {
                         $cookie_password = $_COOKIE[$_CONF['cookie_password']];
-                        $userpass = DB_getItem ($_TABLES['users'], 'passwd',
-                                                "uid = $userid");
+                        $userpass = DB_getItem($_TABLES['users'], 'passwd',
+                                               "uid = $userid");
                     }
-                    if (empty ($cookie_password) || ($cookie_password <> $userpass)) {
+                    if (empty($cookie_password) || ($cookie_password <> $userpass)) {
                         // User may have modified their UID in cookie, ignore them
                     } else if ($userid > 1) {
                         // Check user status
@@ -175,12 +176,12 @@
                 $userid = COM_applyFilter ($userid, true);
                 $cookie_password = '';
                 $userpass = '';
-                if ($userid > 1) {
-                    $userpass = DB_getItem ($_TABLES['users'], 'passwd',
-                                            "uid = $userid");
+                if (($userid > 1) && isset($_COOKIE[$_CONF['cookie_password']])) {
+                    $userpass = DB_getItem($_TABLES['users'], 'passwd',
+                                           "uid = $userid");
                     $cookie_password = $_COOKIE[$_CONF['cookie_password']];
                 }
-                if (empty ($cookie_password) || ($cookie_password <> $userpass)) {
+                if (empty($cookie_password) || ($cookie_password <> $userpass)) {
                     // User could have modified UID in cookie, don't do shit
                 } else if ($userid > 1) {
                     // Check user status



More information about the geeklog-cvs mailing list