From 9d0b51a2abdacb5fc4eed95cb3249934b607fdc7 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 9 Feb 2019 00:04:45 +0800 Subject: Navigator. --- xp/navigator/shit.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 xp/navigator/shit.php (limited to 'xp/navigator/shit.php') diff --git a/xp/navigator/shit.php b/xp/navigator/shit.php new file mode 100644 index 0000000..8602a94 --- /dev/null +++ b/xp/navigator/shit.php @@ -0,0 +1,38 @@ +query(sprintf('select passwd from navigator_user where username=\'%s\'',$usrname)); + if($qr->rowCount()!=1){return array('result'=>1);} + if($passwd!=$qr->fetchColumn(0)){return array('result'=>1);} + $token=uniqid(); + $pdo->query(sprintf('insert into navigator_session values(\'%s\',\'%s\',\'%s\',%d)', + $usrname,$passwd,$sessname,time())); + $pdo->commit(); + {return array('result'=>0,'token'=>$token);} + } + $pdo=new PDO('mysql:host=localhost;dbname=chrisoft','chrisoft',null); + $o=json_decode(file_get_contents('php://stdin')); + $r=null; + switch($o['op']) + { + case 0: + $r=do_login($pdo,$o); + break; + case 1: + //get bookmarks + break; + case 2: + //set bookmarks + break; + case 3: + //list sessions + break; + case 4: + //remove session + break; + } + echo json_encode($r); +?> -- cgit v1.2.3