From 4bcb0396c2bbca4388b8cb181706e3503f1672fd 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 ccd1021308e..6b22044b22d 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -208,10 +208,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 b333f299bd9..222845b1628 100644 --- a/auth/cas/config.html +++ b/auth/cas/config.html @@ -95,6 +95,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')); +} + ?> @@ -280,7 +286,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 9bdd5b37b64..00f0bf9da7d 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -1736,10 +1736,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 333bca354a7..514039787ab 100644 --- a/auth/ldap/config.html +++ b/auth/ldap/config.html @@ -106,6 +106,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')); +} + ?> @@ -170,7 +176,6 @@ $yesno = array(get_string('no'), get_string('yes'));
- ldap_version)) ? ' disabled="disabled"' : '' ; ?> /> error_text($err['pagesize']); }