Roundcube Community Forum

 

Help with roundcube:object/ force user to use only one skin

Started by BandonRandon, January 28, 2009, 05:04:16 PM

Previous topic - Next topic

BandonRandon

Hello,
I am pretty new  to round cube. I am pretty familiar with php and sql. However i  can't seam to find the file i need to modify in order to remove the "interface skin" option from the general prefrances. I would like to disable the user from even having the options between choosing skins. A solution would be to only have one skin and make that the default but i would not like to do this.

In the settings.html template i see where the following code gets the 3 parts of settings: <roundcube:object name=&quot;userprefs&quot; form=&quot;form&quot; parts=&quot;general,mailbox,mailview&quot; />

i can remove general from this but that deletes all settings under "User Interface" i would like to remove just the interface skin option. I also found the file where it writes the skin to the database (steps/settings/save_prefs.inc) for the user but couldn't find where i could disable the interface skin option in this file. Sure i could disable the setting from being inserted into the database but that's a bad idea.

Any help on how the parts and templates work would be great.

Thanks,
Brandon

Yann

I think if you have only one skin uploaded and change the default skin with whatever skin you wannt to use in config/main.inc.php ($rcmail_config['skin'] = 'default'; ) the users will not have the option to choose a skin. That means "Interface Skin" won't show up at all in preferences. Give it a try, by the way which version of RC are you using?

BandonRandon

Thanks Yann,

I'm pretty sure your solution would work as well however i want to be able to keep 2 skins in the skin folder but not let the end user choose between them. Any Ideas?

BTW we are using  v0.2-stable

rosali

./config/main.inc.php

/* Do not allow override template on a per user level */
$rcmail_config['dont_override'][] = 'skin';
Regards,
Rosali

BandonRandon

rosali,

Thanks that worked great! Although i love being able to get support in the fourms my only question is is this documented somewhere or what does this code do other than not allow the user to override the skin?

If you have time to explain that would be great!

Brandon

rosali


/***** these settings can be overwritten by user's preferences *****/

// skin name: folder from skins/
$rcmail_config['skin'] = 'api';

// show up to X items in list view
$rcmail_config['pagesize'] = 40;

// use this timezone to display date/time
$rcmail_config['timezone'] = 'auto';

// is daylight saving On?
$rcmail_config['dst_active'] = (bool)date('I');

// prefer displaying HTML messages
$rcmail_config['prefer_html'] = TRUE;

// display remote inline images  
// 0 - Never, always ask  
// 1 - Ask if sender is not in address book  
// 2 - Always show inline images  
$rcmail_config['show_images'] = 0;  

// compose html formatted messages by default
$rcmail_config['htmleditor'] = FALSE;

// show pretty dates as standard
$rcmail_config['prettydate'] = TRUE;

// save compose message every 300 seconds (5min)
$rcmail_config['draft_autosave'] = 300;

// default setting if preview pane is enabled
$rcmail_config['preview_pane'] = TRUE;

// Clear Trash on logout
$rcmail_config['logout_purge'] = FALSE;

// Compact INBOX on logout
$rcmail_config['logout_expunge'] = FALSE;

// Display attached images below the message body
$rcmail_config['inline_images'] = TRUE;

// If true all folders will be checked for recent messages  
$rcmail_config['check_all_folders'] = FALSE;  


... unless you disallow overriding by ...


/* Do not allow override template on a per user level */
$rcmail_config['dont_override'][] = 'skin';
/* Do not allow override default setting of preview pane */
$rcmail_config['dont_override'][] = 'preview_pane';

etc.


OK? You understand? If you add a key of the rcmail_config array as value of the array rcmail_config['dont_override'] then overriding the default setting on a per user level is disabled.
Regards,
Rosali

BandonRandon

Thanks rosali! Makes since now!

egrogg

I followed the below, but got to thinking...how can I add a certain user that only has the ability to modify settings?

// don't allow these settings to be overriden by the user
$rcmail_config['dont_override'][] = 'skin';

/* Do not allow override default setting of preview pane */
$rcmail_config['dont_override'][] = 'preview_pane';


// don't allow these settings to be overriden by the user
//$rcmail_config['dont_override'] = array();
// Set identities access level:
// 0 - many identities with possibility to edit all params
// 1 - many identities with possibility to edit all params but not email address
// 2 - one identity with possibility to edit all params
// 3 - one identity with possibility to edit all params but not email address
//$rcmail_config['identities_level'] = 2;







Quote from: rosali;16754
/***** these settings can be overwritten by user's preferences *****/

// skin name: folder from skins/
$rcmail_config['skin'] = 'api';

// show up to X items in list view
$rcmail_config['pagesize'] = 40;

// use this timezone to display date/time
$rcmail_config['timezone'] = 'auto';

// is daylight saving On?
$rcmail_config['dst_active'] = (bool)date('I');

// prefer displaying HTML messages
$rcmail_config['prefer_html'] = TRUE;

// display remote inline images  
// 0 - Never, always ask  
// 1 - Ask if sender is not in address book  
// 2 - Always show inline images  
$rcmail_config['show_images'] = 0;  

// compose html formatted messages by default
$rcmail_config['htmleditor'] = FALSE;

// show pretty dates as standard
$rcmail_config['prettydate'] = TRUE;

// save compose message every 300 seconds (5min)
$rcmail_config['draft_autosave'] = 300;

// default setting if preview pane is enabled
$rcmail_config['preview_pane'] = TRUE;

// Clear Trash on logout
$rcmail_config['logout_purge'] = FALSE;

// Compact INBOX on logout
$rcmail_config['logout_expunge'] = FALSE;

// Display attached images below the message body
$rcmail_config['inline_images'] = TRUE;

// If true all folders will be checked for recent messages  
$rcmail_config['check_all_folders'] = FALSE;  


... unless you disallow overriding by ...


/* Do not allow override template on a per user level */
$rcmail_config['dont_override'][] = 'skin';
/* Do not allow override default setting of preview pane */
$rcmail_config['dont_override'][] = 'preview_pane';

etc.


OK? You understand? If you add a key of the rcmail_config array as value of the array rcmail_config['dont_override'] then overriding the default setting on a per user level is disabled.

rosali

I don't understand what you are thinking about.

Do you want to have a certain user who is able to change the skin settings (f.e.) and other users are not?
Regards,
Rosali

egrogg

Yes...I have one user I would like to have access to all things...but not just general users...

rosali

I think this is only possible by a plugin. I have no need for such a plugin. If you don't have the skills to code it yourself, you may want to ask at devs list (Roundcube - Mailing Lists).
Regards,
Rosali

egrogg

OK...if no one else has a particular answer then I guess I will look up getting a plugin...

Thanks for the quick reply!

Ernest