Skip to content
Browse files

MDL-38262 auth/{ldap,cas}: Fix undefined property notification on fir…

…st config

Just move the test after we've set the default configuration values if
they are not defined.

Signed-off-by: Iñaki Arenaza <iarenaza@mondragon.edu>
  • Loading branch information...
1 parent cce0d9a commit 4bcb0396c2bbca4388b8cb181706e3503f1672fd @iarenaza iarenaza committed
Showing with 12 additions and 10 deletions.
  1. +0 −4 auth/cas/auth.php
  2. +6 −1 auth/cas/config.html
  3. +0 −4 auth/ldap/auth.php
  4. +6 −1 auth/ldap/config.html
View
4 auth/cas/auth.php
@@ -208,10 +208,6 @@ function config_form($config, $err, $user_fields) {
}
}
- if (!ldap_paged_results_supported($this->config->ldap_version)) {
- echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
- }
-
include($CFG->dirroot.'/auth/cas/config.html');
}
View
7 auth/cas/config.html
@@ -95,6 +95,12 @@
$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'));
+}
+
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
@@ -280,7 +286,6 @@
<label for="pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label>
</td>
<td>
- <?php $disabled = (!ldap_paged_results_supported($config->ldap_version)) ? ' disabled="disabled"' : '' ; ?>
<input id="pagesize" name="pagesize" type="text" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/>
<?php
if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); }
View
4 auth/ldap/auth.php
@@ -1736,10 +1736,6 @@ function config_form($config, $err, $user_fields) {
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');
}
View
7 auth/ldap/config.html
@@ -106,6 +106,12 @@
$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'));
+}
+
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
@@ -170,7 +176,6 @@
<label for="pagesize"><?php print_string('pagesize_key', 'auth_ldap') ?></label>
</td>
<td>
- <?php $disabled = (!ldap_paged_results_supported($config->ldap_version)) ? ' disabled="disabled"' : '' ; ?>
<input id="pagesize" name="pagesize" type="text" value="<?php echo $config->pagesize ?>" <?php echo $disabled ?>/>
<?php
if (isset($err['pagesize'])) { echo $OUTPUT->error_text($err['pagesize']); }

0 comments on commit 4bcb039

Please sign in to comment.
Something went wrong with that request. Please try again.