if (WC->logged_in) {
if (WC->need_regi) {
display_reg(1);
+ } else if (WC->need_vali) {
+ validate();
} else {
do_welcome();
}
void finalize_openid_login(void)
{
char buf[1024];
+ struct wcsession *WCC = WC;
+ int already_logged_in = (WCC->logged_in) ;
if (havebstr("openid.mode")) {
if (!strcasecmp(bstr("openid.mode"), "id_res")) {
-// openid.mode = [6] id_res
-// openid.identity = [50] http://uncensored.citadel.org/~ajc/MyID.config.php
-// openid.assoc_handle = [26] 6ekac3ju181tgepk7v4h9r7ui7
-// openid.return_to = [42] http://jemcaterers.net/finish_openid_login
-// openid.sreg.nickname = [17] IGnatius T Foobar
-// openid.sreg.email = [26] ajc@uncensored.citadel.org
-// openid.sreg.fullname = [10] Art Cancro
-// openid.sreg.postcode = [5] 10549
-// openid.sreg.country = [2] US
-// openid.signed = [102] mode,identity,assoc_handle,return_to,sreg.nickname,sreg.email,sreg.fullname,sreg.postcode,sreg.country
-// openid.sig = [28] vixxxU4MAqWfxxxxCfrHv3TxxxhEw=
-
// FIXME id accepted but the code isn't finished
- serv_printf("OIDF %s", bstr("openid.assoc_handle"));
+ serv_puts("OIDF");
serv_getln(buf, sizeof buf);
- display_openid_login(buf);
- return;
+ if (buf[0] == '8') {
+ urlcontent *u;
+ void *U;
+ long HKLen;
+ char *HKey;
+ HashPos *Cursor;
+
+ Cursor = GetNewHashPos ();
+ while (GetNextHashPos(WCC->urlstrings, Cursor, &HKLen, &HKey, &U)) {
+ u = (urlcontent*) U;
+ if (!strncasecmp(u->url_key, "openid.", 7)) {
+ serv_printf("%s|%s", &u->url_key[7], u->url_data);
+ }
+ }
+
+ serv_puts("000");
+
+ while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+ // FIXME
+ }
+ }
}
}
+ /* If we were already logged in, this was an attempt to associate an OpenID account */
+ if (already_logged_in) {
+ display_openids();
+ return;
+ }
+
+ /* Otherwise the user is probably attempting to log in using OpenID */
if (WC->logged_in) {
if (WC->need_regi) {
display_reg(1);
}
-
-
-
-
-
-
/*
- * display the user a welcome screen.
+ * Display a welcome screen to the user.
*
- * if this is the first time login, and the web based setup is enabled,
+ * If this is the first time login, and the web based setup is enabled,
* lead the user through the setup routines
*/
void do_welcome(void)