From 39a018d47aa7c0d861a88b2587266ce378cac7f9 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 14 Feb 2011 12:18:50 -0500 Subject: [PATCH] Finished everything except the openid_manual_create code path --- webcit/auth.c | 37 +++++++++++++---------- webcit/static/t/openid_manual_create.html | 8 ----- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index 6c7c7bf6c..9dbbb5a82 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -186,6 +186,7 @@ void ajax_login_newuser(void) { /* * Try to create an account manually after an OpenID was verified + * FIXME make this all sorts of wonderful extra window goodness */ void openid_manual_create(void) { @@ -340,19 +341,28 @@ void finalize_openid_login(void) */ if ( (WCC->logged_in) && (havebstr("attach_existing")) ) { display_openids(); - FreeStrBuf(&result); - FreeStrBuf(&username); - FreeStrBuf(&password); - FreeStrBuf(&claimed_id); - 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. */ - if (!strcasecmp(ChrPtr(result), "authenticate")) { + else if (!strcasecmp(ChrPtr(result), "authenticate")) { become_logged_in(username, password, logged_in_response); + + /* Did we manage to log in? If so, continue with the normal flow... */ + if (WC->logged_in) { + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + do_template("authpopup_finished", NULL); + end_burst(); + } else { + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + wc_printf(""); + wc_printf(_("An error has occurred.")); + wc_printf(""); + end_burst(); + } } /* The specified OpenID was verified but the desired user name was either not specified via SRE @@ -368,19 +378,14 @@ void finalize_openid_login(void) begin_burst(); output_headers(1, 0, 0, 0, 1, 0); wc_printf(""); - wc_printf("FIXME -- manual create goes here -- FIXME"); - /* do_template("openid_manual_create", NULL); */ + do_template("openid_manual_create", NULL); wc_printf(""); end_burst(); } - /* Did we manage to log in? If so, continue with the normal flow... */ - if (WC->logged_in) { - begin_burst(); - output_headers(1, 0, 0, 0, 1, 0); - do_template("authpopup_finished", NULL); - end_burst(); - } else { + /* Something went VERY wrong if we get to this point */ + else { + syslog(1, "finalize_openid_login() failed to do anything. This is a code problem.\n"); begin_burst(); output_headers(1, 0, 0, 0, 1, 0); wc_printf(""); diff --git a/webcit/static/t/openid_manual_create.html b/webcit/static/t/openid_manual_create.html index 78fb7bac1..9bacb664f 100644 --- a/webcit/static/t/openid_manual_create.html +++ b/webcit/static/t/openid_manual_create.html @@ -1,9 +1,3 @@ - -
- -Citadel")> - - - - -- 2.30.2