mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°4036 - User edition controls : a user cannot change his own status (fix)
This commit is contained in:
@@ -351,7 +351,7 @@ abstract class User extends cmdbAbstractObject
|
||||
|
||||
// A User cannot disable himself
|
||||
if ($this->IsCurrentUser()) {
|
||||
if (isset($aChanges['status'])) {
|
||||
if (isset($aChanges['status']) && ($this->Get('status') == 'disabled')) {
|
||||
$this->m_aCheckIssues[] = Dict::S('Class:User/Error:StatusChangeIsNotAllowed');
|
||||
}
|
||||
}
|
||||
@@ -418,8 +418,8 @@ abstract class User extends cmdbAbstractObject
|
||||
}
|
||||
}
|
||||
|
||||
$oAddon = UserRights::GetModuleInstance();
|
||||
if (!UserRights::IsAdministrator()) {
|
||||
$oAddon = UserRights::GetModuleInstance();
|
||||
$oUser = UserRights::GetUserObject();
|
||||
if (!is_null($oUser) && method_exists($oAddon, 'GetUserOrgs')) {
|
||||
$aOrgs = $oAddon->GetUserOrgs($oUser, ''); // Modifier allowed orgs
|
||||
|
||||
Reference in New Issue
Block a user