Finished everything except the openid_manual_create code path
authorArt Cancro <ajc@citadel.org>
Mon, 14 Feb 2011 17:18:50 +0000 (12:18 -0500)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 14:13:54 +0000 (14:13 +0000)
webcit/auth.c
webcit/static/t/openid_manual_create.html

index 6c7c7bf6cb51b94d2b163169653c7ceb87b73eec..9dbbb5a827c311c8b63c39f9f21435fef50c4db8 100644 (file)
@@ -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("<html><body>");
+                       wc_printf(_("An error has occurred."));
+                       wc_printf("</body></html>");
+                       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("<html><body>");
-               wc_printf("FIXME -- manual create goes here -- FIXME");
-               /* do_template("openid_manual_create", NULL); */
+               do_template("openid_manual_create", NULL);
                wc_printf("</body></html>");
                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("<html><body>");
index 78fb7bac197d27e559ba55c3808feba2c42a7997..9bacb664fa1969318b151555aa8cc7107825be74 100644 (file)
@@ -1,9 +1,3 @@
-<?=("head")>
-<div id="login_screen">
-<?=("beginbox_1")>
-<?SERV:HUMANNODE><?_(" - powered by <a href='http://www.citadel.org'>Citadel</a>")>
-<?=("beginbox_2")>
-<?HELLO>
 <div class="login_infos">
        <img src="static/openid-small.gif"><?_("Your OpenID")> <tt><?BSTR("__claimed_id", "X")></tt> <?_("was successfully verified.")><br>
 <??("COND:BSTR", 1, "__username")><?_("However, the user name")>  '<?BSTR("__claimed_id", "X")>' <?_("conflicts with an existing user.")><??("X", 1)>
@@ -20,5 +14,3 @@
         <br>
         </div>
 </form>
-<?=("endbox")>
-<?=("trailing")>