Commit 36f9c92d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

When admins change site/institution theme, update immediately instead of waiting for next login

parent 104575a7
......@@ -241,7 +241,9 @@ function siteoptions_submit(Pieform $form, $values) {
$message = get_string('siteoptionsset', 'admin');
if ($oldtheme != $values['theme']) {
global $USER;
$message .= ' ' . get_string('usersseenewthemeonlogin', 'admin');
$USER->update_theme();
}
$form->reply(PIEFORM_OK, array('message' => $message, 'goto' => '/admin/site/options.php'));
}
......
......@@ -475,6 +475,7 @@ function institution_submit(Pieform $form, $values) {
$message = get_string('institutionupdatedsuccessfully', 'admin');
if (isset($values['theme']) && $oldtheme != $values['theme']
&& (!empty($oldtheme) || $values['theme'] != 'sitedefault')) {
$USER->update_theme();
$message .= ' ' . get_string('usersseenewthemeonlogin', 'admin');
}
$SESSION->add_ok_msg($message);
......
......@@ -1011,6 +1011,9 @@ class LiveUser extends User {
$this->reset_institutions();
}
public function update_theme() {
$this->reset_institutions();
$this->commit();
}
}
?>
......@@ -167,7 +167,7 @@ $string['trustedsites'] = 'Trusted sites';
$string['updatesiteoptions'] = 'Update site options';
$string['usersallowedmultipleinstitutions'] = 'Users allowed multiple institutions';
$string['usersallowedmultipleinstitutionsdescription'] = 'If checked, users can be members of several institutions at the same time';
$string['usersseenewthemeonlogin'] = 'Users will see the new theme the next time they log in.';
$string['usersseenewthemeonlogin'] = 'Other users will see the new theme the next time they log in.';
$string['viruschecking'] = 'Virus checking';
$string['viruscheckingdescription'] = 'If checked, virus checking will be enabled for all uploaded files using ClamAV';
$string['whocancreatepublicgroups'] = 'Who can create Public Groups';
......
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