Roundcube Community Forum

 

Change logo based on login

Started by jeffshead, November 08, 2013, 02:58:57 AM

Previous topic - Next topic

techninja

I see. thank you,

i'll start working on that and will post a solution if i'm able to find one.

Kudalufi

Hope this topic isn't too old to resurrect.

I suspect if anyone comes along looking for a solution to this it will be easier, instead of trying to find a configuration setting or PHP function that will work, to instead use the roundcube database.

All you would need to do to accomplish this goal is a) create a skin for each login domain, and b) create an entry in the roundcube database for each user as you create the user that adds the configuration setting for that user's skin.  This is stored in the preferences column, which holds an array of all user preferences.  If you add the row for a user when that user is created, then you don't need to try and parse that array to add to it, you can just set it with your initial user defaults.  Like this, which sets the skin to "yourskin" and turns on the preview pane:
a:2:{s:4:"skin";s:8:"yourskin";s:12:"preview_pane";b:1;}

I, for one, use postfixadmin to create virtual domains, and the virtual domain admins use it to create users.  It has a wonderful capability to have user scripts that are executed after a user is created.  That can be used to insert the row into the roundcube automagically on user creation.

MarzuQnx

Hi, I managed to change the logo in login page but what I'am confusing it's not working in after login

what I do is by editing the skin template login.html :


<!-- <roundcube:object name="logo" src="/images/roundcube_logo.png" id="logo" /> -->

<roundcube:if condition="$_SERVER['HTTP_HOST'] == 'mail.domain-abc.co'" />
    <roundcube:object name="logo" src="/images/roundcube_logo.png" id="logo" />
<roundcube:elseif condition="$_SERVER['HTTP_HOST'] == 'domain-abc.co'" />
    <roundcube:object name="logo" src="/images/roundcube_logo.png" id="logo" />
<roundcube:else />
    <roundcube:object name="logo" src="/images/logo-other.png" id="logo" />
<roundcube:endif />



above code doesn't work on header.html.

:'(

Regards,
MarzuQnx

JohnDoh

I don't think you can use arbitrary PHP in Roundcube template conditions and in any case there is no need since the $config['skin_logo'] (as mentioned elsewhere in this thread) is the proper way of doing what you want.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

MarzuQnx

Quote from: JohnDoh on August 06, 2015, 10:55:22 AM
I don't think you can use arbitrary PHP in Roundcube template conditions and in any case there is no need since the $config['skin_logo'] (as mentioned elsewhere in this thread) is the proper way of doing what you want.

please guide me there mate, I already try $config['skin_logo'] and not yet succeed :)

Regards,

maniekandan5

Actually roundcube is very flexible to change many things. All the attributes are in the main config file to play over.

ref: https://vvcares.com/blog/post/how-to-change-roundcube-webmail-title-logo