MDL-15175: ensures cross-db: add a lowercase conversion for the username, merged from 19

This commit is contained in:
jerome
2008-08-14 09:53:19 +00:00
parent 7fa260c83c
commit f6fd87d97b
+3 -2
View File
@@ -173,7 +173,7 @@ class auth_plugin_db extends auth_plugin_base {
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 @@ class auth_plugin_db extends auth_plugin_base {
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);
}
}