Permalink
Browse files

auth/db: fix fields not read from external database MDL-7712

  • Loading branch information...
1 parent acdd790 commit de6e7ee2a9b9aa4d5ef8a457b71195fb54489b65 martinlanghoff committed Jan 15, 2007
Showing with 3 additions and 3 deletions.
  1. +3 −3 auth/db/auth.php
View
@@ -121,13 +121,13 @@ function get_userinfo($username) {
foreach ($fields as $field) {
if ($this->config->{'field_map_' . $field}) {
- if ($rs = $authdb->Execute("SELECT " . $this->config->{'field_map_' . $field} . " FROM {$this->config->table}
+ if ($rs = $authdb->Execute("SELECT " . $this->config->{'field_map_' . $field} . " as myfield FROM {$this->config->table}
WHERE {$this->config->fielduser} = '$username'")) {
if ( $rs->RecordCount() == 1 ) {
if (!empty($CFG->unicodedb)) {
- $result["$field"] = addslashes(stripslashes($rs->fields[0]));
+ $result["$field"] = addslashes(stripslashes($rs->fields['myfield']));
} else {
- $result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields[0])));
+ $result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields['myfield'])));
}
}
}

0 comments on commit de6e7ee

Please sign in to comment.