f0ff58bd1f495d023e9f6ea48e97e2546da8a302
[vid.git] / vid-app-common / src / test / resources / WEB-INF / jsp / login.jsp
1 <%@ page import="java.net.URLEncoder"%>
2 <%@ page import="org.onap.portalsdk.core.util.SystemProperties"%>
3 <%
4         // Requests are handled by class ProcessCspController in the EP-SDK-Core library.
5         // On login error, that controller returns a model that is a String->String map.
6         
7         // CSP property is defined in fusion.properties file
8         final String cspLoginUrl = SystemProperties.getProperty(SystemProperties.CSP_LOGIN_URL);
9         // Name is defined by app; do not throw if missing
10         final String appDisplayName = SystemProperties.containsProperty(SystemProperties.APP_DISPLAY_NAME)
11                         ? SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)
12                         : SystemProperties.APP_DISPLAY_NAME;
13         // Build login-link URL using parameters and/or system properties 
14         String returnUrl = request.getParameter("returnUrl");
15         if (returnUrl == null) {
16                 final String cspPage = "doLogin";
17                 if (SystemProperties.containsProperty(SystemProperties.APP_BASE_URL)) {
18                         // Use property with the application URL; e.g., WebJunction
19                         String appUrl = SystemProperties.getProperty(SystemProperties.APP_BASE_URL);
20                         returnUrl = appUrl + (appUrl.endsWith("/") ? "" : "/") + cspPage;
21                 } else {
22                         // Use server info; incorrect for sites behind WebJunction.
23                         returnUrl = (request.isSecure() ? "https://" : "http://") + request.getServerName() + ":"
24                                         + request.getServerPort() + request.getContextPath() + "/" + cspPage;
25                 }
26         } else {
27                 // Request has a parameter with the return URL
28                 returnUrl = URLEncoder.encode(returnUrl, "UTF-8");
29         }
30 %>
31 <!DOCTYPE html>
32 <html>
33 <head>
34 <meta charset="utf-8">
35 <meta http-equiv="X-UA-Compatible" content="IE=edge">
36 <meta name="viewport" content="width=device-width, initial-scale=1">
37 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
38 <style>
39 html {
40         font-family: Verdana, Arial, Helvetica, sans-serif;
41 }
42
43 body {
44         padding-top: 15px;
45 }
46
47 .logo {
48         position: fixed;
49         left: 15px;
50         top: 15px;
51         z-index: -1;
52 }
53
54 .loginError {
55         font-size: 18px;
56         color: red;
57         text-align: center;
58 }
59
60 .login {
61         font-size: 16px;
62         display: block;
63         margin-left: auto;
64         margin-right: auto;
65         text-align: center;
66         width: 100%;
67 }
68
69 .login a {
70         font-size: 16px;
71 }
72
73 .terms {
74         font-size: 10px;
75         text-align: center;
76         margin-left: auto;
77         margin-right: auto;
78 }
79
80 .terms a {
81         font-size: 10px;
82         text-align: center;
83         margin-left: auto;
84         margin-right: auto;
85 }
86 </style>
87 </head>
88 <body>
89         <!-- AT&T Logo -->
90         <div class="logo">
91                 <img src="static/fusion/images/logo_att_header.jpg" alt="AT&T" />
92         </div>
93         <div class="login">
94                 <img src="static/fusion/images/ecomp-login-550x360.jpg" />
95                 <h2>
96                         <%=appDisplayName%>
97                 </h2>
98                 <a href="<%=cspLoginUrl%><%=returnUrl%>">Click here to login</a>
99         </div>
100         <br />
101         <br />
102         <br />
103         <div class="loginError">${model.error}</div>
104         <br />
105         <br />
106         <br />
107         <br />
108         <br />
109         <br />
110         <div id="footer">
111                 <div class="terms">
112                         Warning: This system is restricted to AT&amp;T authorized users for
113                         business purposes. Unauthorized access is a violation of the law. <br />
114                         This service may be monitored for administrative and security
115                         reasons. By proceeding, you consent to this monitoring.
116                 </div>
117                 <p>
118                 <div class="terms">
119                         <a target="_top" href="http://www.att.com/terms/">Terms and
120                                 Conditions</a> | <a target="_top" href="http://www.att.com/privacy/">Privacy
121                                 Policy</a> <br> &copy; 2017 AT&amp;T. All rights reserved.
122                 </div>
123         </div>
124 </body>
125 </html>