9 * Display the OpenIDs associated with an account
11 void display_openids(void)
13 output_headers(1, 1, 1, 0, 0, 0);
15 wprintf("<div class=\"fix_scrollbar_bug\">");
17 svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
18 do_template("beginbox");
20 wprintf("FIXME -- we have to list the existing ones here");
24 wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
25 wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
26 wprintf(_("Add an OpenID: "));
27 wprintf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
28 wprintf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
29 "</form></center>\n", _("Attach"));
30 do_template("endbox");
37 * Attempt to attach an OpenID to an existing, logged-in account
39 void openid_attach(void) {
42 if (havebstr("attach_button")) {
43 lprintf(CTDL_DEBUG, "Attempting to attach %s\n", bstr("openid_url"));
45 snprintf(buf, sizeof buf,
46 "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
48 (is_https ? "https" : "http"), WC->http_host,
49 (is_https ? "https" : "http"), WC->http_host
53 serv_getln(buf, sizeof buf);
55 lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
56 http_redirect(&buf[4]);
61 /* If we get to this point then something failed. */