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:
parent
6e5c5b98db
commit
8c6522112a
3 changed files with 16 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue