diff options
Diffstat (limited to 'sca-cpp/trunk/hosting/server/htdocs/login/index.html')
-rw-r--r-- | sca-cpp/trunk/hosting/server/htdocs/login/index.html | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/sca-cpp/trunk/hosting/server/htdocs/login/index.html b/sca-cpp/trunk/hosting/server/htdocs/login/index.html new file mode 100644 index 0000000000..9052abe8d3 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/login/index.html @@ -0,0 +1,156 @@ +<!DOCTYPE html> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<html> +<head> +<title>Sign in</title> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black"/> +<base href="/login/"/> +<link rel="stylesheet" type="text/css" href="/ui-min.css"/> +<script type="text/javascript" src="/all-min.js"></script> +</head> +<body class="delayed" onload="onload();"> +<div id="bodydiv" class="bodydiv"> + +<h1>Sign in</h1> + +<form name="openIDForm"> +<table border="0"> +<tr><td><b>Sign in with your Google account</b></td></tr> +<tr><td><input type="button" value="Sign in" class="graybutton" style="font-weight: bold;" onclick="submitOpenIDSignin(withGoogle)"/></td></tr> +</table> +</form> + +<form name="oauth2Form"> +<table border="0"> +<tr><td><b>Sign in with your Facebook account</b></td></tr> +<tr><td><input type="button" value="Sign in" class="graybutton" style="font-weight: bold;" onclick="submitOAuth2Signin(withFacebook)"/></td></tr> +</table> +</form> + +<form name="openIDSignin" action="/" method="GET"> +<input type="hidden" name="openid_identifier" value=""/> +</form> + +<form name="oauth2Signin" action="/" method="GET"> +<input type="hidden" name="mod_oauth2_authorize" value=""/> +<input type="hidden" name="mod_oauth2_access_token" value=""/> +<input type="hidden" name="mod_oauth2_client_id" value=""/> +<input type="hidden" name="mod_oauth2_info" value=""/> +<input type="hidden" name="mod_oauth2_display" value=""/> +<input type="hidden" name="mod_oauth2_step" value="authorize"/> +</form> + +<script type="text/javascript"> +function queryParams() { + var qp = new Array(); + var qs = window.location.search.substring(1).split('&'); + for (var i = 0; i < qs.length; i++) { + var e = qs[i].indexOf('='); + if (e > 0) + qp[qs[i].substring(0, e)] = unescape(qs[i].substring(e + 1)); + } + return qp; +} + +function openauthReferrer() { + var r = queryParams()['openauth_referrer']; + if (typeof(r) == 'undefined' || domainname(r) != domainname(window.location.hostname)) + return '/'; + var q = r.indexOf('?'); + if (q > 0) + return r.substring(0, q); + return r; +} + +/** + * Signin with OpenID. + */ +function submitOpenIDSignin(w) { + var reset = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + document.cookie = reset; + localStorage.removeItem('/r/EditWidget/accounts'); + localStorage.removeItem('/r/EditWidget/dashboards'); + //localStorage.clear(); + document.openIDSignin.openid_identifier.value = w(); + document.openIDSignin.action = openauthReferrer(); + document.openIDSignin.submit(); +} + +function withGoogle() { + return 'https://www.google.com/accounts/o8/id'; +} + +/** + * Signin with OAuth 2.0. + */ +function submitOAuth2Signin(w) { + parms = w(); + var reset = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + document.cookie = reset; + localStorage.removeItem('/r/EditWidget/accounts'); + localStorage.removeItem('/r/EditWidget/dashboards'); + //localStorage.clear(); + document.oauth2Signin.mod_oauth2_authorize.value = parms[0]; + document.oauth2Signin.mod_oauth2_access_token.value = parms[1]; + document.oauth2Signin.mod_oauth2_client_id.value = parms[2]; + document.oauth2Signin.mod_oauth2_info.value = parms[3]; + document.oauth2Signin.mod_oauth2_display.value = parms[4]; + document.oauth2Signin.action = openauthReferrer(); + document.oauth2Signin.submit(); +} + +function withFacebook() { + var parms = ['https://graph.facebook.com/oauth/authorize', 'https://graph.facebook.com/oauth/access_token', 'facebook.com', 'https://graph.facebook.com/me', ui.isMobile()? 'touch' : 'page']; + return parms; +} + +/** + * Handle orientation change. + */ +document.body.onorientationchange = function(e) { + //log('onorientationchange'); + + // Scroll to the top and hide the address bar + window.scrollTo(0, 0); + + return true; +}; + +/** + * Document load post processing. + */ +function onload() { + //log('onload'); + + // Show the page + document.body.style.visibility = 'visible'; + + // Scroll to the top and hide the address bar + window.scrollTo(0, 0); + return true; +} + +</script> + +</div> +</body> +</html> |