Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propus 16.3.0 plat 10919 #9430

Merged
merged 5 commits into from
May 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions api_v3/services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,24 @@ public function loginByLoginIdAction($loginId, $password, $partnerId = null, $ex
// exceptions might be thrown
return parent::loginImpl(null, $loginId, $password, $partnerId, $expiry, $privileges, $otp);
}



protected static function validateLoginDataParams($paramsArray)
{
kCurrentContext::$HTMLPurifierBehaviour = HTMLPurifierBehaviourType::BLOCK;
foreach ($paramsArray as $paramName => $paramValue)
{
try
{
kHtmlPurifier::purify('kuser', $paramName, $paramValue);
}
catch (Exception $e)
{
throw new KalturaAPIException(KalturaErrors::UNSAFE_HTML_TAGS, 'UserLoginData', $paramName);
}
}
}


/**
* Updates a user's login data: email, password, name.
*
Expand All @@ -343,7 +359,11 @@ public function loginByLoginIdAction($loginId, $password, $partnerId = null, $ex
* @throws KalturaErrors::MISSING_OTP
*/
public function updateLoginDataAction( $oldLoginId , $password , $newLoginId = "" , $newPassword = "", $newFirstName = null, $newLastName = null, $otp = null)
{
{
self::validateLoginDataParams(array('id' => $newLoginId,
'firstName' => $newFirstName,
'lastName' => $newLastName));

return parent::updateLoginDataImpl($oldLoginId , $password , $newLoginId, $newPassword, $newFirstName, $newLastName, $otp);
}

Expand Down