From 04c258ee19eef0bbf0972e5f7b5e1a3f7cbcc585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Arenaza?= Date: Sun, 3 Mar 2013 21:17:00 +0100 Subject: [PATCH] MDL-38262 auth/{ldap,cas}: Fix undefined property notification on first config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just move the test after we've set the default configuration values if they are not defined. Signed-off-by: IƱaki Arenaza --- auth/cas/auth.php | 4 ---- auth/cas/config.html | 7 ++++++- auth/ldap/auth.php | 4 ---- auth/ldap/config.html | 7 ++++++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/auth/cas/auth.php b/auth/cas/auth.php index 915d247ab78..7d76eefe7fd 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -206,10 +206,6 @@ class auth_plugin_cas extends auth_plugin_ldap { } } - if (!ldap_paged_results_supported($this->config->ldap_version)) { - echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap')); - } - include($CFG->dirroot.'/auth/cas/config.html'); } diff --git a/auth/cas/config.html b/auth/cas/config.html index 0cb7c27b915..2c190506a49 100644 --- a/auth/cas/config.html +++ b/auth/cas/config.html @@ -92,6 +92,12 @@ if (!isset($config->removeuser)) { $yesno = array( get_string('no'), get_string('yes') ); +$disabled = ''; +if (!ldap_paged_results_supported($config->ldap_version)) { + $disabled = ' disabled="disabled"'; + echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap')); +} + ?> @@ -266,7 +272,6 @@ $yesno = array( get_string('no'), get_string('yes') );
- ldap_version)) ? ' disabled="disabled"' : '' ; ?> /> error_text($err['pagesize']); } diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index e8abd12ce3f..6cf1ae5fe71 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -1711,10 +1711,6 @@ class auth_plugin_ldap extends auth_plugin_base { return; } - if (!ldap_paged_results_supported($this->config->ldap_version)) { - echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap')); - } - include($CFG->dirroot.'/auth/ldap/config.html'); } diff --git a/auth/ldap/config.html b/auth/ldap/config.html index 7112d4d8051..809f5503bba 100644 --- a/auth/ldap/config.html +++ b/auth/ldap/config.html @@ -103,6 +103,12 @@ if (!isset($config->ntlmsso_remoteuserformat)) { $yesno = array(get_string('no'), get_string('yes')); +$disabled = ''; +if (!ldap_paged_results_supported($config->ldap_version)) { + $disabled = ' disabled="disabled"'; + echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap')); +} + ?> @@ -156,7 +162,6 @@ $yesno = array(get_string('no'), get_string('yes'));
- ldap_version)) ? ' disabled="disabled"' : '' ; ?> /> error_text($err['pagesize']); }