-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuc_splash.html
219 lines (206 loc) · 7.25 KB
/
uc_splash.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>UC Berkeley Campus Solutions - Sign In</title>
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui" />
<meta name="description" content="UC Berkeley Campus Solutions" />
<style>
* {
margin: 0;
padding: 0;
}
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
background-color: #6e7a83;
color: #474747;
font-family: Arial, sans-serif;
}
.sis-splash-container {
background: #fff;
font-size: 18px;
margin: 100px auto 0;
max-width: 550px;
}
.sis-splash-container a {
color: #2683bc;
text-decoration: none;
}
.sis-splash-container a:focus, .sis-splash-container a:hover {
text-decoration: underline;
}
.sis-splash-container button {
background: #2787b6;
border: 1px solid transparent;
border-radius: 5px;
color: #fff;
cursor: pointer;
font-size: 18px;
font-weight: normal;
line-height: 1.5;
padding: 5px 20px;
}
.sis-splash-container button:hover, .sis-splash-container button:focus {
background: #1f7099;
}
.sis-splash-container h1 {
background: #ebebeb;
color: #424242;
font-size: 25px;
font-style: normal;
font-weight: 500;
line-height: 1.4;
padding: 10px 35px;
}
.sis-splash-container p {
font-weight: normal;
line-height: 1.6;
margin-bottom: 20px;
text-rendering: optimizeLegibility;
}
.sis-splash-container-message {
background: #2b6281;
color: #fff;
margin: 0;
padding: 10px 35px;
}
.sis-splash-container-sub {
padding: 25px 35px;
}
.sis-splash-container-sub .sis-splash-container-sub-left {
float: left;
max-width: 400px;
}
.sis-splash-container-sub .sis-splash-container-lock {
float: right;
width: 110px;
}
@media (max-width: 550px) {
.sis-splash-container-sub .sis-splash-container-lock {
display: none;
}
}
.sis-splash-hidden {
display: none;
}
.sis-splash-clearfix-container:before,
.sis-splash-clearfix-container:after {
content: " ";
display: table;
}
.sis-splash-clearfix-container:after {
clear: both;
}
</style>
</head>
<body>
<div class="sis-splash-container">
<h1>UC Berkeley Campus Solutions</h1>
<p class="sis-splash-container-message sis-splash-container-logout-successful sis-splash-hidden">
Logging you out...
</p>
<p class="sis-splash-container-message sis-splash-container-expire-successful sis-splash-hidden">
Your connection has expired.
</p>
<div class="sis-splash-container-sub sis-splash-clearfix-container">
<div class="sis-splash-container-sub-left">
<p id="sis-splash-sign-in-message">Sign in with your CalNet ID and passphrase.</p>
<p>
<a href="https://calnet.berkeley.edu/">Need a CalNet ID?</a>
</p>
<form action="" method="POST" id="sis-splash-login-form">
<button type="submit" id="sis-splash-sign-in-button">
Sign in to Campus Solutions
</button>
</form>
</div>
<!-- Lock icon -->
<svg class="sis-splash-container-lock" xmlns="http://www.w3.org/2000/svg" viewBox="-229.9 343.6 93.9 114.7" enable-background="new -229.9 343.6 93.9 114.7">
<path fill="#E6E6E6" d="M-138.4 398.1c-1.5-1.5-3.4-2.3-5.5-2.3h-2.6v-15.6c0-10-3.6-18.6-10.8-25.7-7.2-7.2-15.8-10.8-25.7-10.8s-18.6 3.6-25.7 10.8c-7.2 7.2-10.8 15.8-10.8 25.7v15.6h-2.6c-2.2 0-4 .8-5.5 2.3-1.5 1.5-2.3 3.4-2.3 5.5v46.9c0 2.2.8 4 2.3 5.5 1.5 1.5 3.4 2.3 5.5 2.3h78.2c2.2 0 4-.8 5.5-2.3 1.5-1.5 2.3-3.4 2.3-5.5v-46.9c0-2.2-.7-4-2.3-5.5zm-23.7-2.3h-41.7v-15.6c0-5.8 2-10.7 6.1-14.7 4.1-4.1 9-6.1 14.7-6.1s10.7 2 14.7 6.1c4.1 4.1 6.1 9 6.1 14.7l.1 15.6z"/>
</svg>
</div>
</div>
<script>
(function() {
// Whether this is a web or internal server
var isWebServer = true;
// UC Berkeley - Dynamic URLs
var urlCas = 'https://cas-d3.calnet.berkeley.edu/cas';
var urlCalCentral = 'https://calcentral-sis-dev.berkeley.edu/';
var urlRoot = 'https://bcs-web-dev-03.is.berkeley.edu:8443/';
var urlLogin = 'https://bcs-web-dev-03.is.berkeley.edu:8443/bcsdev/signon.html';
var urlLogout = urlCas + '/logout?service=' + urlRoot;
/**
* Get the Querystring parameter by name
* @param {String} name The name of the parameter (e.g. 'logout')
* @return {String} The value of the parameter
*/
var getParameterByName = function(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
/**
* Show a message based on the query parameters
* @param {String} id The ID of the element you would like to show
*/
var showMessage = function(id) {
var successElement = document.querySelector('.sis-splash-container-' + id + '-successful');
var classes = successElement.className;
successElement.className = classes.replace(/\bsis-splash-hidden\b/,'');
};
/**
* Redirect to the CAS logout, which then will show the link to the main login page.
*/
var redirectToLogout = function() {
document.location.replace(urlLogout);
};
/**
* Set the dynamic login URL
*/
var setLoginUrl = function() {
var sisSplashLoginForm = document.getElementById('sis-splash-login-form');
sisSplashLoginForm.setAttribute('action', urlLogin);
};
var redirectUrl = getParameterByName('redirect_url');
// Querystring 'cmd=expire'
// - On a web server: redirects to the CalCentral instance
// - On an internal server: shows the expire message
var cmdParameter = getParameterByName('cmd');
if (cmdParameter === 'expire') {
if (isWebServer) {
window.location.replace(urlCalCentral);
} else {
showMessage('expire');
}
}
// Querystring 'cmd=logout', shows the logout message
else if (cmdParameter === 'logout' && !redirectUrl) {
showMessage('logout');
redirectToLogout();
// When we do have a redirect_url parameter, use that instead of doing the CAS logout
} else if (cmdParameter === 'logout' && redirectUrl) {
// Redirect to another page
// We need to do this when we do a logout from CalCentral:
// - Logout from CalCentral
// - Logout from CAS
// - Logout from PS
// - Redirect to CalCentral
window.location.replace(redirectUrl);
}
if (getParameterByName('errorCode') === '105') {
document.querySelector('#sis-splash-sign-in-message').innerHTML = 'Your account hasn\'t been created yet.<br /> Please try again later.';
document.querySelector('#sis-splash-sign-in-button').style.display = 'none';
}
setLoginUrl();
})();
</script>
</body>
</html>