From 36cf4a27deb3b0f18a53cac44a67797926166262 Mon Sep 17 00:00:00 2001 From: jerome Date: Thu, 14 Aug 2008 09:44:13 +0000 Subject: [PATCH] MDL-15175: ensures cross-db: add a lowercase conversion for the username --- auth/db/auth.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auth/db/auth.php b/auth/db/auth.php index 9690633f19c..44d59e90a1e 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -176,7 +176,7 @@ class auth_plugin_db extends auth_plugin_base { if ($rs = $authdb->Execute($sql)) { if ( !$rs->EOF ) { $fields_obj = rs_fetch_record($rs); - $fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER); + $fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER); foreach ($selectfields as $localname=>$externalname) { $result[$localname] = $textlib->convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8'); } @@ -422,7 +422,8 @@ class auth_plugin_db extends auth_plugin_base { print_error('auth_dbcantconnect','auth'); } else if ( !$rs->EOF ) { while ($rec = rs_fetch_next_record($rs)) { - array_push($result, $rec->USERNAME); + $rec = (object)array_change_key_case((array)$rec , CASE_LOWER); + array_push($result, $rec->username); } }