Skip to content

Commit

Permalink
MDL-38262 auth/{ldap,cas}: Fix undefined property notification on fir…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
iarenaza committed Mar 3, 2013
1 parent cce0d9a commit 4bcb039
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 0 additions & 4 deletions auth/cas/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
7 changes: 6 additions & 1 deletion auth/cas/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -280,7 +286,6 @@ <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
<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']); }
Expand Down
4 changes: 0 additions & 4 deletions auth/ldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
7 changes: 6 additions & 1 deletion auth/ldap/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -170,7 +176,6 @@ <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
<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']); }
Expand Down

0 comments on commit 4bcb039

Please sign in to comment.