[geeklog-cvs] Auth_Enterprise/Enterprise/Server DB.php,1.4,1.5

jellybob at iowaoutdoors.org jellybob at iowaoutdoors.org
Fri Jul 9 11:31:39 EDT 2004


Update of /var/cvs/Auth_Enterprise/Enterprise/Server
In directory www:/tmp/cvs-serv9028

Modified Files:
	DB.php 
Log Message:
* Removed a bug which returned the user object before populating it in
  authenticate.




Index: DB.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Enterprise/Server/DB.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DB.php	8 Jul 2004 15:48:15 -0000	1.4
--- DB.php	9 Jul 2004 15:31:36 -0000	1.5
***************
*** 139,168 ****
          if ($result->numRows() > 0) {
              $user = $this->mapResultToUserObject($result);
-             
-             // Ensure the account hasn't been locked
-             if ($user->getAccountLocked()) {
-                 throw new AEAccountLocked();
-             }
-             
-             // Check to see if password has expired.
-             if ($user->isPasswordExpired()) {
-                 throw new AEPasswordExpired();
-             }
-             $user->setAppId($this->options['appId']);
-             
-             try {
-                 // We get the groups as those will be sent back in user object
-                 $user->setGroups($this->getGroups($user->getUserName()));
-                 $user->setPrivileges($this->getPrivileges($user->getUserName()));
-             } catch (AESQLException $e) {
-                 throw $e;
-             } catch (Exception $e) {
-                 throw $e;
-             }
-             
-             $this->isAuthenticated = true;
-             $this->_user = $user;
-             
-             return $user;
          } else {
              // Invalid credentials, try to update the failed attempts for the user. I say try
--- 139,142 ----
***************
*** 176,179 ****
--- 150,179 ----
              throw new AEInvalidUserCredentials();
          }
+         
+         // Ensure the account hasn't been locked
+         if ($user->getAccountLocked()) {
+             throw new AEAccountLocked();
+         }
+         
+         // Check to see if password has expired.
+         if ($user->isPasswordExpired()) {
+             throw new AEPasswordExpired();
+         }
+         $user->setAppId($this->options['appId']);
+         
+         try {
+             // We get the groups as those will be sent back in user object
+             $user->setGroups($this->getGroups($user->getUserName()));
+             $user->setPrivileges($this->getPrivileges($user->getUserName()));
+         } catch (AESQLException $e) {
+             throw $e;
+         } catch (Exception $e) {
+             throw $e;
+         }
+         
+         $this->isAuthenticated = true;
+         $this->_user = $user;
+         
+         return $user;
      }
      
***************
*** 488,492 ****
      {
          // Make sure admin is authenticated
!         if (!$this->isAuthenticated) {
              try {
                  $userObj = $this->authenticate($adminUserName, $adminPassword);
--- 488,492 ----
      {
          // Make sure admin is authenticated
!         if (($userObj = $this->isAuthenticated()) === false) {
              try {
                  $userObj = $this->authenticate($adminUserName, $adminPassword);
***************
*** 591,595 ****
      {
          // Make sure admin is authenticated
!         if (!$this->isAuthenticated) {
              try {
                  $userObj = $this->authenticate($adminUserName, $adminPassword);
--- 591,595 ----
      {
          // Make sure admin is authenticated
!         if (($userObj = $this->isAuthenticated()) === false) {
              try {
                  $userObj = $this->authenticate($adminUserName, $adminPassword);
***************
*** 612,616 ****
              FROM ae_app_privileges 
              WHERE ap_app_id = ?');
!         $result = $this->db->execute($prepStmt, array($this->appId));
          //print $result->numRows(); exit;
          if (DB::isError($result)) {
--- 612,616 ----
              FROM ae_app_privileges 
              WHERE ap_app_id = ?');
!         $result = $this->db->execute($prepStmt, array($this->options['appId']));
          //print $result->numRows(); exit;
          if (DB::isError($result)) {
***************
*** 809,813 ****
              AND pa_app_id = ?
              AND pa_user_name = ?');
!         $result = $this->db->execute($prepStmt, array($this->options['appId'], $userName));
          if (DB::isError($result)) {
              throw new AESQLException($result->toString());
--- 809,814 ----
              AND pa_app_id = ?
              AND pa_user_name = ?');
!         $result = $this->db->execute($prepStmt, array($this->options['appId'], $username));
!         
          if (DB::isError($result)) {
              throw new AESQLException($result->toString());




More information about the geeklog-cvs mailing list