Permalink
Browse files

MDL-15175: ensures cross-db: add a lowercase conversion for the usern…

…ame, merged from 19
  • Loading branch information...
1 parent 7fa260c commit f6fd87d97b04c91f5dc89210c968abd64e95c016 jerome committed Aug 14, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 auth/db/auth.php
View
@@ -173,7 +173,7 @@ function get_userinfo($username) {
if ($rs = $authdb->Execute($sql)) {
if ( $rs->RecordCount() == 1 ) {
$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');
}
@@ -430,7 +430,8 @@ function get_userlist() {
print_error('auth_dbcantconnect','auth');
} else if ( $rs->RecordCount() ) {
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);
}
}

0 comments on commit f6fd87d

Please sign in to comment.