Commit a1dc8394c9f793b133aa1a7ba4b02202f6f83202

Authored by Michael Joseph
1 parent 3f5f4311

rename userDetails array keys to match db fieldnames


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@83 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 10 additions and 10 deletions
lib/Authenticator.inc
@@ -36,25 +36,25 @@ class Authenticator { @@ -36,25 +36,25 @@ class Authenticator {
36 if ($numrows == "1") { 36 if ($numrows == "1") {
37 while($sql->next_record()) { 37 while($sql->next_record()) {
38 if ( $sql->f("disabled") == 1 ) { 38 if ( $sql->f("disabled") == 1 ) {
39 - $userDetails["status"] = 2; 39 + $userDetails["status"] = 2;
40 } else { 40 } else {
41 - $userDetails["status"] = 1;  
42 - $userDetails["userName"] = $sql->f("username");  
43 - $userDetails["userID"] = $sql->f("id");  
44 - $userDetails["groupID"] = $sql->f("groupid");  
45 - $maxsessions = $sql->f("maxsessions") + 1; 41 + $userDetails["status"] = 1;
  42 + $userDetails["user_id"] = $sql->f("id");
  43 + $userDetails["username"] = $sql->f("username");
  44 + $userDetails["group_id"] = $sql->f("group_id");
  45 + $userDetails["max_sessions"] = $sql->f("max_sessions") + 1;
46 } 46 }
47 } 47 }
48 48
49 // remove stale sessions from the database for the user 49 // remove stale sessions from the database for the user
50 // that is signing on. 50 // that is signing on.
51 - Session::removeStaleSessions($userDetails["userID"]); 51 + Session::removeStaleSessions($userDetails["user_id"]);
52 52
53 // Check if Maxsessions has been reached 53 // Check if Maxsessions has been reached
54 $sql = new Owl_DB; 54 $sql = new Owl_DB;
55 - $sql->query("select * from $default->owl_sessions_table where uid = '".$userDetails["userID"]."'");  
56 - if ($sql->num_rows($sql) >= $maxsessions) {  
57 - if ( $userDetails["groupID"] == 0) { 55 + $sql->query("select * from $default->owl_sessions_table where uid = '".$userDetails["user_id"]."'");
  56 + if ($sql->num_rows($sql) >= $userDetails["max_sessions"]) {
  57 + if ( $userDetails["group_id"] == 0) {
58 // ignore maxsessions check for admin group 58 // ignore maxsessions check for admin group
59 $userDetails["status"] = 1; 59 $userDetails["status"] = 1;
60 } else { 60 } else {