Advertisement
Guest User

zimbra

a guest
Jul 13th, 2018
1,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.89 KB | None | 0 0
  1. <%@ page buffer="8kb" autoFlush="true" %>
  2. <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
  3. <%@ page session="false" %>
  4. <%@ page import="com.zimbra.cs.taglib.ZJspSession"%>
  5. <%@ taglib prefix="zm" uri="com.zimbra.zm" %>
  6. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  7. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  8. <%@ taglib prefix="fmt" uri="com.zimbra.i18n" %>
  9. <%@ taglib prefix="app" uri="com.zimbra.htmlclient" %>
  10. <%-- this checks and redirects to admin if need be --%>
  11. <zm:adminRedirect/>
  12. <app:skinAndRedirect />
  13. <fmt:setLocale value='${pageContext.request.locale}' scope='request' />
  14. <fmt:setBundle basename="/messages/ZmMsg" scope="request"/>
  15. <fmt:setBundle basename="/messages/ZhMsg" var="zhmsg" scope="request"/>
  16. <fmt:setBundle basename="/messages/ZMsg" var="zmsg" scope="request"/>
  17.  
  18. <%-- query params to ignore when constructing form port url or redirect url --%>
  19. <c:set var="ignoredQueryParams" value=",loginOp,loginNewPassword,totpcode,loginConfirmNewPassword,loginErrorCode,username,email,password,zrememberme,ztrusteddevice,zlastserver,client,"/>
  20.  
  21. <%-- get useragent --%>
  22. <zm:getUserAgent var="ua" session="false"/>
  23. <c:set var="touchSupported" value="${ua.isIos6_0up or ua.isAndroid4_0up}"/>
  24. <c:set var="mobileSupported" value="${ua.isMobile && ((ua.isOsWindows && (ua.isWindowsPhone || not ua.isWindowsNT))
  25. || (ua.isOsBlackBerry)
  26. || (ua.isOsAndroid && not ua.isAndroid4_0up)
  27. || (ua.isIos && not ua.isIos6_0up))}"/>
  28. <c:set var="totpAuthRequired" value="false"/>
  29. <c:set var="trimmedUserName" value="${fn:trim(param.username)}"/>
  30. <%--'virtualacctdomain' param is set only for external virtual accounts--%>
  31. <c:if test="${not empty param.username and not empty param.virtualacctdomain}">
  32. <%--External login email address are mapped to internal virtual account--%>
  33. <c:set var="trimmedUserName" value="${fn:replace(param.username,'@' ,'.')}@${param.virtualacctdomain}"/>
  34. </c:if>
  35.  
  36. <c:if test="${not empty trimmedUserName}">
  37. <c:choose>
  38. <c:when test="${(fn:indexOf(trimmedUserName,'@') == -1) and !(empty param.customerDomain)}">
  39. <c:set var="fullUserName" value="${trimmedUserName}@${param.customerDomain}"/>
  40. </c:when>
  41. <c:otherwise>
  42. <c:set var="fullUserName" value="${trimmedUserName}"/>
  43. </c:otherwise>
  44. </c:choose>
  45. </c:if>
  46.  
  47. <c:if test="${param.loginOp eq 'relogin' and empty loginException}">
  48. <zm:logout/>
  49. </c:if>
  50. <c:if test="${param.loginOp eq 'relogin' and not empty loginException}">
  51. <zm:getException var="error" exception="${loginException}"/>
  52. <c:if test="${error.code eq 'service.AUTH_EXPIRED'}">
  53. <c:set var="errorCode" value="${error.code}"/>
  54. <fmt:message bundle="${zmsg}" var="errorMessage" key="${errorCode}"/>
  55. <zm:logout/>
  56. </c:if>
  57. </c:if>
  58.  
  59. <%
  60. // Touch client exists only in network edition
  61.  
  62. Boolean touchLoginPageExists = (Boolean) application.getAttribute("touchLoginPageExists");
  63. if(touchLoginPageExists == null) {
  64. try {
  65. touchLoginPageExists = new java.io.File(application.getRealPath("/public/loginTouch.jsp")).exists();
  66. } catch (Exception ignored) {
  67. // Just in case there's anException
  68. touchLoginPageExists = true;
  69. }
  70. application.setAttribute("touchLoginPageExists", touchLoginPageExists);
  71. }
  72. //Fetch the IP address of the client
  73. String remoteAddr = ZJspSession.getRemoteAddr(pageContext);
  74. pageContext.setAttribute("remoteAddr", remoteAddr);
  75. %>
  76. <c:set var="touchLoginPageExists" value="<%=touchLoginPageExists%>"/>
  77.  
  78. <c:catch var="loginException">
  79. <c:choose>
  80. <c:when test="${(not empty param.loginNewPassword or not empty param.loginConfirmNewPassword) and (param.loginNewPassword ne param.loginConfirmNewPassword)}">
  81. <c:set var="errorCode" value="errorPassChange"/>
  82. <fmt:message var="errorMessage" key="bothNewPasswordsMustMatch"/>
  83. </c:when>
  84. <c:when test="${param.loginOp eq 'relogin' and not empty param.loginErrorCode}">
  85. <zm:logout/>
  86. <c:set var="errorCode" value="${param.loginErrorCode}"/>
  87. <fmt:message bundle="${zmsg}" var="errorMessage" key="${errorCode}"/>
  88. </c:when>
  89. <c:when test="${param.loginOp eq 'logout'}">
  90. <zm:getDomainInfo var="domainInfo" by="virtualHostname" value="${zm:getServerName(pageContext)}"/>
  91. <c:set var="logoutRedirectUrl" value="${domainInfo.attrs.zimbraWebClientLogoutURL}" />
  92. <c:set var="isAllowedUA" value="${zm:isAllowedUA(ua, domainInfo.webClientLogoutURLAllowedUA)}"/>
  93. <c:set var="isAllowedIP" value="${zm:isAllowedIP(remoteAddr, domainInfo.webClientLogoutURLAllowedIP)}"/>
  94. <c:choose>
  95. <c:when test="${not empty logoutRedirectUrl and (isAllowedUA eq true) and (isAllowedIP eq true) and (empty param.virtualacctdomain) and (empty virtualacctdomain)}">
  96. <zm:logout/>
  97. <c:redirect url="${logoutRedirectUrl}"/>
  98. </c:when>
  99. <c:when test="${touchSupported and touchLoginPageExists and (empty param.client or param.client eq 'touch') and
  100. (empty param.virtualacctdomain) and (empty virtualacctdomain)}">
  101. <%--Redirect to loginTouch only if the device supports touch client, the touch login page exists
  102. and the user has not specified the client param as "mobile" or anything else.--%>
  103. <jsp:forward page="/public/loginTouch.jsp"/>
  104. </c:when>
  105. <c:otherwise>
  106. <zm:logout/>
  107. </c:otherwise>
  108. </c:choose>
  109. </c:when>
  110. <c:when test="${(param.loginOp eq 'login') && !(empty fullUserName) && !(empty param.password) && (pageContext.request.method eq 'POST')}">
  111. <c:choose>
  112. <c:when test="${!empty cookie.ZM_TEST}">
  113. <zm:login username="${fullUserName}" password="${param.password}" varRedirectUrl="postLoginUrl"
  114. varAuthResult="authResult"
  115. newpassword="${param.loginNewPassword}" rememberme="${param.zrememberme == '1'}"
  116. trustedDeviceToken="${cookie.ZM_TRUST_TOKEN.value}"
  117. requestedSkin="${param.skin}" importData="true" csrfTokenSecured="true"/>
  118. <%-- continue on at not empty authResult test --%>
  119. </c:when>
  120. <c:otherwise>
  121. <c:set var="errorCode" value="noCookies"/>
  122. <fmt:message var="errorMessage" key="errorCookiesDisabled"/>
  123. </c:otherwise>
  124. </c:choose>
  125. </c:when>
  126. <c:otherwise>
  127. <%-- try and use existing cookie if possible --%>
  128. <c:set var="authtoken" value="${not empty param.zauthtoken ? param.zauthtoken : cookie.ZM_AUTH_TOKEN.value}"/>
  129. <c:if test="${not empty authtoken}">
  130. <zm:login authtoken="${authtoken}" authtokenInUrl="${not empty param.zauthtoken}" twoFactorCode="${not empty param.totpcode ? param.totpcode : ''}"
  131. varRedirectUrl="postLoginUrl" varAuthResult="authResult"
  132. rememberme="${param.zrememberme == '1'}" trustedDevice="${param.ztrusteddevice == 1}"
  133. requestedSkin="${param.skin}" adminPreAuth="${param.adminPreAuth == '1'}"
  134. importData="true" csrfTokenSecured="true"/>
  135. <%-- continue on at not empty authResult test --%>
  136. </c:if>
  137. </c:otherwise>
  138. </c:choose>
  139. </c:catch>
  140.  
  141. <c:if test="${not empty authResult}">
  142. <c:choose>
  143. <c:when test="${authResult.twoFactorAuthRequired eq true}">
  144. <c:set var="totpAuthRequired" value="true"/>
  145. </c:when>
  146. <c:otherwise>
  147. <c:set var="refer" value="${authResult.refer}"/>
  148. <c:set var="serverName" value="${pageContext.request.serverName}"/>
  149. <c:choose>
  150. <c:when test="${not empty postLoginUrl}">
  151. <c:choose>
  152. <c:when test="${not empty refer and not zm:equalsIgnoreCase(refer, serverName)}">
  153. <%--
  154. bug 63258: Need to redirect to a different server, avoid browser redirect to the post login URL.
  155. Do a JSP redirect which will do a onload form submit with ZAuthToken as a hidden param.
  156. In case of JS-disabled browser, make the user do a manual submit.
  157. --%>
  158. <jsp:forward page="/h/postLoginRedirect">
  159. <jsp:param name="zauthtoken" value="${authResult.authToken.value}"/>
  160. <jsp:param name="client" value="${param.client}"/>
  161. </jsp:forward>
  162. </c:when>
  163. <c:otherwise>
  164. <c:choose>
  165. <c:when test="${not empty param.client}">
  166. <c:redirect url="${postLoginUrl}">
  167. <c:param name="client" value="${param.client}"/>
  168. </c:redirect>
  169. </c:when>
  170. <c:otherwise>
  171. <c:redirect url="${postLoginUrl}"/>
  172. </c:otherwise>
  173. </c:choose>
  174. </c:otherwise>
  175. </c:choose>
  176. </c:when>
  177. <c:otherwise>
  178. <c:set var="client" value="${param.client}"/>
  179. <c:if test="${empty client and touchSupported}">
  180. <c:set var="client" value="${touchLoginPageExists ? 'touch' : 'mobile'}"/>
  181. </c:if>
  182. <c:if test="${empty client and mobileSupported}">
  183. <c:set var="client" value="mobile"/>
  184. </c:if>
  185. <c:if test="${empty client or client eq 'preferred'}">
  186. <c:set var="client" value="${requestScope.authResult.prefs.zimbraPrefClientType[0]}"/>
  187. </c:if>
  188. <c:choose>
  189. <c:when test="${client eq 'socialfox'}">
  190. <c:set var="sbURL" value="/public/launchSidebar.jsp"/>
  191. <c:redirect url="${sbURL}">
  192. <c:forEach var="p" items="${paramValues}">
  193. <c:forEach var='value' items='${p.value}'>
  194. <c:set var="testKey" value=",${p.key},"/>
  195. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  196. <c:param name="${p.key}" value='${value}'/>
  197. </c:if>
  198. </c:forEach>
  199. </c:forEach>
  200. </c:redirect>
  201. </c:when>
  202. <c:when test="${client eq 'advanced'}">
  203. <c:choose>
  204. <c:when test="${(param.loginOp eq 'login') && !(empty param.username) && !(empty param.password)}">
  205. <c:redirect url="/">
  206. <c:forEach var="p" items="${paramValues}">
  207. <c:forEach var='value' items='${p.value}'>
  208. <c:set var="testKey" value=",${p.key},"/>
  209. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  210. <c:param name="${p.key}" value='${value}'/>
  211. </c:if>
  212. </c:forEach>
  213. </c:forEach>
  214. <c:if test="${param.client eq 'advanced'}">
  215. <c:param name='client' value='advanced'/>
  216. </c:if>
  217. </c:redirect>
  218. </c:when>
  219. <c:otherwise>
  220. <jsp:forward page="/public/launchZCS.jsp"/>
  221. </c:otherwise>
  222. </c:choose>
  223. </c:when>
  224. <c:when test="${client eq 'standard'}">
  225. <c:redirect url="/h/search">
  226. <c:param name="mesg" value='welcome'/>
  227. <c:param name="init" value='true'/>
  228. <c:if test="${not empty param.app}">
  229. <c:param name="app" value='${param.app}'/>
  230. </c:if>
  231. <c:forEach var="p" items="${paramValues}">
  232. <c:forEach var='value' items='${p.value}'>
  233. <c:set var="testKey" value=",${p.key},"/>
  234. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  235. <c:param name="${p.key}" value='${value}'/>
  236. </c:if>
  237. </c:forEach>
  238. </c:forEach>
  239. </c:redirect>
  240. </c:when>
  241. <c:when test="${client eq 'mobile'}">
  242. <c:set var="mobURL" value="/m/zmain"/>
  243. <c:redirect url="${mobURL}">
  244. <c:forEach var="p" items="${paramValues}">
  245. <c:forEach var='value' items='${p.value}'>
  246. <c:set var="testKey" value=",${p.key},"/>
  247. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  248. <c:param name="${p.key}" value='${value}'/>
  249. </c:if>
  250. </c:forEach>
  251. </c:forEach>
  252. </c:redirect>
  253. </c:when>
  254. <c:when test="${client eq 'touch'}">
  255. <c:redirect url="${param.dev eq '1' ? '/tdebug' : '/t'}">
  256. <c:forEach var="p" items="${paramValues}">
  257. <c:forEach var='value' items='${p.value}'>
  258. <c:set var="testKey" value=",${p.key},"/>
  259. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  260. <c:param name="${p.key}" value='${value}'/>
  261. </c:if>
  262. </c:forEach>
  263. </c:forEach>
  264. </c:redirect>
  265. </c:when>
  266. <c:otherwise>
  267. <jsp:forward page="/public/launchZCS.jsp"/>
  268. </c:otherwise>
  269. </c:choose>
  270. </c:otherwise>
  271. </c:choose>
  272. </c:otherwise>
  273. </c:choose>
  274. </c:if>
  275.  
  276. <c:if test="${loginException != null}">
  277. <zm:getException var="error" exception="${loginException}"/>
  278. <c:set var="errorCode" value="${error.code}"/>
  279. <fmt:message bundle="${zmsg}" var="errorMessage" key="${errorCode}"/>
  280. <c:forEach var="arg" items="${error.arguments}">
  281. <fmt:message bundle="${zhmsg}" var="errorMessage" key="${errorCode}.${arg.name}">
  282. <fmt:param value="${arg.val}"/>
  283. </fmt:message>
  284. </c:forEach>
  285. <%--External account auth failure should carry a new error code to avoid this condition--%>
  286. <c:if test="${errorCode eq 'account.AUTH_FAILED' and not empty param.virtualacctdomain}">
  287. <fmt:message bundle="${zhmsg}" var="errorMessage" key="account.EXTERNAL_AUTH_FAILED"/>
  288. </c:if>
  289. <c:if test="${errorCode eq 'account.TWO_FACTOR_SETUP_REQUIRED'}">
  290. <c:url value="TwoFactorSetup.jsp" var="twoFactorSetupURL">
  291. <c:param name="userName" value="${fullUserName}"/>
  292. <c:param name="skin" value="${skin}"/>
  293. <c:param name="version" value="${version}"/>
  294. <c:if test="${not empty param.debug || not empty param.dev}">
  295. <c:param name="isDebug" value="true" />
  296. </c:if>
  297. <c:if test="${not empty param.customerDomain}">
  298. <c:param name="customerDomain" value="${param.customerDomain}" />
  299. </c:if>
  300. </c:url>
  301. <%--Forward the user to the initial two factor authentication set up page--%>
  302. <jsp:forward page="${twoFactorSetupURL}" />
  303. </c:if>
  304. </c:if>
  305. <%
  306. if (application.getInitParameter("offlineMode") != null) {
  307. request.getRequestDispatcher("/").forward(request, response);
  308. }
  309. %>
  310.  
  311. <c:set var="loginRedirectUrl" value="${zm:getPreLoginRedirectUrl(pageContext, '/')}"/>
  312. <c:if test="${not empty loginRedirectUrl}">
  313. <c:redirect url="${loginRedirectUrl}">
  314. <c:forEach var="p" items="${paramValues}">
  315. <c:forEach var='value' items='${p.value}'>
  316. <c:set var="testKey" value=",${p.key},"/>
  317. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  318. <c:param name="${p.key}" value='${value}'/>
  319. </c:if>
  320. </c:forEach>
  321. </c:forEach>
  322. </c:redirect>
  323. </c:if>
  324.  
  325. <zm:getDomainInfo var="domainInfo" by="virtualHostname" value="${zm:getServerName(pageContext)}"/>
  326. <c:if test="${((empty pageContext.request.queryString) or (fn:indexOf(pageContext.request.queryString,'customerDomain') == -1)) and (empty param.virtualacctdomain) and (empty virtualacctdomain) }">
  327. <c:set var="domainLoginRedirectUrl" value="${domainInfo.attrs.zimbraWebClientLoginURL}" />
  328. <c:set var="isAllowedUA" value="${zm:isAllowedUA(ua, domainInfo.webClientLoginURLAllowedUA)}"/>
  329. <c:set var="isAllowedIP" value="${zm:isAllowedIP(remoteAddr, domainInfo.webClientLoginURLAllowedIP)}"/>
  330. </c:if>
  331.  
  332. <c:if test="${not empty domainLoginRedirectUrl and empty param.sso and empty param.ignoreLoginURL and (isAllowedUA eq true) and (isAllowedIP eq true)}" >
  333. <c:redirect url="${domainLoginRedirectUrl}">
  334. <c:forEach var="p" items="${paramValues}">
  335. <c:forEach var='value' items='${p.value}'>
  336. <c:set var="testKey" value=",${p.key},"/>
  337. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  338. <c:param name="${p.key}" value='${value}'/>
  339. </c:if>
  340. </c:forEach>
  341. </c:forEach>
  342. </c:redirect>
  343. </c:if>
  344.  
  345. <c:if test="${(empty param.client or param.client eq 'touch') and touchSupported and touchLoginPageExists}">
  346. <jsp:forward page="/public/loginTouch.jsp"/>
  347. </c:if>
  348.  
  349. <c:url var="formActionUrl" value="/">
  350. <c:forEach var="p" items="${paramValues}">
  351. <c:forEach var='value' items='${p.value}'>
  352. <c:set var="testKey" value=",${p.key},"/>
  353. <c:if test="${not fn:contains(ignoredQueryParams, testKey)}">
  354. <c:param name="${p.key}" value='${value}'/>
  355. </c:if>
  356. <c:if test="${totpAuthRequired && (p.key eq 'client')}">
  357. <%--Remember the client to redirect to after successful two-factor auth--%>
  358. <c:param name="${p.key}" value='${value}'/>
  359. </c:if>
  360. </c:forEach>
  361. </c:forEach>
  362. </c:url>
  363.  
  364. <%
  365. Cookie testCookie = new Cookie("ZM_TEST", "true");
  366. testCookie.setSecure(com.zimbra.cs.taglib.ZJspSession.secureAuthTokenCookie(request));
  367. response.addCookie(testCookie);
  368. //Add the no-cache headers to ensure that the login page is never served from cache
  369. response.addHeader("Vary", "User-Agent");
  370. response.setHeader("Expires", "-1");
  371. response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0");
  372. response.setHeader("Pragma", "no-cache");
  373.  
  374. // Prevent IE from ever going into compatibility/quirks mode.
  375. response.setHeader("X-UA-Compatible", "IE=edge");
  376. %>
  377.  
  378. <!DOCTYPE html>
  379. <!-- set this class so CSS definitions that now use REM size, would work relative to this.
  380. Since now almost everything is relative to one of the 2 absolute font size classese -->
  381. <html class="user_font_size_normal" lang="${fn:substring(pageContext.request.locale, 0, 2)}">
  382. <head>
  383. <!--
  384. login.jsp
  385. * ***** BEGIN LICENSE BLOCK *****
  386. * Zimbra Collaboration Suite Web Client
  387. * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Synacor, Inc.
  388. *
  389. * This program is free software: you can redistribute it and/or modify it under
  390. * the terms of the GNU General Public License as published by the Free Software Foundation,
  391. * version 2 of the License.
  392. *
  393. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  394. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  395. * See the GNU General Public License for more details.
  396. * You should have received a copy of the GNU General Public License along with this program.
  397. * If not, see <https://www.gnu.org/licenses/>.
  398. * ***** END LICENSE BLOCK *****
  399. -->
  400. <c:set var="client" value="${param.client}"/>
  401. <c:set var="useStandard" value="${not (ua.isFirefox3up or ua.isGecko1_9up or ua.isIE9up or ua.isSafari4Up or ua.isChrome or ua.isModernIE)}"/>
  402. <c:if test="${empty client}">
  403. <%-- set client select default based on user agent. --%>
  404. <c:choose>
  405. <c:when test="${touchSupported}">
  406. <c:set var="client" value="${touchLoginPageExists ? 'touch' : 'mobile'}"/>
  407. </c:when>
  408. <c:when test="${mobileSupported}">
  409. <c:set var="client" value="mobile"/>
  410. </c:when>
  411. <c:when test="${useStandard}">
  412. <c:set var="client" value="standard"/>
  413. </c:when>
  414. <c:otherwise>
  415. <c:set var="client" value="preferred"/>
  416. </c:otherwise>
  417. </c:choose>
  418. </c:if>
  419. <c:set var="smallScreen" value="${client eq 'mobile' or client eq 'socialfox'}"/>
  420. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  421. <title><fmt:message key="zimbraLoginTitle"/></title>
  422. <c:set var="version" value="${initParam.zimbraCacheBusterVersion}"/>
  423. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  424. <meta name="description" content="<fmt:message key="zimbraLoginMetaDesc"/>">
  425. <meta name="apple-mobile-web-app-capable" content="yes" />
  426. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  427. <link rel="stylesheet" type="text/css" href="<c:url value='/css/common,login,zhtml,skin.css'>
  428. <c:param name="skin" value="${skin}" />
  429. <c:param name="v" value="${version}" />
  430. <c:if test="${not empty param.debug}">
  431. <c:param name="debug" value="${param.debug}" />
  432. </c:if>
  433. <c:if test="${not empty param.customerDomain}">
  434. <c:param name="customerDomain" value="${param.customerDomain}" />
  435. </c:if>
  436. </c:url>">
  437. <zm:getFavIcon request="${pageContext.request}" var="favIconUrl" />
  438. <c:if test="${empty favIconUrl}">
  439. <fmt:message key="favIconUrl" var="favIconUrl"/>
  440. </c:if>
  441. <link rel="SHORTCUT ICON" href="<c:url value='${favIconUrl}'/>">
  442.  
  443.  
  444. </head>
  445. <c:set value="/img" var="iconPath" scope="request"/>
  446. <body onload="onLoad();">
  447.  
  448. <div class="LoginScreen">
  449. <div class="${smallScreen?'center-small':'center'}">
  450. <div class="contentBox">
  451. <h1><a href="https://www.zimbra.com/" id="bannerLink" target="_new" title='<fmt:message key="zimbraTitle"/>'><span class="ScreenReaderOnly"><fmt:message key="zimbraTitle"/></span>
  452. <span class="Img${smallScreen?'App':'Login'}Banner"></span>
  453. </a></h1>
  454. <div id="ZLoginAppName"><fmt:message key="splashScreenAppName"/></div>
  455. <c:choose>
  456. <c:when test="${not empty domainLoginRedirectUrl && param.sso eq 1 && empty param.ignoreLoginURL && (isAllowedUA eq true)}">
  457. <form method="post" name="loginForm" action="${domainLoginRedirectUrl}" accept-charset="UTF-8">
  458. </c:when>
  459. <c:otherwise>
  460. <form method="post" name="loginForm" action="${formActionUrl}" accept-charset="UTF-8">
  461. <input type="hidden" name="loginOp" value="login"/>
  462. </c:otherwise>
  463. </c:choose>
  464. <c:if test="${errorCode != null}">
  465. <div id="ZLoginErrorPanel">
  466. <table><tr>
  467. <td><app:img id="ZLoginErrorIcon" altkey='ALT_ERROR' src="dwt/ImgCritical_32.png" /></td>
  468. <td><c:out value="${errorMessage}"/></td>
  469. </tr></table>
  470. </div>
  471. </c:if>
  472. <c:choose>
  473. <c:when test="${totpAuthRequired || errorCode eq 'account.TWO_FACTOR_AUTH_FAILED'}">
  474. <table class="form" id="totpTable" style="height:140px;width:350px;">
  475. <tbody>
  476. <tr>
  477. <td><label for="totpcode"><fmt:message key="twoFactorAuthCodeLabel"/>:</label></td>
  478. <td><input id="totpcode" class="zLoginField" name="totpcode" type="text" value="" size="40" maxlength="${domainInfo.webClientMaxInputBufferLength}" style="margin-right:20px" autocomplete="off"></td>
  479. <td class="submitTD"><input type="submit" value="<fmt:message key='twoFactorAuthVerifyCode'/>" class="ZLoginButton DwtButton"></td>
  480. </tr>
  481. <c:if test="${authResult.trustedDevicesEnabled eq true}">
  482. <tr style="vertical-align:top">
  483. <td/>
  484. <td><input id="trustedDevice" value="1" type="checkbox" name="ztrusteddevice">
  485. <label for="trustedDevice"><fmt:message key="${mobileSupported || touchSupported ? 'twoFactorAuthTrustDevice' : 'twoFactorAuthTrustComputer'}"/></label>
  486. </td>
  487. </tr>
  488. </c:if>
  489. </tbody>
  490. </table>
  491. </c:when>
  492. <c:otherwise>
  493. <table class="form">
  494. <c:choose>
  495. <c:when test="${not empty domainLoginRedirectUrl && param.sso eq 1 && empty param.ignoreLoginURL && (isAllowedUA eq true)}">
  496. <tr>
  497. <td colspan="2">
  498. <div class="LaunchButton">
  499. <input type="submit" value="<fmt:message key="launch"/>" >
  500. </div>
  501. </td>
  502. </tr>
  503. </c:when>
  504. <c:otherwise>
  505. <c:choose>
  506. <c:when test="${not empty virtualacctdomain or not empty param.virtualacctdomain}">
  507. <%--External/Guest user login - *email* & password input fields--%>
  508. <tr>
  509. <td><label for="username"><fmt:message key="email"/>:</label></td>
  510. <td><input id="username" class="zLoginField" name="username" type="text" value="${fn:escapeXml(param.username)}" size="40" maxlength="${domainInfo.webClientMaxInputBufferLength}"/></td>
  511. </tr>
  512. </c:when>
  513. <c:otherwise>
  514. <%--Internal user login - username & password input fields--%>
  515. <tr>
  516. <td><label for="username"><fmt:message key="username"/>:</label></td>
  517. <td><input id="username" class="zLoginField" name="username" type="text" value="${fn:escapeXml(param.username)}" size="40" maxlength="${domainInfo.webClientMaxInputBufferLength}" autocapitalize="off" autocorrect="off"/></td>
  518. </tr>
  519. </c:otherwise>
  520. </c:choose>
  521. <tr>
  522. <td><label for="password"><fmt:message key="password"/>:</label></td>
  523. <td><input id="password" autocomplete="off" class="zLoginField" name="password" type="password" value="" size="40" maxlength="${domainInfo.webClientMaxInputBufferLength}"/></td>
  524. </tr>
  525. <c:if test="${errorCode eq 'account.CHANGE_PASSWORD' or !empty param.loginNewPassword}">
  526. <tr>
  527. <td><label for="loginNewPassword"><fmt:message key="newPassword"/>:</label></td>
  528. <td><input id="loginNewPassword" autocomplete="off" class="zLoginField" name="loginNewPassword" type="password" value="${fn:escapeXml(param.loginNewPassword)}" size="40" maxlength="${domainInfo.webClientMaxInputBufferLength}"/></td>
  529. </tr>
  530. <tr>
  531. <td><label for="confirmNew"><fmt:message key="confirm"/>:</label></td>
  532. <td><input id="confirmNew" autocomplete="off" class="zLoginField" name="loginConfirmNewPassword" type="password" value="${fn:escapeXml(param.loginConfirmNewPassword)}" size="40" maxlength="${domainInfo.webClientMaxInputBufferLength}"/></td>
  533. </tr>
  534. </c:if>
  535. <tr>
  536. <td>&nbsp;</td>
  537. <td class="submitTD">
  538. <c:set var="isSignedInDisabled" value="${domainInfo.attrs.zimbraWebClientStaySignedInDisabled}"/>
  539. <c:if test="${isSignedInDisabled eq false}">
  540. <input id="remember" value="1" type="checkbox" name="zrememberme" />
  541. <label for="remember"><fmt:message key="${smallScreen?'rememberMeMobile':'rememberMe'}"/></label>
  542. </c:if>
  543. <input type="submit" class="ZLoginButton DwtButton" value="<fmt:message key="login"/>" />
  544. </td>
  545. </tr>
  546. </c:otherwise>
  547. </c:choose>
  548. <c:if test="${empty param.virtualacctdomain}">
  549. <tr <c:if test="${client eq 'socialfox'}">style='display:none;'</c:if>>
  550. <td colspan="2"><hr/></td>
  551. </tr>
  552. <tr <c:if test="${client eq 'socialfox'}">style='display:none;'</c:if>>
  553. <td>
  554. <label for="client"><fmt:message key="versionLabel"/></label>
  555. </td>
  556. <td>
  557. <div class="positioning">
  558. <c:choose>
  559. <c:when test="${client eq 'socialfox'}">
  560. <input type="hidden" name="client" value="socialfox"/>
  561. </c:when>
  562. <c:otherwise>
  563. <select id="client" name="client" onchange="clientChange(this.options[this.selectedIndex].value)">
  564. <option value="preferred" <c:if test="${client eq 'preferred'}">selected</c:if> > <fmt:message key="clientPreferred"/></option>
  565. <option value="advanced" <c:if test="${client eq 'advanced'}">selected</c:if>> <fmt:message key="clientAdvanced"/></option>
  566. <option value="standard" <c:if test="${client eq 'standard'}">selected</c:if>> <fmt:message key="clientStandard"/></option>
  567. <option value="mobile" <c:if test="${client eq 'mobile'}">selected</c:if>> <fmt:message key="clientMobile"/></option>
  568. <c:if test="${touchLoginPageExists}">
  569. <option value="touch" <c:if test="${client eq 'touch'}">selected</c:if>> <fmt:message key="clientTouch"/></option>
  570. </c:if>
  571. </select>
  572. </c:otherwise>
  573. </c:choose>
  574. <script TYPE="text/javascript">
  575. document.write("<a href='#' onclick='showWhatsThis();' id='ZLoginWhatsThisAnchor' aria-controls='ZLoginWhatsThis' aria-expanded='false'><fmt:message key='whatsThis'/></a>");
  576. </script>
  577. <c:choose>
  578. <c:when test="${touchLoginPageExists}">
  579. <div id="ZLoginWhatsThis" class="ZLoginInfoMessage" style="display:none;" onclick='showWhatsThis();' role="tooltip"><fmt:message key="clientWhatsThisMessage"/></div>
  580. </c:when>
  581. <c:otherwise>
  582. <div id="ZLoginWhatsThis" class="ZLoginInfoMessage" style="display:none;" onclick='showWhatsThis();' role="tooltip"><fmt:message key="clientWhatsThisMessageWithoutTablet"/></div>
  583. </c:otherwise>
  584. </c:choose>
  585. <div id="ZLoginUnsupported" class="ZLoginInfoMessage" style="display:none;"><fmt:message key="clientUnsupported"/></div>
  586. </div>
  587. </td>
  588. </tr>
  589. </c:if>
  590. </table>
  591. </c:otherwise>
  592. </c:choose>
  593. </form>
  594. </div>
  595. <div class="decor1"></div>
  596. </div>
  597.  
  598. <div class="${smallScreen?'Footer-small':'Footer'}">
  599. <div id="ZLoginNotice" class="legalNotice-small"><fmt:message key="clientLoginNotice"/></div>
  600. <div class="copyright">
  601. <c:choose>
  602. <c:when test="${mobileSupported}">
  603. <fmt:message bundle="${zhmsg}" key="splashScreenCopyright"/>
  604. </c:when>
  605. <c:otherwise>
  606. <fmt:message key="splashScreenCopyright"/>
  607. </c:otherwise>
  608. </c:choose>
  609. </div>
  610. </div>
  611. <div class="decor2"></div>
  612. </div>
  613. <script>
  614.  
  615. <jsp:include page="/js/skin.js">
  616. <jsp:param name="templates" value="false" />
  617. <jsp:param name="client" value="advanced" />
  618. <jsp:param name='servlet-path' value='/js/skin.js' />
  619. </jsp:include>
  620. var link = document.getElementById("bannerLink");
  621. if (link) {
  622. link.href = skin.hints.banner.url;
  623. }
  624.  
  625. <c:if test="${smallScreen && ua.isIE}"> /*HACK FOR IE*/
  626. var resizeLoginPanel = function(){
  627. var panelElem = document.getElementById('ZLoginPanel');
  628. if(panelElem && !panelElem.style.maxWidth) { if(document.body.clientWidth >= 500) { panelElem.style.width="500px";}else{panelElem.style.width="90%";} }
  629. }
  630. resizeLoginPanel();
  631. if(window.attachEvent){ window.attachEvent("onresize",resizeLoginPanel);}
  632. </c:if>
  633.  
  634. // show a message if they should be using the 'standard' client, but have chosen 'advanced' instead
  635. function clientChange(selectValue) {
  636. var useStandard = ${useStandard ? 'true' : 'false'};
  637. useStandard = useStandard || (screen && (screen.width <= 800 && screen.height <= 600));
  638. var div = document.getElementById("ZLoginUnsupported");
  639. if (div)
  640. div.style.display = ((selectValue == 'advanced') && useStandard) ? 'block' : 'none';
  641. }
  642.  
  643. // if they have JS, write out a "what's this?" link that shows the message below
  644. function showWhatsThis() {
  645. var anchor = document.getElementById('ZLoginWhatsThisAnchor'),
  646. tooltip = document.getElementById("ZLoginWhatsThis"),
  647. doHide = (tooltip.style.display === "block");
  648. tooltip.style.display = doHide ? "none" : "block";
  649. anchor.setAttribute("aria-expanded", doHide ? "false" : "true");
  650. }
  651.  
  652. function onLoad() {
  653. var loginForm = document.loginForm;
  654. if (loginForm.username) {
  655. if (loginForm.username.value != "") {
  656. loginForm.password.focus(); //if username set, focus on password
  657. }
  658. else {
  659. loginForm.username.focus();
  660. }
  661. }
  662. clientChange("${zm:cook(client)}");
  663. //check if the login page is loaded in the sidebar.
  664. if (navigator.mozSocial) {
  665. //send a ping so that worker knows about this page.
  666. navigator.mozSocial.getWorker().port.postMessage({topic: "worker.reload", data: true});
  667. //this page is loaded in firefox sidebar so listen for message from worker.
  668. navigator.mozSocial.getWorker().port.onmessage = function onmessage(e) {
  669. var topic = e.data.topic;
  670. if (topic && topic == "sidebar.authenticated") {
  671. window.location.href = "/public/launchSidebar.jsp";
  672. }
  673. };
  674. }
  675. if (${totpAuthRequired} && loginForm.totpcode) {
  676. loginForm.totpcode.focus();
  677. }
  678. }
  679. </script>
  680. </body>
  681. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement