Skip to content
Browse files

A little fix to workaround what seems to be an ADOdb bug when using

database authentication
  • Loading branch information...
1 parent 57b0a28 commit a657c48b962cdeb0f526cdc73423ea1f1300cca8 moodler committed Jan 6, 2003
Showing with 8 additions and 0 deletions.
  1. +8 −0 auth/db/lib.php
View
8 auth/db/lib.php
@@ -8,6 +8,13 @@ function auth_user_login ($username, $password) {
global $CFG;
+ // This is a hack to workaround what seems to be a bug in ADOdb with accessing
+ // two databases of the same kind ... it seems to get confused when trying to access
+ // the first database again, after having accessed the second.
+ // The following hack will make the database explicit which keeps it happy
+ $CFG->prefix = "$CFG->dbname.$CFG->prefix";
+
+ // Connect to the external database
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
@@ -38,6 +45,7 @@ function auth_get_userinfo($username){
// then returns it in an array
global $CFG;
+
$config = (array) $CFG;
ADOLoadCode($CFG->auth_dbtype);

0 comments on commit a657c48

Please sign in to comment.
Something went wrong with that request. Please try again.