User and context based themes

Revision as of 12:09, 1 July 2008 by Bartl3by (talk | contribs) (New page: = Introduction = Currently you cannot define user or context based themes within the Open-Xchange Server. For this reason we created a UI plug in that will disable all selectable themes i...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

Currently you cannot define user or context based themes within the Open-Xchange Server. For this reason we created a UI plug in that will disable all selectable themes in the User front end, so that the user cannot change his current theme. With this plug in the server would be able to set a theme for a user, and that theme cannot be changed by the user. This functionality is at least a workaround as long the function isn't offered officially by the Open-Xchange Server, and is currently experimental. Setting a configuration for a user is described in Adding a pre defined UWA widget for a User.

Setup description

$ vim /opt/open-xchange/etc/groupware/settings/disableUserThemeSelection.properties

modules/disableUserThemeSelection/enabled=true
$ vim /var/www/ox6/plugins/disableUserThemeSelection/register.js

/**
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License, Version 2 as published
 * by the Free Software Foundation.
 *
 * Copyright (C) 2004-2007 Open-Xchange, Inc.
 * Mail: info@open-xchange.com 
 * 
 * @author: Stefan Preuss <stefan.preuss@open-xchange.com>
 *
 */

/*
 * NOTE: THE WORK IS PROVIDED "AS IS," AND COMES WITH ABSOLUTELY NO WARRANTY, 
 * EXPRESS OR IMPLIED!
 */

var obj = {};
obj[configGetKey("gui.theme.path")] = configGetKey("gui.theme.name");
configSetKey("modules.themes", obj);
$ /etc/init.d/open-xchange-groupware restart

After you have setup the disableUserThemeSelection plug in has been enabled, the user cannot change his theme anymore. More he will only have the currently selected theme in his dropdownbox on the theme selection page.

Server set's theme for a user / context

A description of how the server can store settings for a user is described in the following article:

Adding a pre defined UWA widget for a User

Now you have to ensure that the server sets the correct theme on the user creation.