Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
MDL-43415 auth_db: support textarea and uppercase fields
Browse files Browse the repository at this point in the history
  • Loading branch information
zbdd committed Feb 10, 2015
1 parent 4ad0d0f commit a6fe447
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion auth/db/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function get_userinfo($username) {
$fields_obj = $rs->FetchObj();
$fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER);
foreach ($selectfields as $localname=>$externalname) {
$result[$localname] = core_text::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8');
$result[$localname] = core_text::convert($fields_obj->{strtolower($localname)}, $this->config->extencoding, 'utf-8');
}
}
$rs->Close();
Expand Down Expand Up @@ -611,6 +611,10 @@ function user_update($olduser, $newuser) {
continue;
}
$nuvalue = $newuser->$key;
// Support for textarea fields.
if (isset($nuvalue['text'])) {
$nuvalue = $nuvalue['text'];
}
if ($nuvalue != $value) {
$update[] = $this->config->{"field_map_$key"}."='".$this->ext_addslashes(core_text::convert($nuvalue, 'utf-8', $this->config->extencoding))."'";
}
Expand Down

0 comments on commit a6fe447

Please sign in to comment.