<div dir="ltr">I found the following problem and wondering how to best to solve it in a multi-site environment:<div><br></div><div style>I want to show the currently logged in user as follows:</div><div style>Let's say I'm logged in to the OpenCms workplace as 'Admin' user, then the following line</div>
<div style><br></div><div style><font face="courier new, monospace">cmsObject.getGroupsOfUser(cmsObject.getRequestContext().currentUser().getName()</font><br></div><div style><br></div><div style>should output "Admin".</div>
<div style><br></div><div style>This works fine in BOTH online and offline project under the condition that the workplace hostname and the site hostname is identical.</div><div style>Such as it is the case with hostname1/siteA in the site configuration below.</div>
<div><br></div><div><div><font face="courier new, monospace"><sites></font></div><div><font face="courier new, monospace"> <workplace-server><a href="http://hostname1:8080">http://hostname1:8080</a></workplace-server></font></div>
<div><font face="courier new, monospace"> <default-uri>/sites/siteA/</default-uri> </font></div><div><font face="courier new, monospace"> <site server="<a href="http://hostname1:8080">http://hostname1:8080</a>" uri="/sites/siteA/"/></font></div>
<div><font face="courier new, monospace"> <site server="<a href="http://hostname2:8080">http://hostname2:8080</a>" uri="/sites/siteB/"/> </font></div></div><div><font face="courier new, monospace"></sites><br>
</font></div><div><br></div><div style>However, it does NOT work in BOTH offline and online project for hostname2/siteB: when in the offline project, I am correctly getting 'Admin" as the logged in user, but when I switch to online project, the current user is identified as 'Guest'.</div>
<div style><br></div><div style>Therefore I am wondering how it's possible to test offline and online project with user related data in a multi-site configuration as above - in my example for hostname2 / siteB.</div><div style>
<br></div><div style>I can only assign one hostname for the workplace server, and using the IP address also doesn't work.</div><div style><br></div><div style>Would the only possible way be to provide a custom login form in the site frontend under the site folder somewhere? As the workplace login seems to have no meaning for sites which hostnames don't match the workplace hostname.</div>
<div style><br></div><div style>Thanks,</div><div style>Mathias</div><div style><br></div></div>