MDL-38262 auth/{ldap,cas}: Fix undefined property notification on first config
Just move the test after we've set the default configuration values if they are not defined. Signed-off-by: Iñaki Arenaza <[email protected]>
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
?>
|
||||
<table cellspacing="0" cellpadding="5" border="0">
|
||||
<tr>
|
||||
@@ -280,7 +286,6 @@ $yesno = array( get_string('no'), get_string('yes') );
|
||||
<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']); }
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
?>
|
||||
<table cellspacing="0" cellpadding="5" border="0">
|
||||
<tr>
|
||||
@@ -170,7 +176,6 @@ $yesno = array(get_string('no'), get_string('yes'));
|
||||
<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']); }
|
||||
|
||||
Reference in New Issue
Block a user