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 | 83 |
1 files changed, 58 insertions, 25 deletions
diff --git a/sca-cpp/trunk/hosting/server/htdocs/login/index.html b/sca-cpp/trunk/hosting/server/htdocs/login/index.html index 9052abe8d3..359afc1807 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/login/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/login/index.html @@ -32,31 +32,50 @@ <h1>Sign in</h1> -<form name="openIDForm"> +<form name="googleOpenIDForm"> <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> +<tr><td><b>Sign in with your Google account (using OpenID)</b></td></tr> +<tr><td><input type="button" value="Sign in" class="graybutton" style="font-weight: bold;" onclick="submitOpenIDSignin(withGoogleOpenID)"/></td></tr> </table> </form> -<form name="oauth2Form"> +<form name="facebookOAuth2Form"> <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> +<tr><td><b>Sign in with your Facebook account (using OAuth)</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="googleOAuth2Form"> +<table border="0"> +<tr><td><b>Sign in with your Google account (using OAuth)</b></td></tr> +<tr><td><input type="button" value="Sign in" class="graybutton" style="font-weight: bold;" onclick="submitOAuth2Signin(withGoogleOAuth)"/></td></tr> +</table> +</form> + +<form name="formSignin" method="POST" action="/login/dologin"> +<table border="0"> +<tr><td colspan="2"><b>Sign in with your user id and password</b></td></tr> +<tr><td>User id:</td><td><input type="text" name="httpd_username" value=""/></td></tr> +<tr><td>Password:</td><td><input type="password" name="httpd_password" value=""/></td></tr> +<tr><td><input type="button" class="graybutton" style="font-weight: bold;" onclick="submitFormSignin()" value="Sign in"/></td><td></td></tr> +</table> +</p> +<input type="hidden" name="httpd_location" value="/"/> +</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 name="oauth2Signin" action="/oauth2/authorize/" method="GET"> +<input type="hidden" name="oauth2_authorize" value=""/> +<input type="hidden" name="oauth2_access_token" value=""/> +<input type="hidden" name="oauth2_client_id" value=""/> +<input type="hidden" name="oauth2_info" value=""/> +<input type="hidden" name="oauth2_display" value=""/> +<input type="hidden" name="oauth2_scope" value=""/> +<input type="hidden" name="openauth_referrer" value=""/> </form> <script type="text/javascript"> @@ -85,8 +104,7 @@ function openauthReferrer() { * 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; + clearauthcookie(); localStorage.removeItem('/r/EditWidget/accounts'); localStorage.removeItem('/r/EditWidget/dashboards'); //localStorage.clear(); @@ -95,7 +113,7 @@ function submitOpenIDSignin(w) { document.openIDSignin.submit(); } -function withGoogle() { +function withGoogleOpenID() { return 'https://www.google.com/accounts/o8/id'; } @@ -104,25 +122,40 @@ function withGoogle() { */ function submitOAuth2Signin(w) { parms = w(); - var reset = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; - document.cookie = reset; + clearauthcookie(); 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.oauth2_authorize.value = parms[0]; + document.oauth2Signin.oauth2_access_token.value = parms[1]; + document.oauth2Signin.oauth2_client_id.value = parms[2]; + document.oauth2Signin.oauth2_info.value = parms[3]; + document.oauth2Signin.oauth2_scope.value = parms[4]; + document.oauth2Signin.oauth2_display.value = parms[5]; + document.oauth2Signin.openauth_referrer.value = openauthReferrer(); + document.oauth2Signin.action = '/oauth2/authorize/'; 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']; + var parms = ['https://graph.facebook.com/oauth/authorize', 'https://graph.facebook.com/oauth/access_token', 'facebook.com', 'https://graph.facebook.com/me', 'email', ui.isMobile()? 'touch' : 'page']; return parms; } +function withGoogleOAuth() { + var parms = ['https://accounts.google.com/o/oauth2/auth', 'https://accounts.google.com/o/oauth2/token', 'google.com', 'https://www.googleapis.com/oauth2/v1/userinfo', 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile', '']; + return parms; +} + +/** + * Signin with a userid and password. + */ +function submitFormSignin() { + clearauthcookie(); + document.formSignin.httpd_location.value = '/'; + document.formSignin.submit(); +} + /** * Handle orientation change. */ |