Author: sshyrkov
Date: Thu Jun  7 18:10:38 2007
New Revision: 17509

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17509&repname=
=3Djahia
Log:
CONE-31: Redirecting user to template on logout
Resolution: added logoutForwardUrl to the jahia.properties to be able to pe=
rform also the server-side forward (the redirect was supported by logoutRed=
irectUrl)

Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/logout/Log=
out_Engine.java
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/settings/SettingsB=
ean.java
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/config/jahia.s=
keleton

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/logo=
ut/Logout_Engine.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/engines/logout/Logout_Engine.java&rev=3D175=
09&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/logout/Log=
out_Engine.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/logout/Log=
out_Engine.java Thu Jun  7 18:10:38 2007
@@ -244,7 +244,24 @@
                         JahiaException.ERROR_SEVERITY);
             }
             return null;
-        }
+        } else if (jParams.settings().getLogoutForwardUrl() !=3D null) {
+                       try {
+                               bean.getRequest().getRequestDispatcher(
+                                               
jParams.settings().getLogoutForwardUrl()).forward(
+                                               bean.getRequest(), 
bean.getResponse());
+                               if (logger.isDebugEnabled())
+                                       logger.debug("Logout triggered forward 
to ["
+                                                       + 
jParams.settings().getLogoutForwardUrl() + "]");
+                       } catch (Exception e) {
+                               throw new JahiaException("Logout forward 
failed. Page: "
+                                               + jParams.getPageID(), "Error 
forwarding to ["
+                                               + 
jParams.settings().getLogoutForwardUrl() + "] from ["
+                                               + 
bean.getRequest().getRequestURL().toString() + "]",
+                                               
JahiaException.APPLICATION_ERROR,
+                                               JahiaException.ERROR_SEVERITY, 
e);
+                       }
+                       return null;
+               }
 =

         if (logoutPage =3D=3D null) {
             // current page do not have read

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/settings/Set=
tingsBean.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/settings/SettingsBean.java&rev=3D17509&repn=
ame=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/settings/SettingsB=
ean.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/settings/SettingsB=
ean.java Thu Jun  7 18:10:38 2007
@@ -254,6 +254,8 @@
 =

     // the (optional) url the user will be redirected after logout
     public String logoutRedirectUrl;
+    // The (optional) URL the user will be forwarded to after logout
+    public String logoutForwardUrl;
 =

     // this is the list of jahia.properties mail settings values...
     public String mail_server;
@@ -726,7 +728,9 @@
             jetspeedDeploymentDirectory =3D JahiaTools.convertContexted (g=
etString("jetspeedDeploymentDirectory", "$context/WEB-INF/deploy"), pathRes=
olver);
 =

             // the (optional) url the user will be redirected after logout
-            logoutRedirectUrl =3D getString("logoutRedirectUrl",null);
+            logoutRedirectUrl =3D getString("logoutRedirectUrl", null);
+            // the (optional) url the user will be forwarded to after logo=
ut
+            logoutForwardUrl =3D getString("logoutForwardUrl", null);
 =

             statisticsEnabled =3D getBoolean("statisticsEnabled", false);
             isSiteErrorEnabled =3D getBoolean("site.error.enabled",false);
@@ -1866,6 +1870,14 @@
         return logoutRedirectUrl;
     }
 =

+    /**
+     * Returns the (optional) URL user will be forwarded to after logout.
+     * @return the (optional) URL user will be forwarded to after logout
+     */
+    public String getLogoutForwardUrl() {
+        return logoutForwardUrl;
+    }
+
     public void setLogoutRedirectUrl(String logoutRedirectUrl) {
         this.logoutRedirectUrl =3D logoutRedirectUrl;
     }

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/config/j=
ahia.skeleton
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/WEB-INF/etc/config/jahia.skeleton&rev=3D17509&repna=
me=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/config/jahia.s=
keleton (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/config/jahia.s=
keleton Thu Jun  7 18:10:38 2007
@@ -589,6 +589,11 @@
 # to a URL of your choice
 #logoutRedirectUrl                                      =3D   http://www.a=
cme.com/logoff.php
 =

+# Uncomment this to perform a forward to the internal page or JSP (the URL=
 is context related) after user logout.
+# This parameter is mutually exclusive with the previous one (logoutRedire=
ctUrl).
+# It will be considered only if the previous one is not set.
+#logoutForwardUrl                                      =3D   /jsp/afterLog=
out.jsp
+
 ######################################################################
 ### Scheduler config  ################################################
 ######################################################################

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to