From 1428b2845cf20d2cea9bcc5671c95ef1866f852c Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Wed, 15 Jan 2003 16:15:22 +0000 Subject: [PATCH] passing userDetails array to Session::create instead of adding the array to the session afterwards --- lib/Session.inc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/Session.inc b/lib/Session.inc index e8b6b69..3a4f3b9 100644 --- a/lib/Session.inc +++ b/lib/Session.inc @@ -13,22 +13,23 @@ class Session { /** * Creates a session. * - * @param $userID - * user identifier - * @return $sessionID - * returns the generated sessionID + * @param $userDetails array containing user details + * @return returns the generated sessionID */ - function create($userID) { + function create($userDetails) { global $default; session_start(); // bind userID to session - $_SESSION["userID"] = $userID; + $_SESSION["userID"] = $userDetails["userID"]; // lookup group id and add to session - $_SESSION["groupID"] = lookupGroupIDs($userID); - $default->log->debug("Session::create groupids=" . arrayToString($_SESSION["groupID"])); + $_SESSION["groupID"] = $userDetails["groupID"]; + $_SESSION["unitID"] = $userDetails["unitID"]; + $_SESSION["username"] = $userDetails["username"]; + + $default->log->debug("Session::create session variables=" . arrayToString($_SESSION)); // use the PHP generated session id $sessionID = session_id(); -- libgit2 0.21.4