mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix scrutinizer
This commit is contained in:
@@ -248,8 +248,8 @@ class Users extends DolibarrApi
|
||||
*
|
||||
* @url GET /info
|
||||
*
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
@@ -371,11 +371,9 @@ class Users extends DolibarrApi
|
||||
if ($field == 'pass') {
|
||||
if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) {
|
||||
throw new RestException(401, 'You are not allowed to modify password of other users');
|
||||
continue;
|
||||
}
|
||||
if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) {
|
||||
throw new RestException(401, 'You are not allowed to modify your own password');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (DolibarrApiAccess::$user->admin) { // If user for API is admin
|
||||
|
||||
Reference in New Issue
Block a user