Skip to content

Commit

Permalink
auth/cas MDL-23371 Add missing detection of PHP LDAP module like we d…
Browse files Browse the repository at this point in the history
…o in auth/ldap
  • Loading branch information
iarenaza committed Jul 25, 2010
1 parent fe3b9da commit 840fcf0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 14 additions & 0 deletions auth/cas/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@ function connectCAS() {
function config_form($config, $err, $user_fields) {
global $CFG, $OUTPUT;

if (!function_exists('ldap_connect')) { // Is php-ldap really there?
echo $OUTPUT->notification(get_string('auth_ldap_noextension', 'auth_ldap'));

// Don't return here, like we do in auth/ldap. We cas use CAS without LDAP.
// So just warn the user (done above) and define the LDAP constants we use
// in config.html, to silence the warnings.
if (!defined('LDAP_DEREF_NEVER')) {
define ('LDAP_DEREF_NEVER', 0);
}
if (!defined('LDAP_DEREF_ALWAYS')) {
define ('LDAP_DEREF_ALWAYS', 3);
}
}

include($CFG->dirroot.'/auth/cas/config.html');
}

Expand Down
4 changes: 0 additions & 4 deletions auth/cas/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@

$yesno = array( get_string('no'), get_string('yes') );

if (!function_exists('ldap_connect')) { // Is php-ldap really there?
echo $OUTPUT->notification(get_string('auth_ldap_noextension', 'auth_ldap'));
}

?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
Expand Down

0 comments on commit 840fcf0

Please sign in to comment.