[geeklog-cvs] Auth_Enterprise/Server/providers AEPearDBProvider.class.php,1.7,1.8
tony at iowaoutdoors.org
tony at iowaoutdoors.org
Sat Jul 3 14:08:31 EDT 2004
Update of /var/cvs/Auth_Enterprise/Server/providers
In directory www:/tmp/cvs-serv32281
Modified Files:
AEPearDBProvider.class.php
Log Message:
Updated resetPassword, it is now working fine (as is everything else AFAICT)
Index: AEPearDBProvider.class.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Server/providers/AEPearDBProvider.class.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** AEPearDBProvider.class.php 2 Jul 2004 01:30:06 -0000 1.7
--- AEPearDBProvider.class.php 3 Jul 2004 18:08:29 -0000 1.8
***************
*** 351,360 ****
$newPassword = AEPasswordGenerator::generatePassword();
try {
! // Now reuse what we did in changePassword();
! return $this->changePassword($userName, $newPassword);
! } catch (Exception $e) {
throw $e;
}
}
--- 351,390 ----
$newPassword = AEPasswordGenerator::generatePassword();
+ // Begin a SQL transaction if we can
+ if ($this->db->provides('transactions')) {
+ $this->db->autoCommit(false);
+ }
+
try {
! $this->doPasswordChange($userName, $newPassword, $userName);
! } catch (AESQLException $e) {
! // rollback transaction
! if ($this->db->provides('transactions')) {
! $this->db->rollback();
! $this->db->autoCommit(true);
! }
! throw $e;
! }
!
! try {
! $this->addPasswordToHistory($userName, $newPassword);
! } catch (AESQLException $e) {
! // Rollback transaction
! if ($this->db->provides('transactions')) {
! $this->db->rollback();
! $this->db->autoCommit(true);
! }
!
! // Throw exception
throw $e;
}
+
+ // Commit it all
+ if ($this->db->provides('transactions')) {
+ $this->db->commit();
+ $this->db->autoCommit(true);
+ }
+
+ return $newPassword;
}
More information about the geeklog-cvs
mailing list