Internal: improved the user management API ChangePassword()

SVN:trunk[1012]
This commit is contained in:
Romain Quetiez
2010-12-06 17:07:07 +00:00
parent 35fe0b9ef5
commit e66f06cda2

View File

@@ -418,16 +418,25 @@ class UserRights
}
}
public static function ChangePassword($sCurrentPassword, $sNewPassword)
public static function ChangePassword($sOldPassword, $sNewPassword, $sName = '')
{
if (!is_null(self::$m_oUser))
if (empty($sName))
{
return self::$m_oUser->ChangePassword($sCurrentPassword, $sNewPassword);
$oUser = self::$m_oUser;
}
else
{
// find the id out of the login string
$oUser = self::FindUser($sName);
}
if (is_null($oUser))
{
return false;
}
else
{
return $oUser->ChangePassword($sOldPassword, $sNewPassword);
}
}
public static function Impersonate($sName, $sPassword)