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:
Iñaki Arenaza
2013-03-03 21:19:21 +01:00
parent 19075a2120
commit 04c258ee19
4 changed files with 12 additions and 10 deletions
-4
View File
@@ -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');
}
+6 -1
View File
@@ -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'));
}
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
@@ -266,7 +272,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']); }
-4
View File
@@ -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');
}
+6 -1
View File
@@ -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'));
}
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
@@ -156,7 +162,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']); }