login popout is working, along with non edge case openID login
authorArt Cancro <ajc@citadel.org>
Mon, 24 Jan 2011 20:47:23 +0000 (15:47 -0500)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 14:03:56 +0000 (14:03 +0000)
webcit/auth.c
webcit/static/t/authpopup_finished.html [new file with mode: 0644]

index 325c84725547738b50f876e97dd02b544a8bd838..ff9bd7b975f96c7f292a9ce08b57b74e7b0d59e3 100644 (file)
@@ -400,7 +400,8 @@ void finalize_openid_login(void)
                }
        }
 
-       /* 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);
@@ -410,6 +411,7 @@ void finalize_openid_login(void)
                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.
@@ -422,6 +424,7 @@ void finalize_openid_login(void)
         * 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;
@@ -433,16 +436,29 @@ void finalize_openid_login(void)
                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();
+               /* maybe do something prettier here? */
+               convenience_page("770000", _("Error"), _("Error") );
        }
 
        FreeStrBuf(&result);
diff --git a/webcit/static/t/authpopup_finished.html b/webcit/static/t/authpopup_finished.html
new file mode 100644 (file)
index 0000000..ad9db1e
--- /dev/null
@@ -0,0 +1,6 @@
+<script type="text/javascript">
+window.close();
+if (window.opener && !window.opener.closed) {
+       window.opener.location.reload();
+} 
+</script>