1
API Based Plugins / Re: Alter config in startup
« Last post by SKaero on May 17, 2024, 01:30:17 PM »Maybe try the config_get hook https://github.com/roundcube/roundcubemail/wiki/Plugin-Hooks#config_get
<roundcube:object name="productname">
<roundcube:var name="config:product_name">
public function init()
{
$this->add_hook('startup', [$this, 'bootstrap']);
}
public function bootstrap($args)
{
Brand::init();
$rcMail = rcmail::get_instance();
$rcMail->config->set('product_name', Brand::getMeta('siteName'));
}
add_hook
and all logic inside of an onload()
method - but I haven't found any success yet. Anybody have any thoughts/tips?<?php
$prefs['_GLOBAL']['suppress_version_warning'] = false;
$prefs['_GLOBAL']['sync_collection_workaround'] = false;
$domain = getenv('HTTP_HOST');
if( empty($domain) ) $domain = getenv('DOMAIN');
// Figure out the expected formatting based on username
$userName = (string) $_SERVER['_RCUBE'];
$userFormat = (string) '%l@%d';
if( strpos($userName, '/') === false) {
$userFormat = '%l';
}
$prefs['cPCardDAV'] = array(
'name' => 'cPanel CardDAV',
'username' => $userFormat,
'password' => '%p',
'url' => 'https://' . $domain . ':2080/addressbooks/' . $userFormat . '/addressbook/',
'active' => true,
'fixed' => array( 'name', 'username', 'password' ),
'hide' => false,
);
?>
$prefs['_GLOBAL']['suppress_version_warning'] = false;
$prefs['_GLOBAL']['sync_collection_workaround'] = false;
if(file_exists('/var/cpanel/calendarserver')) {
$domain = getenv('HTTP_HOST');
if( empty($domain) ) $domain = getenv('DOMAIN');
// Figure out the expected formatting based on username
$userName = (string) $_SERVER['_RCUBE'];
$userFormat = (string) '%l@%d';
if( strpos($userName, '/') === false) {
$userFormat = '%l';
}
$prefs['cPCardDAV'] = array(
'name' => 'cPanel CardDAV',
'username' => $userFormat,
'password' => '%p',
'url' => 'https://' . $domain . ':2080/addressbooks/' . $userFormat . '/addressbook/',
'active' => true,
'fixed' => array( 'name', 'username', 'password' ),
'hide' => false,
);
}
if(file_exists('/var/cpanel/calendarserver')) {