Author Topic: Change logo based on login  (Read 35745 times)

Offline techninja

  • Newbie
  • *
  • Posts: 5
Re: Change logo based on login
« Reply #15 on: October 31, 2014, 02:25:41 PM »
I see. thank you,

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

Offline Kudalufi

  • Newbie
  • *
  • Posts: 3
Re: Change logo based on login
« Reply #16 on: May 30, 2015, 12:26:20 PM »
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:
Code: [Select]
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.

Offline MarzuQnx

  • Newbie
  • *
  • Posts: 6
Re: Change logo based on login
« Reply #17 on: August 06, 2015, 09:55:54 AM »
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 :

Code: [Select]
<!-- <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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Change logo based on login
« Reply #18 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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline MarzuQnx

  • Newbie
  • *
  • Posts: 6
Re: Change logo based on login
« Reply #19 on: August 06, 2015, 10:52:21 PM »
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,

Offline maniekandan5

  • Newbie
  • *
  • Posts: 4
Re: Change logo based on login
« Reply #20 on: May 30, 2020, 12:07:04 AM »
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