X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fopenid%2Fserv_openid_rp.c;h=7bd6867e681cfe47891ab1a20d44f054daf8fc78;hb=21bb16339cb082e159289757403cc2b7c8884c2d;hp=0a676f70016bd0170da8845cc52dd66c68d6d5c9;hpb=8b4b908a8f3867b4c4e22c054f0097cac6f4f2c0;p=citadel.git diff --git a/citadel/modules/openid/serv_openid_rp.c b/citadel/modules/openid/serv_openid_rp.c index 0a676f700..7bd6867e6 100644 --- a/citadel/modules/openid/serv_openid_rp.c +++ b/citadel/modules/openid/serv_openid_rp.c @@ -223,6 +223,7 @@ void cmd_oidd(char *argbuf) { int openid_create_user_via_sri(char *claimed_id, HashList *sri_keys) { char *desired_name = NULL; + char new_password[32]; if (config.c_auth_mode != AUTHMODE_NATIVE) return(1); if (config.c_disable_newu) return(2); @@ -240,10 +241,13 @@ int openid_create_user_via_sri(char *claimed_id, HashList *sri_keys) /* The desired account name is available. Create the account and log it in! */ if (create_user(desired_name, 1)) return(6); + snprintf(new_password, sizeof new_password, "%08lx%08lx", random(), random()); + CtdlSetPassword(new_password); attach_openid(&CC->user, claimed_id); return(0); } +// FIXME we still have to set up the vCard // identity = [50] http://uncensored.citadel.org/~ajc/MyID.config.php // sreg.nickname = [17] IGnatius T Foobar @@ -272,6 +276,8 @@ int login_via_openid(char *claimed_id) cdb_free(cdboi); if (!getuserbynumber(&CC->user, usernum)) { + /* Now become the user we just created */ + safestrncpy(CC->curr_user, CC->user.fullname, sizeof CC->curr_user); do_login(); return(0); }