diff --git a/datamodels/2.x/authent-cas/src/CASLoginExtension.php b/datamodels/2.x/authent-cas/src/CASLoginExtension.php index e7f9ef0c2..3eb594ba8 100644 --- a/datamodels/2.x/authent-cas/src/CASLoginExtension.php +++ b/datamodels/2.x/authent-cas/src/CASLoginExtension.php @@ -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); diff --git a/datamodels/2.x/authent-cas/src/Config.php b/datamodels/2.x/authent-cas/src/Config.php index 0e20707f9..085b79971 100644 --- a/datamodels/2.x/authent-cas/src/Config.php +++ b/datamodels/2.x/authent-cas/src/Config.php @@ -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; }