mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Internal: improved the user management API ChangePassword()
SVN:trunk[1012]
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user