generate and send password

This commit is contained in:
yuri
2019-09-17 12:25:13 +03:00
parent 764b0c6705
commit 506200901d
5 changed files with 141 additions and 1 deletions

View File

@@ -118,6 +118,14 @@ class User extends \Espo\Core\Controllers\Record
return $this->getRecordService()->generateNewApiKeyForEntity($data->id)->getValueMap();
}
public function postActionGenerateNewPassword($params, $data, $request)
{
if (empty($data->id)) throw new BadRequest();
if (!$this->getUser()->isAdmin()) throw new Forbidden();
$this->getRecordService()->generateNewPasswordForUser($data->id);
return true;
}
public function beforeCreateLink()
{
if (!$this->getUser()->isAdmin()) throw new Forbidden();