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