*/
void display_openids(void)
{
+ wcsession *WCC = WC;
char buf[1024];
int bg = 0;
wprintf("<div class=\"fix_scrollbar_bug\">");
svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
- do_template("beginbox", NULL);
+ do_template("beginboxx", NULL);
- if (serv_info.serv_supports_openid) {
+ if (WCC->serv_info->serv_supports_openid) {
wprintf("<table class=\"altern\">");
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\">"
}
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", NULL);
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);
http_redirect(&buf[4]);
return;
}
+ else {
+ lprintf(CTDL_DEBUG, "OpenID attach failed: %s\n", &buf[4]);
+ }
}
/* If we get to this point then something failed. */
InitModule_OPENID
(void)
{
- WebcitAddUrlHandler(HKEY("display_openids"), display_openids, 0);
- WebcitAddUrlHandler(HKEY("openid_attach"), openid_attach, 0);
- WebcitAddUrlHandler(HKEY("openid_detach"), openid_detach, 0);
+ WebcitAddUrlHandler(HKEY("display_openids"), "", 0, display_openids, 0);
+ WebcitAddUrlHandler(HKEY("openid_attach"), "", 0, openid_attach, 0);
+ WebcitAddUrlHandler(HKEY("openid_detach"), "", 0, openid_detach, 0);
}