[geeklog-hg] geeklog: Fixed the unnecessary code in the lib-sessions.php

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Fri Dec 19 06:21:14 EST 2014


changeset 9560:c4a690a690d2
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/c4a690a690d2
user: dengen <taharaxp at gmail.com>
date: Fri Dec 19 20:22:16 2014 +0900
description:
Fixed the unnecessary code in the lib-sessions.php

diffstat:

 public_html/lib-common.php |   1 +
 system/lib-sessions.php    |  16 ++--------------
 2 files changed, 3 insertions(+), 14 deletions(-)

diffs (57 lines):

diff -r 376fda61217f -r c4a690a690d2 public_html/lib-common.php
--- a/public_html/lib-common.php	Wed Dec 17 02:04:27 2014 +0900
+++ b/public_html/lib-common.php	Fri Dec 19 20:22:16 2014 +0900
@@ -260,6 +260,7 @@
 */
 
 require_once( $_CONF['path_system'] . 'lib-sessions.php' );
+SESS_sessionCheck(); // Load user data
 TimeZoneConfig::setUserTimeZone();
 
 if (COM_isAnonUser()) {
diff -r 376fda61217f -r c4a690a690d2 system/lib-sessions.php
--- a/system/lib-sessions.php	Wed Dec 17 02:04:27 2014 +0900
+++ b/system/lib-sessions.php	Fri Dec 19 20:22:16 2014 +0900
@@ -60,18 +60,13 @@
     }
 }
 
-// LOAD USER DATA. NOTE: I'm not sure why I have to set $_USER like this because
-// it's supposed to be a global variable.  I tried setting $_USER from within
-// SESS_sessionCheck() and it doesn't work.
-$_USER = SESS_sessionCheck();
-
 /**
 * This gets the state for the user
 *
 * Much of this code if from phpBB (www.phpbb.org).  This checks the session
 * cookie and long term cookie to get the users state.
 *
-* @return   array   returns $_USER array
+* @return   void
 *
 */
 function SESS_sessionCheck()
@@ -82,7 +77,7 @@
         COM_errorLog("***Inside SESS_sessionCheck***",1);
     }
 
-    unset($_USER);
+    $_USER = array();
 
     // We MUST do this up here, so it's set even if the cookie's not present.
     $user_logged_in = 0;
@@ -278,13 +273,6 @@
     }
 
     $_USER['session_id'] = $sessid;
-    
-    // Ensure $_USER is set to avoid warnings (path exposure...)
-    if (isset($_USER)) {
-        return $_USER;
-    } else {
-        return NULL;
-    }
 }
 
 /**



More information about the geeklog-cvs mailing list