Clean code
This commit is contained in:
parent
40a3f70eb3
commit
b6cfc3a3e0
@ -90,12 +90,10 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
|||||||
$childids = $user->getAllChildIds(1); // For later, test on salary visibility
|
$childids = $user->getAllChildIds(1); // For later, test on salary visibility
|
||||||
|
|
||||||
// Define value to know what current user can do on properties of edited user
|
// Define value to know what current user can do on properties of edited user
|
||||||
if ($id) {
|
if ($id > 0) {
|
||||||
// $user is the current logged user, $id is the user we want to edit
|
// $user is the current logged user, $id is the user we want to edit
|
||||||
$caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
|
$caneditfield = ((($user->id == $id) && $user->rights->user->self->creer) || (($user->id != $id) && $user->rights->user->user->creer));
|
||||||
|| (($user->id != $id) && $user->rights->user->user->creer));
|
$caneditpassword = ((($user->id == $id) && $user->rights->user->self->password) || (($user->id != $id) && $user->rights->user->user->password));
|
||||||
$caneditpassword = ((($user->id == $id) && $user->rights->user->self->password)
|
|
||||||
|| (($user->id != $id) && $user->rights->user->user->password));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -106,7 +104,7 @@ if ($user->socid > 0) {
|
|||||||
$feature2 = 'user';
|
$feature2 = 'user';
|
||||||
$result = restrictedArea($user, 'user', $id, 'user', $feature2);
|
$result = restrictedArea($user, 'user', $id, 'user', $feature2);
|
||||||
|
|
||||||
if ($user->id <> $id && !$canreaduser) {
|
if ($user->id != $id && !$canreaduser) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user