1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

check_query_token()

This commit is contained in:
psyc://psyced.org/~lynX 2010-03-02 23:45:06 +01:00
parent 6e5c5b98db
commit 8c6522112a
3 changed files with 16 additions and 12 deletions

View file

@ -7,6 +7,7 @@
#include <net.h>
#include <services.h>
#include <proto.h>
#include "driver.h"
//#include CONFIG_PATH "ports.h"
@ -216,3 +217,13 @@ varargs string make_query_string(mapping params, int sort) {
return q;
}
object check_query_token(mapping query) {
string nick;
object user;
if (nick = query["user"]) user = find_person(nick);
if (user && user->validToken(query["token"])) return user;
return 0;
}