Selaa lähdekoodia

Archive mode: fixed the recording of user preferences

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4779 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 vuotta sitten
vanhempi
commit
daa7f7dde5
2 muutettua tiedostoa jossa 8 lisäystä ja 2 poistoa
  1. 6 1
      application/user.preferences.class.inc.php
  2. 2 1
      pages/preferences.php

+ 6 - 1
application/user.preferences.class.inc.php

@@ -155,7 +155,9 @@ class appUserPreferences extends DBObject
 		{
 			if (self::$oUserPrefs->IsModified())
 			{
+				utils::PushArchiveMode(false);
 				self::$oUserPrefs->DBUpdate();
+				utils::PopArchiveMode();
 			}
 		}
 	}
@@ -179,7 +181,9 @@ class appUserPreferences extends DBObject
 			$oObj->Set('preferences', array()); // Default preferences: an empty array
 			try
 			{
+				utils::PushArchiveMode(false);
 				$oObj->DBInsert();
+				utils::PopArchiveMode();
 			}
 			catch(Exception $e)
 			{
@@ -214,7 +218,8 @@ class appUserPreferences extends DBObject
 	*/
 	public function DBDeleteTracked(CMDBChange $oChange, $bSkipStrongSecurity = null, &$oDeletionPlan = null)
 	{
+		utils::PushArchiveMode(false);
 		$this->DBDelete($oDeletionPlan);
+		utils::PopArchiveMode();
 	}
 }
-?>

+ 2 - 1
pages/preferences.php

@@ -344,7 +344,9 @@ try
 		$sLangCode = utils::ReadParam('language', 'EN US');
 		$oUser = UserRights::GetUserObject();
 		$oUser->Set('language', $sLangCode);
+		utils::PushArchiveMode(false);
 		$oUser->DBUpdate();
+		utils::PopArchiveMode();
 		// Redirect to force a reload/display of the page with the new language
 		$oAppContext = new ApplicationContext();
 		$sURL = utils::GetAbsoluteUrlAppRoot().'pages/preferences.php?'.$oAppContext->GetForLink();
@@ -423,4 +425,3 @@ catch(Exception $e)
 		IssueLog::Error($e->getMessage());
 	}
 }
-?>