* move stuff from Hdr into substruct that may be easily wiped by memset 0'ing them
[citadel.git] / webcit / openid.c
index 58c3503ab46049cc8f4aee249dfeb82fbade4c2a..75ced9909d587b76bb544261d209696d15c1b037 100644 (file)
@@ -10,6 +10,7 @@
  */
 void display_openids(void)
 {
+       wcsession *WCC = WC;
        char buf[1024];
        int bg = 0;
 
@@ -18,9 +19,9 @@ void display_openids(void)
        wprintf("<div class=\"fix_scrollbar_bug\">");
 
        svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
-       do_template("beginbox");
+       do_template("beginboxx", NULL);
 
-       if (serv_info.serv_supports_openid) {
+       if (WCC->serv_info->serv_supports_openid) {
 
                wprintf("<table class=\"altern\">");
        
@@ -43,7 +44,7 @@ void display_openids(void)
                wprintf("</table><br />\n");
        
                wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
-               wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
+               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\">"
@@ -51,10 +52,10 @@ void display_openids(void)
        }
 
        else {
-               wprintf(_("%s does not permit authentication via OpenID."), serv_info.serv_humannode);
+               wprintf(_("%s does not permit authentication via OpenID."), ChrPtr(WCC->serv_info->serv_humannode));
        }
 
-       do_template("endbox");
+       do_template("endbox", NULL);
        wprintf("</div>");
        wDumpContent(2);
 }
@@ -67,13 +68,15 @@ 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"), WC->http_host,
-                       (is_https ? "https" : "http"), WC->http_host
+                        "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)
                );
 
                serv_puts(buf);