note description: "Summary description for {OPENID_CMS_EXECUTION}." date: "$Date$" revision: "$Revision$" class OPENID_CMS_EXECUTION inherit CMS_EXECUTION create make feature -- Execution process local b: STRING f: CMS_FORM tf: CMS_FORM_TEXT_INPUT ts: CMS_FORM_SUBMIT_INPUT o: OPENID_CONSUMER v: OPENID_CONSUMER_VALIDATION tb: HASH_TABLE [READABLE_STRING_8, STRING_8] l_uid: INTEGER do create b.make_empty set_title ("OpenID identities") if attached request.string_item ("openid.mode") as l_openid_mode then -- Callback create o.make (request.absolute_script_url ("/openid/login")) o.ask_email (True) o.ask_nickname (False) -- o.ask_all_info (False) create v.make_from_items (o, request.items_as_string_items) v.validate if v.is_valid then if attached v.identity as l_identity then if attached user as u then if attached service.storage.custom_value (l_identity, "openid") as obj then l_uid := user_id_from_custom_value (obj) if l_uid > 0 and then l_uid = u.id then -- Authenticated b.append ("OpenID already associated to user %""+ user_link (u) +"%"") else -- Wrong USER !!! b.append ("OpenID already associated to another user !!!") end else -- New OpenID association create tb.make (1) tb.force (l_identity, "openid_identity") tb.force (u.id.out, "uid") service.storage.set_custom_value (l_identity, tb, "openid") b.append ("OpenID %""+ l_identity +"%" is now associated with user %""+ user_link (u) +"%"") end else if attached service.storage.custom_value (l_identity, "openid") as obj and then attached user_id_from_custom_value (obj) as obj_uid and then obj_uid > 0 and then attached service.storage.user_by_id (obj_uid.to_integer) as u then -- Authenticated set_user (u) b.append ("Authenticated as %""+ user_link (u) +"%"") set_redirection (user_url (u)) else -- Register new account b.append ("Register new account associated with Openid %"" + l_identity + "%"?") across v.attributes as c loop b.append ("