mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fix PHP CS
This commit is contained in:
@@ -427,8 +427,7 @@ abstract class User extends cmdbAbstractObject
|
||||
$this->m_aCheckIssues[] = Dict::S('Class:User/Error:AdminProfileCannotBeRemovedBySelf');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($this->IsPrivilegedUser()) {
|
||||
} elseif ($this->IsPrivilegedUser()) {
|
||||
// Prevent Privileged User to be saved with profiles denying the access to the backoffice
|
||||
$oSet->Rewind();
|
||||
while ($oUserProfile = $oSet->Fetch()) {
|
||||
|
||||
@@ -661,17 +661,15 @@ abstract class ItopDataTestCase extends ItopTestCase
|
||||
{
|
||||
/** @var \ormLinkSet $oSet */
|
||||
$oSet = $oUser->Get('profile_list');
|
||||
foreach ($oSet as $oUserProfile)
|
||||
{
|
||||
if ($oUserProfile->Get('profileid') == $iProfileId)
|
||||
{
|
||||
foreach ($oSet as $oUserProfile) {
|
||||
if ($oUserProfile->Get('profileid') == $iProfileId) {
|
||||
$oSet->RemoveItem($oUserProfile->GetKey());
|
||||
break;
|
||||
}
|
||||
}
|
||||
$oUser = $this->updateObject(User::class, $oUser->GetKey(), array(
|
||||
$oUser = $this->updateObject(User::class, $oUser->GetKey(), [
|
||||
'profile_list' => $oSet,
|
||||
));
|
||||
]);
|
||||
return $oUser;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,12 +87,12 @@ class UserRightsTest extends ItopDataTestCase
|
||||
foreach ($aProfileIds as $iProfileId) {
|
||||
$oProfiles->AddItem(MetaModel::NewObject('URP_UserProfile', ['profileid' => $iProfileId, 'reason' => 'UNIT Tests']));
|
||||
}
|
||||
$oUser = MetaModel::NewObject('UserLocal', array(
|
||||
$oUser = MetaModel::NewObject('UserLocal', [
|
||||
'login' => $sLogin,
|
||||
'password' => 'Password1!',
|
||||
'expiration' => UserLocal::EXPIRE_NEVER,
|
||||
'profile_list' => $oProfiles,
|
||||
));
|
||||
]);
|
||||
return $oUser;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,6 @@ class UserRightsTest extends ItopDataTestCase
|
||||
$this->RemoveProfileFromUser($oUser, $iProfileId);
|
||||
}
|
||||
|
||||
|
||||
public function UserCannotLoseUserEditionRightsProvider(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user