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

SVN:trunk[778]
This commit is contained in:
Denis Flaven
2010-09-06 11:36:11 +00:00
parent 6ab797b03a
commit 4c789e8fbb
4 changed files with 7 additions and 12 deletions

View File

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

View File

@@ -37,7 +37,7 @@
// 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 authentifié par iTop',
'Class:UserLocal/Attribute:password' => 'Mot de passe',

View File

@@ -56,10 +56,6 @@ class UserLocal extends UserInternal
public function CheckCredentials($sPassword)
{
// if ($this->Get('password') == $sPassword)
// {
// return true;
// }
$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
@@ -89,7 +85,10 @@ class UserLocal extends UserInternal
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);
$oChange = MetaModel::NewObject("CMDBChange");
@@ -103,6 +102,7 @@ class UserLocal extends UserInternal
$sUserString = UserRights::GetUser();
}
$oChange->Set("userinfo", $sUserString);
$oChange->DBInsert();
$this->DBUpdateTracked($oChange);
return true;
}

View File

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