]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Typo fixed
[mailer.git] / inc / filters.php
index 8ebe34f0c6a24180a9b0122cd1c194b42d9b47b7..9c4c86230dc15a3fdcd122434ab375de1e29059e 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Init "generic filter system"
-function INIT_FILTER_SYSTEM() {
+function INIT_FILTER_SYSTEM () {
        global $filters, $loadedFilters, $counter;
 
        // Is the filter already initialized?
@@ -450,40 +450,40 @@ function FILTER_UPDATE_LOGIN_DATA () {
        // Secure user ID
        $GLOBALS['userid'] = bigintval(get_session('userid'));
 
-       // Extract last online time (life) and how long is auto-login valid (time)
-       $newl = time() + bigintval(get_session('lifetime'));
-
        // Load last module and last online time
-       $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Entry found?
        if (SQL_NUMROWS($result) == 1) {
                // Load last module and online time
                list($mod, $onl) = SQL_FETCHROW($result);
-               SQL_FREERESULT($result);
 
                // Maybe first login time?
                if (empty($mod)) $mod = "login";
 
-               if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", get_session('u_hash'), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) {
-                       // This will be displayed on welcome page! :-)
-                       if (empty($LAST['module'])) {
-                               $LAST['module'] = $mod; $LAST['online'] = $onl;
-                       } // END - if
+               // This will be displayed on welcome page! :-)
+               if (empty($LAST['module'])) {
+                       $LAST['module'] = $mod; $LAST['online'] = $onl;
+               } // END - if
 
-                       // "what" not set?
-                       if (empty($GLOBALS['what'])) {
-                               // Fix it to default
-                               $GLOBALS['what'] = "welcome";
-                               if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
-                       } // END - if
+               // "what" not set?
+               if (empty($GLOBALS['what'])) {
+                       // Fix it to default
+                       $GLOBALS['what'] = "welcome";
+                       if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
+               } // END - if
 
-                       // Update last module / online time
-                       SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
-                               array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
-               }
+               // Update last module / online time
+               SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
+                       array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
        }  else {
                // Destroy session, we cannot update!
                destroy_user_session();
        }
+
+       // Free the result
+       SQL_FREERESULT($result);
 }
 
 // Filter for checking admin ACL
@@ -492,7 +492,7 @@ function FILTER_CHECK_ADMIN_ACL () {
        $ret = true;
 
        // Ok, Cookie-Update done
-       if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
+       if (GET_EXT_VERSION("admins") >= "0.3") {
                // Check if action GET variable was set
                $action = SQL_ESCAPE($GLOBALS['action']);
                if (!empty($GLOBALS['what'])) {