Revert "Removed the "fix_scrollbarbug" div and all references to it."
[citadel.git] / webcit / openid.c
index e3881924fbd7a0ae7c73a250279e6c438d01640f..8842e88102549f3f214d7d480a58a05a2417c917 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * $Id$
- */
 
 #include "webcit.h"
 #include "webserver.h"
@@ -16,47 +13,48 @@ void display_openids(void)
 
        output_headers(1, 1, 1, 0, 0, 0);
 
-       wprintf("<div class=\"fix_scrollbar_bug\">");
+       wc_printf("<div class=\"fix_scrollbar_bug\">");
 
-       svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
-       do_template("beginboxx", NULL);
+       do_template("beginbox_1", NULL);
+       StrBufAppendBufPlain(WCC->WBuf, _("Manage Account/OpenID Associations"), -1, 0);
+       do_template("beginbox_2", NULL);
 
        if (WCC->serv_info->serv_supports_openid) {
 
-               wprintf("<table class=\"altern\">");
+               wc_printf("<table class=\"altern\">");
        
                serv_puts("OIDL");
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        bg = 1 - bg;
-                       wprintf("<tr class=\"%s\">", (bg ? "even" : "odd"));
-                       wprintf("<td><img src=\"static/openid-small.gif\"></td><td>");
+                       wc_printf("<tr class=\"%s\">", (bg ? "even" : "odd"));
+                       wc_printf("<td><img src=\"static/openid-small.gif\"></td><td>");
                        escputs(buf);
-                       wprintf("</td><td>");
-                       wprintf("<a href=\"openid_detach?id_to_detach=");
+                       wc_printf("</td><td>");
+                       wc_printf("<a href=\"openid_detach?id_to_detach=");
                        urlescputs(buf);
-                       wprintf("\" onClick=\"return confirm('%s');\">",
+                       wc_printf("\" onClick=\"return confirm('%s');\">",
                                _("Do you really want to delete this OpenID?"));
-                       wprintf("%s</a>", _("(delete)"));
-                       wprintf("</td></tr>\n");
+                       wc_printf("%s</a>", _("(delete)"));
+                       wc_printf("</td></tr>\n");
                }
        
-               wprintf("</table><br />\n");
+               wc_printf("</table><br />\n");
        
-               wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
-               wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WCC->nonce);
-               wprintf(_("Add an OpenID: "));
-               wprintf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
-               wprintf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
+               wc_printf("<form method=\"POST\" action=\"openid_attach\">\n");
+               wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WCC->nonce);
+               wc_printf(_("Add an OpenID: "));
+               wc_printf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
+               wc_printf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
                        "</form></center>\n", _("Attach"));
        }
 
        else {
-               wprintf(_("%s does not permit authentication via OpenID."), ChrPtr(WCC->serv_info->serv_humannode));
+               wc_printf(_("%s does not permit authentication via OpenID."), ChrPtr(WCC->serv_info->serv_humannode));
        }
 
        do_template("endbox", NULL);
-       wprintf("</div>");
+       wc_printf("</div>");
        wDumpContent(2);
 }
 
@@ -68,15 +66,14 @@ void openid_attach(void) {
        char buf[4096];
 
        if (havebstr("attach_button")) {
-               wcsession *WCC = WC;
 
                lprintf(CTDL_DEBUG, "Attempting to attach %s\n", bstr("openid_url"));
 
                snprintf(buf, sizeof buf,
-                        "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
-                        bstr("openid_url"),
-                        (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->HR.http_host),
-                        (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->HR.http_host)
+                       "OIDS %s|%s/finalize_openid_login|%s",
+                       bstr("openid_url"),
+                       ChrPtr(site_prefix),
+                       ChrPtr(site_prefix)
                );
 
                serv_puts(buf);