浏览代码

- Fixed bug #102: regression introduced with the encoding of passwords: users were no longer able to change their own password...

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@778 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 年之前
父节点
当前提交
bda4221fb4

+ 0 - 6
application/loginwebpage.class.inc.php

@@ -380,12 +380,6 @@ EOF
 				$oPage->output();
 				$oPage->output();
 				exit;
 				exit;
 			}
 			}
-			else
-			{
-				// Remember the changed password
-				$_SESSION['auth_pwd'] = $sNewPwd;
-				return;
-			}
 		}
 		}
 		
 		
 		self::Login();
 		self::Login();

+ 1 - 1
modules/authent-local/fr.dict.authent-local.php

@@ -37,7 +37,7 @@
 // Class: UserLocal
 // Class: UserLocal
 //
 //
 
 
-Dict::Add('EN US', 'French', 'Français', array(
+Dict::Add('FR FR', 'French', 'Français', array(
 	'Class:UserLocal' => 'Utilisateur iTop',
 	'Class:UserLocal' => 'Utilisateur iTop',
 	'Class:UserLocal+' => 'Utilisateur authentifié par iTop',
 	'Class:UserLocal+' => 'Utilisateur authentifié par iTop',
 	'Class:UserLocal/Attribute:password' => 'Mot de passe',
 	'Class:UserLocal/Attribute:password' => 'Mot de passe',

+ 5 - 5
modules/authent-local/model.authent-local.php

@@ -56,10 +56,6 @@ class UserLocal extends UserInternal
 
 
 	public function CheckCredentials($sPassword)
 	public function CheckCredentials($sPassword)
 	{
 	{
-//		if ($this->Get('password') == $sPassword)
-//		{
-//			return true;
-//		}
 		$oPassword = $this->Get('password'); // ormPassword object
 		$oPassword = $this->Get('password'); // ormPassword object
 		// Cannot compare directly the values since they are hashed, so
 		// Cannot compare directly the values since they are hashed, so
 		// Let's ask the password to compare the hashed values
 		// Let's ask the password to compare the hashed values
@@ -89,7 +85,10 @@ class UserLocal extends UserInternal
 
 
 	public function ChangePassword($sOldPassword, $sNewPassword)
 	public function ChangePassword($sOldPassword, $sNewPassword)
 	{
 	{
-		if ($this->Get('password') == $sOldPassword)
+		$oPassword = $this->Get('password'); // ormPassword object
+		// Cannot compare directly the values since they are hashed, so
+		// Let's ask the password to compare the hashed values
+		if ($oPassword->CheckPassword($sOldPassword))
 		{
 		{
 			$this->Set('password', $sNewPassword);
 			$this->Set('password', $sNewPassword);
 			$oChange = MetaModel::NewObject("CMDBChange");
 			$oChange = MetaModel::NewObject("CMDBChange");
@@ -103,6 +102,7 @@ class UserLocal extends UserInternal
 				$sUserString = UserRights::GetUser();
 				$sUserString = UserRights::GetUser();
 			}
 			}
 			$oChange->Set("userinfo", $sUserString);
 			$oChange->Set("userinfo", $sUserString);
+			$oChange->DBInsert();
 			$this->DBUpdateTracked($oChange);
 			$this->DBUpdateTracked($oChange);
 			return true;
 			return true;
 		}
 		}

+ 1 - 0
modules/authent-local/module.authent-local.php

@@ -24,6 +24,7 @@ SetupWebPage::AddModule(
 		),
 		),
 		'dictionary' => array(
 		'dictionary' => array(
 			'en.dict.authent-local.php',
 			'en.dict.authent-local.php',
+			'fr.dict.authent-local.php',
 		),
 		),
 		'data.struct' => array(
 		'data.struct' => array(
 			//'data.struct.authent-local.xml',
 			//'data.struct.authent-local.xml',