// this code contributed from symlynX webchat. currently not in use. #include #include #include #include #include #define NO_INHERIT #include #undef NO_INHERIT // #define v(VAR) user->vQuery(VAR) htget(prot, query, headers, qs) { string nick, lang, layout, token; mixed user; mapping _v, sups; int newbie; P2(("edit query: %O\n", query)) nick = query["user"]; user = find_person(nick); token = query["token"]; lang = query["lang"]; sTextPath(0, lang, "ht"); htok(prot); unless (nick && user && user->validToken(token)) { write( hthead("edit") + T("_PAGES_edit_invalid", "Who are you?
")); return 1; } // unless (newbie = user->isNewbie()) _v = user->vMapping(); _v = user->vMapping() || ([]); unless (lang) lang = v("language"); //newbie = v("password") == 0; newbie = user->isNewbie(); if (v("name")) nick = v("name"); sups = v("subscriptions") || ([]); #define FORM_HIDDEN "\n\ \n\ \n\ \n\ " #define FORM_OPTS " name=f method=GET action=\"/"+layout+"/modify\"" #ifdef VOLATILE # define FORM_START "" FORM_HIDDEN, // "_FORM_start_check_email" : FORM_START "\ onSubmit=\"return checkEmail(f.email.value)\">" FORM_HIDDEN, "_FORM_start" : FORM_START "\ onSubmit=\"return check(f)\">" FORM_HIDDEN, "_FORM_end" : "", "_nick" : nick, "_EDIT_nick" : v("name") || nick, "_EDIT_nick_size" : strlen(v("name") || nick), "_EDIT_email" : v("email") || "", #if 1 "_EDIT_subscription_events_weekly" : member(sups,"events-weekly")? "checked": "", "_EDIT_subscription_politik_digital" : member(sups,"poldi")? "checked": "", #ifdef VOLATILE "_EDIT_subscription_events" : "checked", #else "_EDIT_subscription_events" : newbie||member(sups,"events")? "checked": "", # ifdef NEWSTICKER "_EDIT_subscription_politik" : member(sups,"dpa-pl")? "checked": "", "_EDIT_subscription_wirtschaft" : member(sups,"dpa-wi")? "checked": "", "_EDIT_subscription_vermischtes": member(sups,"dpa-vm")? "checked": "", # endif #endif "_EDIT_place_home" : v("home") || "", "_EDIT_color" : v("color") || "", // no longer up to date here.. // might not behave exactly as intended "_EDIT_checkbox_filter" : v("filter") == FILTER_STRANGERS ? "checked" : "", "_EDIT_checkbox_colors_ignored" : v("ignorecolors") ? "checked" : "", "_EDIT_checkbox_visibility" : v("visibility") == "off" ? "" : "checked", "_EDIT_action_speak" : v("speakaction") || "", "_EDIT_action_motto" : v("me") || "", "_EDIT_page_public" : v("publicpage") || "", "_EDIT_page_private" : v("privatepage") || "", "_EDIT_file_key_public" : v("keyfile") || "", "_EDIT_description_private" : v("privatetext") || "", "_EDIT_description_public" : v("publictext") || "", "_EDIT_description_preferences" : v("likestext") || "", "_EDIT_description_preferences_not" : v("dislikestext") || "", "_EDIT_favorite_animal" : v("animalfave") || "", "_EDIT_favorite_popstar" : v("popstarfave") || "", "_EDIT_favorite_music" : v("musicfave") || "", "_EDIT_page_start" : v("startpage") || "", #endif ]) )); write("
Room Subscriptions
\n"); foreach(mixed key, mixed val : v("subscriptions")) { // note: the immediateness is not really used these days write("\n"); } write("
\n"); // build unified data structure for contacts mapping paliases = ([ ]); foreach(mixed key, mixed val : v("people")) { paliases[key] = ({ 0, val }); } foreach(mixed key, mixed val : v("aliases")) { if (paliases[val]) paliases[val][0] = key; else paliases[val] = ({ key, 0 }); } // make a link to a edit page for each contact? write("
Friends
\n"); foreach(mixed key, mixed val : paliases) { // note: look at val to determine status write("
" + (val[0] || key) + ""); if (val[1]) write(sprintf("subscription state %O\n", val[1])); write("
\n"); } write("
\n"); return 1; }