host_url)) { $config->host_url = ''; } if (!isset($config->start_tls)) { $config->start_tls = false; } if (empty($config->ldapencoding)) { $config->ldapencoding = 'utf-8'; } if (!isset($config->pagesize)) { $config->pagesize = LDAP_DEFAULT_PAGESIZE; } if (!isset($config->contexts)) { $config->contexts = ''; } if (!isset($config->user_type)) { $config->user_type = 'default'; } if (!isset($config->user_attribute)) { $config->user_attribute = ''; } if (!isset($config->suspended_attribute)) { $config->suspended_attribute = ''; } if (!isset($config->sync_suspended)) { $config->sync_suspended = ''; } if (!isset($config->search_sub)) { $config->search_sub = ''; } if (!isset($config->opt_deref)) { $config->opt_deref = LDAP_DEREF_NEVER; } if (!isset($config->preventpassindb)) { $config->preventpassindb = 0; } if (!isset($config->bind_dn)) { $config->bind_dn = ''; } if (!isset($config->bind_pw)) { $config->bind_pw = ''; } if (!isset($config->ldap_version)) { $config->ldap_version = '3'; } if (!isset($config->objectclass)) { $config->objectclass = ''; } if (!isset($config->memberattribute)) { $config->memberattribute = ''; } if (!isset($config->memberattribute_isdn)) { $config->memberattribute_isdn = ''; } if (!isset($config->creators)) { $config->creators = ''; } if (!isset($config->create_context)) { $config->create_context = ''; } if (!isset($config->expiration)) { $config->expiration = ''; } if (!isset($config->expiration_warning)) { $config->expiration_warning = '10'; } if (!isset($config->expireattr)) { $config->expireattr = ''; } if (!isset($config->gracelogins)) { $config->gracelogins = ''; } if (!isset($config->graceattr)) { $config->graceattr = ''; } if (!isset($config->auth_user_create)) { $config->auth_user_create = ''; } if (!isset($config->forcechangepassword)) { $config->forcechangepassword = 0; } if (!isset($config->stdchangepassword)) { $config->stdchangepassword = 0; } if (!isset($config->passtype)) { $config->passtype = 'plaintext'; } if (!isset($config->changepasswordurl)) { $config->changepasswordurl = ''; } if (!isset($config->removeuser)) { $config->removeuser = AUTH_REMOVEUSER_KEEP; } if (!isset($config->ntlmsso_enabled)) { $config->ntlmsso_enabled = 0; } if (!isset($config->ntlmsso_subnet)) { $config->ntlmsso_subnet = ''; } if (!isset($config->ntlmsso_ie_fastpath)) { $config->ntlmsso_ie_fastpath = 0; } if (!isset($config->ntlmsso_type)) { $config->ntlmsso_type = 'ntlm'; } if (!isset($config->ntlmsso_remoteuserformat)) { $config->ntlmsso_remoteuserformat = ''; } $yesno = array(get_string('no'), get_string('yes')); $fastpathoptions = array(AUTH_NTLM_FASTPATH_YESFORM => get_string('auth_ntlmsso_ie_fastpath_yesform', 'auth_ldap'), AUTH_NTLM_FASTPATH_YESATTEMPT => get_string('auth_ntlmsso_ie_fastpath_yesattempt', 'auth_ldap'), AUTH_NTLM_FASTPATH_ATTEMPT => get_string('auth_ntlmsso_ie_fastpath_attempt', 'auth_ldap')); $disabled = ''; $pagedresultssupported = false; if ($config->host_url !== '') { /** * We try to connect each and every time we open the config, because we want to set the Page * Size setting as enabled or disabled depending on the configured LDAP server supporting * pagination or not, and to notify the user about it. If the user changed the LDAP server (or * the LDAP protocol version) last time, it might happen that paged results are no longer * available and we want to show that to the user the next time she goes to the settings page. */ try { $ldapconn = $this->ldap_connect(); $pagedresultssupported = ldap_paged_results_supported($config->ldap_version, $ldapconn); } catch (Exception $e) { // If we couldn't connect and get the supported options, we can only assume we don't support paged results. $pagedresultssupported = false; } } /* Make sure we only disable the paged result size setting and show the notification about it if * there is a configured server that we tried to contact. Othersiwe, if someone's LDAP server does * support paged results, they won't be able to turn it on the first time they set it up (because * the field will be disabled). */ if (($config->host_url !== '') && (!$pagedresultssupported)) { $disabled = ' disabled="disabled"'; echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'), \core\output\notification::NOTIFY_INFO); } ?> '; $help .= get_string('auth_updateremote_ldap', 'auth'); print_auth_lock_options($this->authtype, $user_fields, $help, true, true, $this->get_custom_user_profile_fields()); ?>

error_text($err['host_url']); } ?>
ldap_version, false); if (isset($err['ldap_version'])) { echo $OUTPUT->error_text($err['ldap_version']); } ?>
start_tls, false); ?>
error_text($err['ldapencoding']); } ?>
/> error_text($err['pagesize']); } if ($disabled) { // Don't loose the page size value (disabled fields are not submitted!) ?>

preventpassindb, false); ?>
error_text($err['bind_dn']); } ?>
error_text($err['bind_pw']); } ?>

user_type, false); if (isset($err['user_type'])) { echo $OUTPUT->error_text($err['user_type']); } ?>
error_text($err['contexts']); } ?>
search_sub, false); ?>
opt_deref, false); if (isset($err['opt_deref'])) { echo $OUTPUT->error_text($err['opt_deref']); } ?>
error_text($err['user_attribute']); } ?>
error_text($err['suspended_attribute']); } ?>
error_text($err['memberattribute']); } ?>
error_text($err['memberattribute_isdn']); } ?>
error_text($err['objectclass']); } ?>

forcechangepassword, false); ?>

stdchangepassword, false); ?>

passtype, false); ?>
error_text($err['changepasswordurl']); } ?>

expiration, false); if (isset($err['expiration'])) { echo $OUTPUT->error_text($err['expiration']); } ?>
error_text($err['expiration_warning']); } ?>
error_text($err['expireattr']); } ?>
gracelogins, false); ?>
error_text($err['graceattr']); } ?>

auth_user_create, false); ?>
error_text($err['create_context']); } ?>

error_text($err['creators']); } ?>

removeuser, false); ?>
sync_suspended, false); ?>

ntlmsso_enabled, false); ?>
ntlmsso_ie_fastpath, false); ?>
ntlmsso_type, false); ?>
error_text($err['ntlmsso_remoteuserformat']); } ?>