mirror of git://git.psyced.org/git/psyced
per-room web challenges and an ancient bug fixed
This commit is contained in:
parent
92aaf00fff
commit
b0b3d375a3
|
@ -14,6 +14,8 @@ vim:nosmarttab:syntax=diff
|
||||||
________________________________________________________________________
|
________________________________________________________________________
|
||||||
== NUISANCES worth fixing, possibly ====================================
|
== NUISANCES worth fixing, possibly ====================================
|
||||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
|
- how is it that /join #foo.bar tries to connect a host called foo.bar?
|
||||||
|
|
||||||
- offline messages not being output (which *can* work even with OTR!)
|
- offline messages not being output (which *can* work even with OTR!)
|
||||||
<<< did i fix that recently?
|
<<< did i fix that recently?
|
||||||
|
|
||||||
|
|
|
@ -168,8 +168,7 @@ process() {
|
||||||
P4(("found cookie: %O\n", t))
|
P4(("found cookie: %O\n", t))
|
||||||
if (t && sscanf(t, "psyced=\"%s\"", t)) {
|
if (t && sscanf(t, "psyced=\"%s\"", t)) {
|
||||||
P3(("got cookie: %O\n", t))
|
P3(("got cookie: %O\n", t))
|
||||||
query = url_parse_query(query, t);
|
qs = qs ? t+"&"+qs : t;
|
||||||
P4(("parsed cookie: %O\n", query))
|
|
||||||
}
|
}
|
||||||
#ifdef GENERIC_COOKIES // we might need them someday..?
|
#ifdef GENERIC_COOKIES // we might need them someday..?
|
||||||
// if within the same domain other cookies are being used, like
|
// if within the same domain other cookies are being used, like
|
||||||
|
@ -197,6 +196,8 @@ process() {
|
||||||
query = url_parse_query(query, body);
|
query = url_parse_query(query, body);
|
||||||
}
|
}
|
||||||
P4(("parsed query: %O\n", query))
|
P4(("parsed query: %O\n", query))
|
||||||
|
// remember original form of item in headers mapping
|
||||||
|
headers["item"] = item;
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case "/favicon.ico":
|
case "/favicon.ico":
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -610,6 +610,35 @@ htget(prot, query, headers, qs) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CHALLENGE_MATCH
|
||||||
|
#include <sys/regexp.h>
|
||||||
|
|
||||||
|
htget(prot, query, headers, qs, data, noprocess) {
|
||||||
|
if (query["challenge"] == "complete")
|
||||||
|
return ::htget(prot, query, headers, qs, data, noprocess);
|
||||||
|
string item = headers[item] || "/@"+ MYNICK;
|
||||||
|
if (query["challenge"] == "given" &&
|
||||||
|
# if __EFUN_DEFINED__(regmatch)
|
||||||
|
stringp(query["answer"]) &&
|
||||||
|
regmatch(lower_case(query["answer"]), CHALLENGE_MATCH, RE_MATCH_SUBS)
|
||||||
|
# else
|
||||||
|
query["answer"] == CHALLENGE_MATCH
|
||||||
|
# endif
|
||||||
|
) {
|
||||||
|
htredirect(prot, item, "Reload, please", 0, "Set-Cookie: psyced=\"challenge=complete\"; path="+ item +";\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sTextPath(query["layout"], query["lang"], "html");
|
||||||
|
// could add a timeout here...
|
||||||
|
htok3(prot, 0, "Set-Cookie: psyced=\"challenge=given\"; path="+ item +";\n");
|
||||||
|
w("_PAGES_group_challenge", 0,
|
||||||
|
([ "_challenge" : htquote(CHALLENGE_QUESTION),
|
||||||
|
"_nick_place" : MYNICK ]) );
|
||||||
|
printf("%O (%O) in %O\n", query, qs, headers);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HISTORY
|
#ifdef HISTORY
|
||||||
# if defined(HISTORY_METHOD) || defined(HISTORY_MAY_LOG)
|
# if defined(HISTORY_METHOD) || defined(HISTORY_MAY_LOG)
|
||||||
mayLog(mc) {
|
mayLog(mc) {
|
||||||
|
|
Loading…
Reference in New Issue