}
+#ifdef __OLD__LOGIN__SCREEN__
/*
* Perform authentication using a user name and password
*/
}
FreeStrBuf(&Buf);
}
-
+#endif
/*
{
char buf[4096];
- if (havebstr("language")) {
- set_selected_language(bstr("language"));
- go_selected_language();
- }
+ snprintf(buf, sizeof buf,
+ "OIDS %s|%s/finalize_openid_login|%s",
+ bstr("openid_url"),
+ ChrPtr(site_prefix),
+ ChrPtr(site_prefix)
+ );
- if (havebstr("exit_action")) {
- do_logout();
+ serv_puts(buf);
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '2') {
+ syslog(LOG_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
+ http_redirect(&buf[4]);
return;
}
- if (havebstr("login_action")) {
- snprintf(buf, sizeof buf,
- "OIDS %s|%s/finalize_openid_login|%s",
- bstr("openid_url"),
- ChrPtr(site_prefix),
- ChrPtr(site_prefix)
- );
-
- serv_puts(buf);
- serv_getln(buf, sizeof buf);
- if (buf[0] == '2') {
- syslog(LOG_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
- http_redirect(&buf[4]);
- return;
- }
- else {
- display_login();
- return;
- }
- }
- /* If we get to this point then something failed. */
- display_login();
+ begin_burst();
+ output_headers(1, 0, 0, 0, 1, 0);
+ wc_printf("<html><body>");
+ escputs(&buf[4]);
+ wc_printf("</body></html>");
+ end_burst();
}
+
/*
* Complete the authentication using OpenID
* This function handles the positive or negative assertion from the user's Identity Provider
}
}
- /* If we were already logged in, this was an attempt to associate an OpenID account */
+ /* If we were already logged in, this was an attempt to associate an OpenID account
+ FIXME put this back in
if (already_logged_in) {
display_openids();
FreeStrBuf(&result);
FreeStrBuf(&logged_in_response);
return;
}
+ */
/* If this operation logged us in, either by connecting with an existing account or by
* auto-creating one using Simple Registration Extension, we're already on our way.
* or conflicts with an existing user. Either way the user will need to specify a new name.
*/
+/*
else if (!strcasecmp(ChrPtr(result), "verify_only")) {
putbstr("__claimed_id", claimed_id);
claimed_id = NULL;
do_template("openid_manual_create", NULL);
end_burst();
}
+*/
+
+
/* Did we manage to log in? If so, continue with the normal flow... */
- else if (WC->logged_in) {
+ if (WC->logged_in) {
+ begin_burst();
+ output_headers(1, 0, 0, 0, 1, 0);
+ do_template("authpopup_finished", NULL);
+ end_burst();
+
+ /* FIXME make all this crap work again
if (WC->need_regi) {
display_reg(1);
} else {
do_welcome();
}
+ */
+
} else {
- display_login();
+ /* FIXME do something prettier here? */
+ begin_burst();
+ output_headers(1, 0, 0, 0, 1, 0);
+ wc_printf("<html><body>");
+ wc_printf("error");
+ wc_printf("</body></html>");
+ end_burst();
}
FreeStrBuf(&result);
/* some of these will be removed soon */
WebcitAddUrlHandler(HKEY("do_welcome"), "", 0, do_welcome, ANONYMOUS|COOKIEUNNEEDED);
+#ifdef __OLD__LOGIN__SCREEN__
WebcitAddUrlHandler(HKEY("login"), "", 0, do_login, ANONYMOUS|COOKIEUNNEEDED);
+#endif
WebcitAddUrlHandler(HKEY("openid_login"), "", 0, do_openid_login, ANONYMOUS);
WebcitAddUrlHandler(HKEY("finalize_openid_login"), "", 0, finalize_openid_login, ANONYMOUS);
WebcitAddUrlHandler(HKEY("openid_manual_create"), "", 0, openid_manual_create, ANONYMOUS);