mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
web challenge redirects
This commit is contained in:
parent
4f7fb2cebe
commit
372e704a58
6 changed files with 50 additions and 30 deletions
|
@ -146,6 +146,12 @@
|
|||
# echo Please fix your #define REGISTERED_USERS_ONLY
|
||||
# define _flag_disable_unauthenticated_users
|
||||
#endif
|
||||
#ifdef _flag_disable_unauthenticated_users
|
||||
# define _flag_disable_unauthenticated_users_XMPP
|
||||
#endif
|
||||
#ifdef _flag_disable_registration
|
||||
# define _flag_disable_registration_XMPP
|
||||
#endif
|
||||
|
||||
#ifdef RELAY
|
||||
# define _flag_disable_authorization
|
||||
|
|
|
@ -616,12 +616,20 @@ htget(prot, query, headers, qs) {
|
|||
// maybe this all belongs into archetype.gen.. chesmo!
|
||||
htget(prot, query, headers, qs, data, noprocess) {
|
||||
if (stringp(headers["cookie"]) && regmatch(headers["cookie"],
|
||||
"challenge=complete&answer="+ md5(CHALLENGE_MATCH)))
|
||||
# ifdef HTGET
|
||||
return HTGET;
|
||||
"challenge=complete&answer="+ md5(CHALLENGE_MATCH))) {
|
||||
htnotify(query, headers, "_accomplished_web",
|
||||
"Challenge accomplished in [_nick_place] by [_web_on] coming from [_web_from].");
|
||||
# ifdef CHALLENGE_REDIRECT
|
||||
return htredirect(prot, CHALLENGE_REDIRECT);
|
||||
# else
|
||||
return ::htget(prot, query, headers, qs, data, noprocess);
|
||||
# ifdef HTGET
|
||||
// you may want to output a player iframe instead of a redirect...
|
||||
return HTGET;
|
||||
# else
|
||||
return ::htget(prot, query, headers, qs, data, noprocess);
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
string item = headers[item] || "/@"+ MYNICK;
|
||||
if (stringp(query["answer"]) && headers["cookie"] &&
|
||||
regmatch(headers["cookie"], "challenge=given") &&
|
||||
|
@ -645,6 +653,8 @@ htget(prot, query, headers, qs, data, noprocess) {
|
|||
"_parameters" : query["parameters"] || qs,
|
||||
"_nick_place" : MYNICK ]) );
|
||||
// printf("%O vs %O\n", query, headers);
|
||||
htnotify(query, headers, "_challenged_web",
|
||||
"[_nick_place] challenges [_web_on] coming from [_web_from].");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue