Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

LDAP servers being down or unavailable should not prevent login - we …

…now fail with a notice() rather than with an error()
  • Loading branch information...
commit c53889ff42fd8237838260099bb1b798e033db3a 1 parent 1a6649e
martinlanghoff authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 enrol/ldap/enrol.php
View
12 enrol/ldap/enrol.php
@@ -45,7 +45,7 @@ function get_user_courses(&$user, $type) {
$ldap_connection = $this->enrol_ldap_connect();
if (!$ldap_connection) {
@ldap_close($ldap_connection);
- error("LDAP-module cannot connect to server: $CFG->ldap_host_url");
+ notify("LDAP-module cannot connect to server: $CFG->ldap_host_url");
return false;
}
@@ -150,7 +150,7 @@ function sync_enrolments($type, $enrol) {
$ldap_connection = $this->enrol_ldap_connect();
if (!$ldap_connection) {
@ldap_close($ldap_connection);
- error("LDAP-module cannot connect to server: $CFG->ldap_host_url");
+ notify("LDAP-module cannot connect to server: $CFG->ldap_host_url");
return false;
}
@@ -444,7 +444,7 @@ function enrol_ldap_connect(){
return $result;
} else {
- error("LDAP-module cannot connect to server: $CFG->enrol_ldap_host_url");
+ notify("LDAP-module cannot connect to server: $CFG->enrol_ldap_host_url");
return false;
}
}
@@ -458,14 +458,14 @@ function enrol_ldap_bind($ldap_connection){
if ( ! empty($CFG->enrol_ldap_bind_dn) ){
//bind with search-user
if (!ldap_bind($ldap_connection, $CFG->enrol_ldap_bind_dn,$CFG->enrol_ldap_bind_pw)){
- error("Error: could not bind ldap with ldap_bind_dn/pw");
+ notify("Error: could not bind ldap with ldap_bind_dn/pw");
return false;
}
} else {
//bind anonymously
if ( !ldap_bind($ldap_connection)){
- error("Error: could not bind ldap anonymously");
+ notify("Error: could not bind ldap anonymously");
return false;
}
}
@@ -615,7 +615,7 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){
add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "enrol/ldap auto-creation");
} else {
error_log("Could not create new course from LDAP from DN:" . $course_ext['dn']);
- error("Serious Error! Could not create the new course!");
+ notify("Serious Error! Could not create the new course!");
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.