Show Theme based on URL called


#1

Hey together,
we are using owncloud in our business for some years now to have a place to exchange data with clients and other businesses.
Now we have the need to have an owncloud instance for our sister company. Since we manage the whole IT for both companys, we had the idea to see if it's possible to have two active themes and have it decided from the URL called which theme is shown to the user:

Setup like following:

Nginx reverse Proxy -> redirects to Apache with owncloud when URL "https://www.businessA.com/cloud" is called, now we want to implement "https://www.businessB.com/cloud" redirects to the same Apache Server but to show another custom theme than the first call.

Is that possible? Can someone hint me which php or whatever files are responsible for the call to the Loginpage to have a look if i can figure it out?

Thanks in advance :slight_smile:


#2

One idea - no guarantees. Have two instances which use the same database and the same storage (need NFS/SMB or clustered storage for that of course). Have one theme file in one instance and the other theme file in the other one. Diferent design, but both will use the same data. Two subdomains, done.
Two theme's in the same ownCloud instance what be news to me.
Let me know if this works :wink:


#3

Got it working by adding "$theme = ($SERVER['HTTPHOST']=="www.myurlA.com")?"themeA":"themeB";" under "getTheme()" in owncloud/lib/private/utils.php

This is in version 9.0.5 and i saw in 9.1 this is in a folder named legacy. Won't survive any updates for sure, but works for now.

Was a long story to find the right php-file...thank god grep exists.