From de6e7ee2a9b9aa4d5ef8a457b71195fb54489b65 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Mon, 15 Jan 2007 19:53:26 +0000 Subject: [PATCH] auth/db: fix fields not read from external database MDL-7712 --- auth/db/auth.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth/db/auth.php b/auth/db/auth.php index 0025d0d917..124f5f0cc9 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -121,13 +121,13 @@ class auth_plugin_db { 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']))); } } } -- 2.39.5