Author Topic: Plugin to override user settings?  (Read 1482 times)

Offline nullrequest

  • Newbie
  • *
  • Posts: 6
Plugin to override user settings?
« on: January 11, 2021, 08:24:23 PM »
I want to be able to enforce certain system-wide preferences for all uses, regardless off what they try to set for customized values.

I've tried putting entries into the config.inc.php , however, those don't seem to be permanently enforced but instead are initial default values.

Code: [Select]
//////////////////////////////////////////////
// ----------------------------------
// USER INTERFACE
// ----------------------------------
//
// 2021-01-09 - setup to force default sorts to speed up login delay
//
// default messages sort column. Use empty value for default server's sorting,
// or 'arrival', 'date', 'subject', 'from', 'to', 'fromto', 'size', 'cc'
$config['message_sort_col'] = '';

// default messages sort order
$config['message_sort_order'] = '';

Ultimately, I'm trying to automatically remove the custom column sorts users create because they cause login to my server to be extremely slow and cause the IMAP to unload all messages b/c it does not support the "SORT" command (see issue here). Ideally, this plugin would run at logout/login to remove custom sorting, significantly speeding up the login process.


Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Plugin to override user settings?
« Reply #1 on: January 12, 2021, 12:18:41 AM »
You can disabled UI actions in the config.
Code: [Select]
// List of disabled UI elements/actions
$config['disabled_actions'] = [];

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: Plugin to override user settings?
« Reply #2 on: January 12, 2021, 02:26:02 AM »
I think all you need is to add these options to dont_override list in config.

Offline nullrequest

  • Newbie
  • *
  • Posts: 6
Re: Plugin to override user settings?
« Reply #3 on: January 14, 2021, 07:11:36 PM »
Well, @alec - your suggestion works.  I was hoping to still allow sorting during the user's session and return the value to default at logout, but it's not a show-stopper.  With the following snippet in my config, users can't sort on any columns, but the login process is **WAY** faster than before, which is a much bigger deal than sorting!

Thanks for the suggestion!

Code: [Select]
//////////////////////////////////////////////
// ----------------------------------
// USER INTERFACE
// ----------------------------------
// default messages sort column. Use empty value for default server's sorting,
// or 'arrival', 'date', 'subject', 'from', 'to', 'fromto', 'size', 'cc'
$config['message_sort_col'] = '';

// default messages sort order
$config['message_sort_order'] = '';

$config['dont_override'] = array('message_sort_order','message_sort_col');