mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
5324- Guillaume PR feedbacks
This commit is contained in:
@@ -92,8 +92,8 @@ class UserProfilesEventListener implements iEventServiceSetup
|
|||||||
|
|
||||||
$aNonStandaloneProfiles = \utils::GetConfig()->GetModuleSetting('itop-profiles-itil', self::USERPROFILE_REPAIR_ITOP_PARAM_NAME, null);
|
$aNonStandaloneProfiles = \utils::GetConfig()->GetModuleSetting('itop-profiles-itil', self::USERPROFILE_REPAIR_ITOP_PARAM_NAME, null);
|
||||||
|
|
||||||
//when there are customized portals on an itop, choosing a specific profile means choosing which portal user will access
|
//When there are several customized portals on an itop, choosing a specific profile means choosing which portal user will access
|
||||||
//in that case, itop administrator has to specify it via itop configuration. we dont use default profiles repairment otherwise
|
//In that case, itop administrator has to specify it via itop configuration. we dont use default profiles repairment otherwise
|
||||||
if (is_null($aNonStandaloneProfiles)){
|
if (is_null($aNonStandaloneProfiles)){
|
||||||
if (count($aPortalDispatcherData) > 2){
|
if (count($aPortalDispatcherData) > 2){
|
||||||
$this->bIsRepairmentEnabled = false;
|
$this->bIsRepairmentEnabled = false;
|
||||||
@@ -120,7 +120,7 @@ class UserProfilesEventListener implements iEventServiceSetup
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($aNonStandaloneProfiles)){
|
if (empty($aNonStandaloneProfiles)){
|
||||||
//feature specifically disabled in itop configuration
|
//Feature specifically disabled in itop configuration
|
||||||
$this->bIsRepairmentEnabled = false;
|
$this->bIsRepairmentEnabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -176,7 +176,7 @@ class UserProfilesEventListener implements iEventServiceSetup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RepairProfiles(\User $oUser) : void
|
public function RepairProfiles(?\User $oUser) : void
|
||||||
{
|
{
|
||||||
if (!is_null($oUser))
|
if (!is_null($oUser))
|
||||||
{
|
{
|
||||||
@@ -188,10 +188,10 @@ class UserProfilesEventListener implements iEventServiceSetup
|
|||||||
if (array_key_exists($sSingleProfileName, $this->aNonStandaloneProfilesMap)) {
|
if (array_key_exists($sSingleProfileName, $this->aNonStandaloneProfilesMap)) {
|
||||||
$sRepairingProfileId = $this->aNonStandaloneProfilesMap[$sSingleProfileName];
|
$sRepairingProfileId = $this->aNonStandaloneProfilesMap[$sSingleProfileName];
|
||||||
if (is_null($sRepairingProfileId)){
|
if (is_null($sRepairingProfileId)){
|
||||||
//notify current user via session messages that there will be an issue
|
//Notify current user via session messages that there will be an issue
|
||||||
//without preventing from commiting
|
//Without preventing from commiting
|
||||||
} else {
|
} else {
|
||||||
//completing profiles profiles by adding repairing one : by default portal user to a power portal user
|
//Completing profiles profiles by adding repairing one : by default portal user to a power portal user
|
||||||
$oUserProfile = new \URP_UserProfile();
|
$oUserProfile = new \URP_UserProfile();
|
||||||
$oUserProfile->Set('profileid', $sRepairingProfileId);
|
$oUserProfile->Set('profileid', $sRepairingProfileId);
|
||||||
$oCurrentUserProfileSet->AddItem($oUserProfile);
|
$oCurrentUserProfileSet->AddItem($oUserProfile);
|
||||||
|
|||||||
Reference in New Issue
Block a user