]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Typo fixed
[mailer.git] / inc / mysql-manager.php
index 4f2c89ca681ed7aa7032b0e7fa4fcceafeb02a6e..82ebd0721b1a4201f2057a7c2ef3a441ef38963f 100644 (file)
@@ -595,8 +595,7 @@ function WHAT_IS_VALID($act, $wht, $type="guest")
        }
 }
 //
-function IS_MEMBER()
-{
+function IS_MEMBER () {
        global $status, $LAST, $cacheArray;
        if (!is_array($LAST)) $LAST = array();
        $ret = false;
@@ -608,16 +607,14 @@ function IS_MEMBER()
        } // END - if
 
        // Fix "deleted" cookies first
-       FIX_DELETED_COOKIES(array('userid','u_hash','lifetime'));
+       FIX_DELETED_COOKIES(array('userid', 'u_hash'));
 
        // Are cookies set?
-       if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash')) && (isSessionVariableSet('lifetime')) && (defined('COOKIE_PATH')))
-       {
+       if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash'))) {
                // Cookies are set with values, but are they valid?
                $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
-                array($GLOBALS['userid']), __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) == 1)
-               {
+                       array($GLOBALS['userid']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
                        // Load data from cookies
                        list($password, $status, $mod, $onl) = SQL_FETCHROW($result);
 
@@ -625,7 +622,10 @@ function IS_MEMBER()
                        $valPass = generatePassString($password);
 
                        // Transfer last module and online time
-                       if ((!empty($mod)) && (empty($LAST['module']))) { $LAST['module'] = $mod; $LAST['online'] = $onl; }
+                       if ((!empty($mod)) && (empty($LAST['module']))) {
+                               $LAST['module'] = $mod;
+                               $LAST['online'] = $onl;
+                       } // END - if
 
                        // So did we now have valid data and an unlocked user?
                        //* DEBUG: */ echo $valPass."<br />".get_session('u_hash')."<br />";
@@ -636,17 +636,11 @@ function IS_MEMBER()
                                // Maybe got locked etc.
                                //* DEBUG: */ echo __LINE__."!!!<br />";
                                destroy_user_session();
-
-                               // Reset userid
-                               $GLOBALS['userid'] = 0;
                        }
                } else {
                        // Cookie data is invalid!
                        //* DEBUG: */ echo __LINE__."***<br />";
                        destroy_user_session();
-
-                       // Reset userid
-                       $GLOBALS['userid'] = 0;
                }
 
                // Free memory
@@ -655,9 +649,6 @@ function IS_MEMBER()
                // Cookie data is invalid!
                //* DEBUG: */ echo __LINE__."///<br />";
                destroy_user_session();
-
-               // Reset userid
-               $GLOBALS['userid'] = 0;
        }
 
        // Cache status
@@ -1457,7 +1448,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
        return $ret;
 }
 //
-function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="") {
+function ADD_OPTION_LINES ($table, $id, $name, $default="", $special="", $where="") {
        $ret = "";
        if ($table == "/ARRAY/") {
                // Selection from array
@@ -1476,7 +1467,7 @@ function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="")
                $ORDER = $name.$SPEC;
                if ($table == "country") $ORDER = $special;
                $result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM "._MYSQL_PREFIX."_%s ".$where." ORDER BY %s",
-                array($id, $ORDER, $table, $name), __FILE__, __LINE__);
+                       array($id, $ORDER, $table, $name), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) > 0) {
                        // Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
                        while (list($value, $title, $add) = SQL_FETCHROW($result)) {