--- /dev/null
+<%--\r
+/**\r
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.\r
+ *\r
+ * This library is free software; you can redistribute it and/or modify it under\r
+ * the terms of the GNU Lesser General Public License as published by the Free\r
+ * Software Foundation; either version 2.1 of the License, or (at your option)\r
+ * any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful, but WITHOUT\r
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\r
+ * details.\r
+ */\r
+--%>\r
+\r
+<c:if test="<%= themeDisplay.isSignedIn() && !PropsValues.SESSION_DISABLED %>">\r
+\r
+ <%\r
+ String autoRememberMe = CookieKeys.getCookie(request, CookieKeys.REMEMBER_ME);\r
+ %>\r
+\r
+ <c:if test="<%= Validator.isNull(autoRememberMe) %>">\r
+\r
+ <%\r
+ int sessionTimeout = PropsValues.SESSION_TIMEOUT;\r
+ int sessionTimeoutMinute = sessionTimeout * (int)Time.MINUTE;\r
+ int sessionTimeoutWarning = PropsValues.SESSION_TIMEOUT_WARNING;\r
+ int sessionTimeoutWarningMinute = sessionTimeoutWarning * (int)Time.MINUTE;\r
+ int timeoutDiff = (sessionTimeout - sessionTimeoutWarning) * (int)Time.MINUTE;\r
+\r
+ boolean sessionRedirectOnExpire = PropsValues.SESSION_TIMEOUT_REDIRECT_ON_EXPIRE;\r
+ String sessionRedirectUrl = themeDisplay.getURLHome();\r
+\r
+ long companyId = themeDisplay.getCompanyId();\r
+\r
+ if (PrefsPropsUtil.getBoolean(companyId, PropsKeys.CAS_AUTH_ENABLED, PropsValues.CAS_AUTH_ENABLED) && PropsValues.CAS_LOGOUT_ON_SESSION_EXPIRATION) {\r
+ sessionRedirectOnExpire = true;\r
+ sessionRedirectUrl = PrefsPropsUtil.getString(companyId, PropsKeys.CAS_LOGOUT_URL, PropsValues.CAS_LOGOUT_URL);\r
+ }\r
+ else if (PrefsPropsUtil.getBoolean(companyId, PropsKeys.OPEN_SSO_AUTH_ENABLED, PropsValues.OPEN_SSO_AUTH_ENABLED) && PropsValues.OPEN_SSO_LOGOUT_ON_SESSION_EXPIRATION) {\r
+ sessionRedirectOnExpire = true;\r
+ sessionRedirectUrl = PrefsPropsUtil.getString(companyId, PropsKeys.OPEN_SSO_LOGOUT_URL, PropsValues.OPEN_SSO_LOGOUT_URL);\r
+ }\r
+\r
+ Calendar sessionTimeoutCal = CalendarFactoryUtil.getCalendar(timeZone);\r
+\r
+ sessionTimeoutCal.add(Calendar.MILLISECOND, sessionTimeoutMinute);\r
+ %>\r
+\r
+ <c:if test="<%= sessionTimeoutWarning > 0 %>">\r
+ <aui:script use="liferay-session">\r
+ Liferay.Session = new Liferay.SessionBase(\r
+ {\r
+ autoExtend: <%= PropsValues.SESSION_TIMEOUT_AUTO_EXTEND %>,\r
+ sessionLength: <%= sessionTimeout %>,\r
+ redirectOnExpire: <%= sessionRedirectOnExpire %>,\r
+ redirectUrl: '<%= sessionRedirectUrl %>',\r
+ warningLength: <%= sessionTimeoutWarning %>\r
+ }\r
+ );\r
+\r
+ Liferay.Session.plug(Liferay.SessionDisplay);\r
+ </aui:script>\r
+ </c:if>\r
+ </c:if>\r
+</c:if>
\ No newline at end of file