improve password change

This commit is contained in:
yuri
2015-07-02 15:10:01 +03:00
parent 8cd4fe5891
commit 97d7796f9d
5 changed files with 38 additions and 3 deletions
+4 -1
View File
@@ -53,7 +53,10 @@ class User extends \Espo\Core\Controllers\Record
if (!$request->isPost()) {
throw new BadRequest();
}
return $this->getService('User')->changePassword($this->getUser()->id, $data['password']);
if (!array_key_exists('password', $data) || !array_key_exists('currentPassword', $data)) {
throw new BadRequest();
}
return $this->getService('User')->changePassword($this->getUser()->id, $data['password'], true, $data['currentPassword']);
}
public function actionChangePasswordByRequest($params, $data, $request)