9 * Display the OpenIDs associated with an account
11 void display_openids(void)
15 output_headers(1, 1, 1, 0, 0, 0);
17 wprintf("<div class=\"fix_scrollbar_bug\">");
19 svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
20 do_template("beginbox");
23 serv_getln(buf, sizeof buf);
24 if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
31 wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
32 wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
33 wprintf(_("Add an OpenID: "));
34 wprintf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
35 wprintf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
36 "</form></center>\n", _("Attach"));
37 do_template("endbox");
44 * Attempt to attach an OpenID to an existing, logged-in account
46 void openid_attach(void) {
49 if (havebstr("attach_button")) {
50 lprintf(CTDL_DEBUG, "Attempting to attach %s\n", bstr("openid_url"));
52 snprintf(buf, sizeof buf,
53 "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
55 (is_https ? "https" : "http"), WC->http_host,
56 (is_https ? "https" : "http"), WC->http_host
60 serv_getln(buf, sizeof buf);
62 lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
63 http_redirect(&buf[4]);
68 /* If we get to this point then something failed. */