001
014
015 package com.liferay.portal.events;
016
017 import com.liferay.portal.kernel.events.Action;
018 import com.liferay.portal.kernel.events.ActionException;
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.util.PropsKeys;
022 import com.liferay.portal.kernel.util.StringPool;
023 import com.liferay.portal.kernel.util.Validator;
024 import com.liferay.portal.util.PortalUtil;
025 import com.liferay.portal.util.PrefsPropsUtil;
026 import com.liferay.portal.util.WebKeys;
027
028 import javax.servlet.http.HttpServletRequest;
029 import javax.servlet.http.HttpServletResponse;
030
031
034 public class DefaultLogoutPageAction extends Action {
035
036 @Override
037 public void run(HttpServletRequest request, HttpServletResponse response)
038 throws ActionException {
039
040 try {
041 doRun(request, response);
042 }
043 catch (Exception e) {
044 throw new ActionException(e);
045 }
046 }
047
048 protected void doRun(
049 HttpServletRequest request, HttpServletResponse response)
050 throws Exception {
051
052 long companyId = PortalUtil.getCompanyId(request);
053
054 String path = PrefsPropsUtil.getString(
055 companyId, PropsKeys.DEFAULT_LOGOUT_PAGE_PATH);
056
057 if (_log.isInfoEnabled()) {
058 _log.info(
059 PropsKeys.DEFAULT_LOGOUT_PAGE_PATH + StringPool.EQUAL + path);
060 }
061
062 if (Validator.isNotNull(path)) {
063 request.setAttribute(WebKeys.REFERER, path);
064 }
065
066
067
068
069
070
071
078 }
079
080 private static Log _log = LogFactoryUtil.getLog(
081 DefaultLogoutPageAction.class);
082
083 }