[imp] Removing "whitelist" and "blacklist" menu items
Michael M Slusarz
slusarz at horde.org
Tue Aug 12 17:10:17 UTC 2014
Quoting Brett Charbeneau <brett at wrl.org>:
>> Michael Slusarz [slusarz <at> horde.org]: This is the correct
>> way of disabling (except changes should be made in
>> registry.local.php).
>
>
> I'm grateful for the response! And please excuse my ignorance of PHP...
> I've added
>
> $_prefs['blacklist']['Locked'] = true;
> $_prefs['whitelist']['Locked'] = true;
>
> to registry.local.php, and it does seem to disable them for the
> user, but the preference would be to have this menu item not appear
> at all.
> I tried additionally adding the chunk of code below as well, but
> I keep getting syntax errors - is this the correct approach to
> remove the "Blacklist" and "Whitelist" links from all menus?
>
> 'ingo' => array(
> 'name' => _("Filters"),
> 'provides' => array(
> 'filter',
> 'mail/applyFilters',
> 'mail/canApplyFilters',
> 'mail/showFilters'
> ),
> 'menu_parent' => 'imp'
> ),
In registry.local.php, this will remove blacklist and whitelist and
ensure that any additions to 'provides' in the future is automatically
added without further admin intervention:
$this->applications['ingo']['provides'] = array_diff(
$this->applications['ingo']['provides'],
array(
'mail/blacklistFrom',
'mail/showBlacklist',
'mail/whitelistFrom',
'mail/showWhitelist'
)
);
Unfortunately, the 'provides' parameter isn't as clean to work via
registry.local.php since it only contains hash values and no defined
hash keys, so the PHP needs to be a bit more advanced (this is a
historical remnant since this is the way registry.php was before we
switched to *.local.php files).
michael
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the imp
mailing list