Commit d5b31463e99d86a8370ee6005b691be61a4354e8

Authored by michael
1 parent 1c514c6a

passing userDetails array to Session::create instead of adding the array to the session afterwards


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@233 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 9 additions and 8 deletions
lib/Session.inc
... ... @@ -13,22 +13,23 @@ class Session {
13 13 /**
14 14 * Creates a session.
15 15 *
16   - * @param $userID
17   - * user identifier
18   - * @return $sessionID
19   - * returns the generated sessionID
  16 + * @param $userDetails array containing user details
  17 + * @return returns the generated sessionID
20 18 */
21   - function create($userID) {
  19 + function create($userDetails) {
22 20 global $default;
23 21  
24 22 session_start();
25 23  
26 24 // bind userID to session
27   - $_SESSION["userID"] = $userID;
  25 + $_SESSION["userID"] = $userDetails["userID"];
28 26  
29 27 // lookup group id and add to session
30   - $_SESSION["groupID"] = lookupGroupIDs($userID);
31   - $default->log->debug("Session::create groupids=" . arrayToString($_SESSION["groupID"]));
  28 + $_SESSION["groupID"] = $userDetails["groupID"];
  29 + $_SESSION["unitID"] = $userDetails["unitID"];
  30 + $_SESSION["username"] = $userDetails["username"];
  31 +
  32 + $default->log->debug("Session::create session variables=" . arrayToString($_SESSION));
32 33  
33 34 // use the PHP generated session id
34 35 $sessionID = session_id();
... ...