mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 14:58:43 +02:00
Support patterns for casMemberof
SVN:1.2[1696]
This commit is contained in:
@@ -274,7 +274,24 @@ EOF
|
|||||||
phpCAS::log("Info: user if a member of the group: ".$sGroupName);
|
phpCAS::log("Info: user if a member of the group: ".$sGroupName);
|
||||||
$sGroupName = trim(iconv('UTF-8', 'ASCII//TRANSLIT', $sGroupName)); // Remove accents and spaces as well
|
$sGroupName = trim(iconv('UTF-8', 'ASCII//TRANSLIT', $sGroupName)); // Remove accents and spaces as well
|
||||||
$aFilteredGroupNames[] = $sGroupName;
|
$aFilteredGroupNames[] = $sGroupName;
|
||||||
if (in_array($sGroupName, $aCASMemberships))
|
$bIsMember = false;
|
||||||
|
foreach($aCASMemberships as $sCASPattern)
|
||||||
|
{
|
||||||
|
if (self::IsPattern($sCASPattern))
|
||||||
|
{
|
||||||
|
if (preg_match($sCASPattern, $sGroupName))
|
||||||
|
{
|
||||||
|
$bIsMember = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($sPattern == $sGroupName)
|
||||||
|
{
|
||||||
|
$bIsMember = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($bIsMember)
|
||||||
{
|
{
|
||||||
$bCASUserSynchro = MetaModel::GetConfig()->Get('cas_user_synchro');
|
$bCASUserSynchro = MetaModel::GetConfig()->Get('cas_user_synchro');
|
||||||
if ($bCASUserSynchro)
|
if ($bCASUserSynchro)
|
||||||
@@ -614,6 +631,18 @@ EOF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static function IsPattern($sCASPattern)
|
||||||
|
{
|
||||||
|
if ((substr($sCASPattern, 0, 1) == '/') && (substr($sCASPattern, -1) == '/'))
|
||||||
|
{
|
||||||
|
// the string is enclosed by slashes, let's assume it's a pattern
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
} // End of class
|
} // End of class
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user