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:
+7
-4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user