Author: hansbak
Date: Wed Nov 24 09:55:16 2010
New Revision: 1038543
URL:
http://svn.apache.org/viewvc?rev=1038543&view=revLog:
add root condition for initial path and add multi tenant condition in the login screen of myportal
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=1038543&r1=1038542&r2=1038543&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Wed Nov 24 09:55:16 2010
@@ -291,8 +291,10 @@ public class ContextFilter implements Fi
// if the request path is a root mount then redirect to the initial path
if (UtilValidate.isNotEmpty(requestPath) && requestPath.equals(contextUri)) {
String initialPath = tenant.getString("initialPath");
- ((HttpServletResponse)response).sendRedirect(initialPath);
- return;
+ if (UtilValidate.isNotEmpty(initialPath) && !"/".equals(initialPath)) {
+ ((HttpServletResponse)response).sendRedirect(initialPath);
+ return;
+ }
}
// make that tenant active, setup a new delegator and a new dispatcher
Modified: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/login.ftl?rev=1038543&r1=1038542&r2=1038543&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/widget/login.ftl (original)
+++ ofbiz/trunk/specialpurpose/myportal/widget/login.ftl Wed Nov 24 09:55:16 2010
@@ -42,11 +42,15 @@ under the License.
<td class="label">${uiLabelMap.CommonPassword}</td>
<td><input type="password" name="PASSWORD" value="" size="20"/></td>
</tr>
- <#if ("Y" == useMultitenant)>
- <tr>
- <td class="label">${uiLabelMap.CommonTenantId}</td>
- <td><input type="text" name="tenantId" value="${parameters.tenantId?if_exists}" size="20"/></td>
- </tr>
+ <#if ("Y" == useMultitenant) >
+ <#if !requestAttributes.tenantId?exists>
+ <tr>
+ <td class="label">${uiLabelMap.CommonTenantId}</td>
+ <td><input type="text" name="tenantId" value="${parameters.tenantId?if_exists}" size="20"/></td>
+ </tr>
+ <#else>
+ <input type="hidden" name="tenantId" value="${requestAttributes.tenantId?if_exists}"/>
+ </#if>
</#if>
<tr>
<td colspan="2" align="center">