The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
token base auth - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: token base auth (/showthread.php?tid=229) |
token base auth - niradler - 08-26-2016 //Retrieve complete user information by username, token or ID function fetchUserDetails($username=NULL,$token=NULL, $id=NULL){ if($username!=NULL) { $column = "username"; $data = $username; }elseif($id!=NULL) { $column = "id"; $data = $id; } $db = DB::getInstance(); $query = $db->query("SELECT * FROM users WHERE $column = $data LIMIT 1"); $results = $query->first(); return ($results); } how can i connect token to a user im trying to make userspice a backend to an app. something like restfulapi |