Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0
This commit is contained in:
commit
d3af00d4e6
@ -137,8 +137,12 @@ class Login
|
|||||||
if (empty($tmpuser->api_key) || $reset) {
|
if (empty($tmpuser->api_key) || $reset) {
|
||||||
$tmpuser->getrights();
|
$tmpuser->getrights();
|
||||||
if (empty($tmpuser->rights->user->self->creer)) {
|
if (empty($tmpuser->rights->user->self->creer)) {
|
||||||
|
if (empty($tmpuser->api_key)) {
|
||||||
|
throw new RestException(403, 'No API token set for this user and user need write permission on itself to reset its API token');
|
||||||
|
} else {
|
||||||
throw new RestException(403, 'User need write permission on itself to reset its API token');
|
throw new RestException(403, 'User need write permission on itself to reset its API token');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Generate token for user
|
// Generate token for user
|
||||||
$token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY)?'':$conf->global->MAIN_API_KEY), 1);
|
$token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY)?'':$conf->global->MAIN_API_KEY), 1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user