diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 30536e6bca7..75b0d84f236 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -937,7 +937,9 @@ class auth_plugin_ldap extends auth_plugin_base { // It isn't possible to just rely on the configured suspension attribute since // things like active directory use bit masks, other things using LDAP might // do different stuff as well. - $user->suspended = $this->is_user_suspended($user); + // + // The cast to int is a workaround for MDL-53959. + $user->suspended = (int)$this->is_user_suspended($user); if (empty($user->lang)) { $user->lang = $CFG->lang; } @@ -1012,7 +1014,8 @@ class auth_plugin_ldap extends auth_plugin_base { if (!empty($updatekeys)) { $newuser = new stdClass(); $newuser->id = $userid; - $newuser->suspended = $this->is_user_suspended((object) $newinfo); + // The cast to int is a workaround for MDL-53959. + $newuser->suspended = (int)$this->is_user_suspended((object) $newinfo); foreach ($updatekeys as $key) { if (isset($newinfo[$key])) { diff --git a/lib/ldaplib.php b/lib/ldaplib.php index ccda80687ff..ec18f6f23a7 100644 --- a/lib/ldaplib.php +++ b/lib/ldaplib.php @@ -75,6 +75,14 @@ function ldap_getdefaults() { 'ad' => 'cn', 'default' => 'cn' ); + $default['suspended_attribute'] = array( + 'edir' => '', + 'rfc2307' => '', + 'rfc2307bis' => '', + 'samba' => '', + 'ad' => '', + 'default' => '' + ); $default['memberattribute'] = array( 'edir' => 'member', 'rfc2307' => 'member',