Author Topic: Help with roundcube:object/ force user to use only one skin  (Read 14476 times)

Offline BandonRandon

  • Newbie
  • *
  • Posts: 6
Help with roundcube:object/ force user to use only one skin
« on: January 28, 2009, 05:04:16 PM »
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:
Code: [Select]
<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

Offline Yann

  • Jr. Member
  • **
  • Posts: 46
Help with roundcube:object/ force user to use only one skin
« Reply #1 on: January 28, 2009, 05:24:29 PM »
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?

Offline BandonRandon

  • Newbie
  • *
  • Posts: 6
Help with roundcube:object/ force user to use only one skin
« Reply #2 on: January 28, 2009, 05:35:51 PM »
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

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Help with roundcube:object/ force user to use only one skin
« Reply #3 on: January 29, 2009, 12:26:20 AM »
./config/main.inc.php
Code: [Select]

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

Offline BandonRandon

  • Newbie
  • *
  • Posts: 6
Help with roundcube:object/ force user to use only one skin
« Reply #4 on: January 29, 2009, 12:41:29 AM »
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

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Help with roundcube:object/ force user to use only one skin
« Reply #5 on: January 29, 2009, 12:47:14 AM »
Code: [Select]

/***** 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 ...

Code: [Select]

/* 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
__________________
MyRoundcube Project (commercial)

Offline BandonRandon

  • Newbie
  • *
  • Posts: 6
Thanks!
« Reply #6 on: January 29, 2009, 12:51:22 AM »
Thanks rosali! Makes since now!

Offline egrogg

  • Jr. Member
  • **
  • Posts: 12
force user to use one skin: how to add user?
« Reply #7 on: November 06, 2011, 02:43:35 PM »
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
Code: [Select]

/***** 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 ...

Code: [Select]

/* 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.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Help with roundcube:object/ force user to use only one skin
« Reply #8 on: November 06, 2011, 04:52:29 PM »
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
__________________
MyRoundcube Project (commercial)

Offline egrogg

  • Jr. Member
  • **
  • Posts: 12
Help with roundcube:object/ force user to use only one skin
« Reply #9 on: November 07, 2011, 08:35:00 AM »
Yes...I have one user I would like to have access to all things...but not just general users...

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Help with roundcube:object/ force user to use only one skin
« Reply #10 on: November 07, 2011, 08:48:38 AM »
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
__________________
MyRoundcube Project (commercial)

Offline egrogg

  • Jr. Member
  • **
  • Posts: 12
Help with roundcube:object/ force user to use only one skin
« Reply #11 on: November 07, 2011, 08:56:34 AM »
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