9 * Display the OpenIDs associated with an account
11 void display_openids(void)
16 output_headers(1, 1, 1, 0, 0, 0);
18 wprintf("<div class=\"fix_scrollbar_bug\">");
20 svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
21 do_template("beginbox");
23 wprintf("<table class=\"altern\">");
26 serv_getln(buf, sizeof buf);
27 if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
29 wprintf("<tr class=\"%s\">", (bg ? "even" : "odd"));
30 wprintf("<td><img src=\"static/openid-small.gif\"></td><td>");
32 wprintf("</td><td>%s</td></tr>\n", _("(delete)") ); // FIXME implement delete
35 wprintf("</table><br />\n");
37 wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
38 wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
39 wprintf(_("Add an OpenID: "));
40 wprintf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
41 wprintf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
42 "</form></center>\n", _("Attach"));
43 do_template("endbox");
50 * Attempt to attach an OpenID to an existing, logged-in account
52 void openid_attach(void) {
55 if (havebstr("attach_button")) {
56 lprintf(CTDL_DEBUG, "Attempting to attach %s\n", bstr("openid_url"));
58 snprintf(buf, sizeof buf,
59 "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
61 (is_https ? "https" : "http"), WC->http_host,
62 (is_https ? "https" : "http"), WC->http_host
66 serv_getln(buf, sizeof buf);
68 lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
69 http_redirect(&buf[4]);
74 /* If we get to this point then something failed. */