[icinga-checkins] icinga.org: icinga-web/mhein/reporting: * Oracle fix for editing users with principals

git at icinga.org git at icinga.org
Thu Jul 7 17:19:19 CEST 2011


Module: icinga-web
Branch: mhein/reporting
Commit: 867f5803edccd14edb2821deecbbc69d6669ed20
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=867f5803edccd14edb2821deecbbc69d6669ed20

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Jul  7 12:53:52 2011 +0200

* Oracle fix for editing users with principals

---

 .../actions/Admin/Users/EditAction.class.php       |    6 ++----
 app/modules/AppKit/models/UserAdminModel.class.php |   10 ++++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/app/modules/AppKit/actions/Admin/Users/EditAction.class.php b/app/modules/AppKit/actions/Admin/Users/EditAction.class.php
index 82b441c..d27b161 100755
--- a/app/modules/AppKit/actions/Admin/Users/EditAction.class.php
+++ b/app/modules/AppKit/actions/Admin/Users/EditAction.class.php
@@ -54,6 +54,8 @@ class AppKit_Admin_Users_EditAction extends AppKitBaseAction
 			// Update the simple data!
 			$useradmin->updateUserData($user, $rd);
 		
+			Doctrine_Manager::connection()->commit();
+			
 			if ($rd->getParameter('password_validate', false) !== false) {
 				$useradmin->updateUserPassword($user, $rd->getParameter('password_validate'));
 			}
@@ -66,10 +68,6 @@ class AppKit_Admin_Users_EditAction extends AppKitBaseAction
 				$rd->getParameter('principal_target', array ()),
 				$rd->getParameter('principal_value', array ())
 			);
-			
-			// Give notice!
-			
-			Doctrine_Manager::connection()->commit();
 		}
 		catch (Exception $e) {
 			try {
diff --git a/app/modules/AppKit/models/UserAdminModel.class.php b/app/modules/AppKit/models/UserAdminModel.class.php
index 1c2dce1..d2111aa 100755
--- a/app/modules/AppKit/models/UserAdminModel.class.php
+++ b/app/modules/AppKit/models/UserAdminModel.class.php
@@ -97,12 +97,16 @@ class AppKit_UserAdminModel extends AppKitBaseModel
 	 */
 	public function updateUserData(NsmUser &$user, AgaviRequestDataHolder &$rd) {
 		AppKitDoctrineUtil::updateRecordsetFromArray($user, $rd->getParameters(), self::$editableAttributes);
+		
 		if(!$user->get("user_password")) {
-			$user->set("user_password",AppKitRandomUtil::initRand());
-			$user->set("user_salt",AppKitRandomUtil::initRand());
+		    $user->set('user_password', '__NOT_SET__');
+		    $user->set('user_salt', '__NOT_SET__');
 		}
+		
 		$user->save();
 		
+		$user->refresh(true);
+		
 		return true;
 	}
 	
@@ -115,8 +119,6 @@ class AppKit_UserAdminModel extends AppKitBaseModel
 	 * @author Marius Hein
 	 */
 	public function updateUserPassword(NsmUser &$user, $user_password) {
-		AppKitRandomUtil::initRand(); 
-
 		$user->updatePassword($user_password);
 		$user->save();
 		





More information about the icinga-checkins mailing list