user/edit: Better error handling when loading auth libs.

Check with empty() to avoid casting the string to int, and provide
useful info in the debug log.

Merged from MOODLE_15_STABLE
This commit is contained in:
martinlanghoff
2005-11-07 00:55:10 +00:00
parent 85523834e7
commit 068cdffd11
+2 -1
View File
@@ -57,9 +57,10 @@
// load the relevant auth libraries
if ($user->auth) {
if (!empty($user->auth)) {
$auth = $user->auth;
if (!file_exists("$CFG->dirroot/auth/$auth/lib.php")) {
trigger_error("Can't find auth module $auth , default to internal.");
$auth = "manual"; // Can't find auth module, default to internal
}
require_once("$CFG->dirroot/auth/$auth/lib.php");