N°2311 - authent-cas compatibility with 2.6 configuration

This commit is contained in:
Eric
2019-08-21 16:13:49 +02:00
parent 08517f0c7e
commit 0831a427cc
2 changed files with 7 additions and 3 deletions

View File

@@ -232,7 +232,7 @@ class CASUserProvisioning
$bFound = false;
if (!empty($sCASMemberships))
{
$sCASMemberOfName = Config::Get('cas_memberof_attribute_name');
$sCASMemberOfName = Config::Get('cas_memberof_attribute_name', 'memberOf');
if (phpCAS::hasAttribute($sCASMemberOfName))
{
// A list of groups is specified, the user must a be member of (at least) one of them to pass
@@ -341,7 +341,7 @@ class CASUserProvisioning
public static function UpdateUser(User $oUser)
{
$bCASUpdateProfiles = Config::Get('cas_update_profiles');
$sCASMemberOfName = Config::Get('cas_memberof_attribute_name');
$sCASMemberOfName = Config::Get('cas_memberof_attribute_name', 'memberOf');
if ($bCASUpdateProfiles && (phpCAS::hasAttribute($sCASMemberOfName)))
{
$aMemberOf = phpCAS::getAttribute($sCASMemberOfName);

View File

@@ -20,13 +20,17 @@ class Config
*
* @return mixed
*/
public static function Get($sName)
public static function Get($sName, $sDefaultValue = '')
{
$sValue = MetaModel::GetModuleSetting('authent-cas', $sName, '');
if (empty($sValue))
{
$sValue = MetaModel::GetConfig()->Get($sName);
}
if (empty($sValue))
{
return $sDefaultValue;
}
return $sValue;
}