]> code.citadel.org Git - citadel.git/blobdiff - webcit/auth.c
Disabled the old login screen.
[citadel.git] / webcit / auth.c
index 74ab667385cfdce1ada3dd4a30330839a6d54544..eba2e3bc4bce0f34089215bb8031df7881dfba2a 100644 (file)
@@ -140,6 +140,7 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo
 }
 
 
+#ifdef __OLD__LOGIN__SCREEN__
 /* 
  * Perform authentication using a user name and password
  */
@@ -227,7 +228,7 @@ void do_login(void)
        }
        FreeStrBuf(&Buf);
 }
-
+#endif
 
 
 /* 
@@ -313,40 +314,30 @@ void do_openid_login(void)
 {
        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
@@ -415,7 +406,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);
@@ -425,6 +417,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.
@@ -437,6 +430,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;
@@ -448,16 +442,33 @@ 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();
+               /* 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);
@@ -1056,7 +1067,9 @@ InitModule_AUTH
 
        /* 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);