Commit c340aa22 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols
Browse files

Prioritisation of per-institution themes

If a user is a member of multiple institutions, they would have typically
received the theme for the last institution (as returned in an unsorted
order from lib/user.php->load_user_institutions).

This patch introduces a check to determine the user's authentication
instance and the institution associated with that instance.
If a theme is set for that institution, this is used in priority.
Signed-off-by: default avatarAndrew Robert Nicols <>
parent 01c43b82
......@@ -656,6 +656,14 @@ class User {
$this->theme = $i->theme;
if ($this->authinstance) {
$authobj = AuthFactory::create($this->authinstance);
if (isset($institutions[$authobj->institution])) {
if ($t = $institutions[$authobj->institution]->theme) {
$this->theme = $t;
$this->institutions = $institutions;
$this->admininstitutions = $admininstitutions;
$this->staffinstitutions = $staffinstitutions;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment