Added new table called "user preferences" which can be used for

storing arbitrary preferences for each user.

Thanks to Jon Papaioannou for the first draft of this code
which I modified.
This commit is contained in:
moodler
2004-01-28 14:14:19 +00:00
parent ad7101a17b
commit 70812e39a0
7 changed files with 139 additions and 5 deletions
+7 -4
View File
@@ -933,10 +933,7 @@ function get_user_info_from_db($field, $value) {
}
if ($admins = get_records("user_admins", "userid", $user->id)) {
foreach ($admins as $admin) {
$user->admin = true;
break;
}
$user->admin = true;
}
if ($displays = get_records("course_display", "userid", $user->id)) {
@@ -952,6 +949,12 @@ function get_user_info_from_db($field, $value) {
}
}
if ($preferences = get_records('user_preferences', 'userid', $user->id)) {
foreach ($preferences as $preference) {
$user->preference[$preference->name] = $preference->value;
}
}
return $user;
}