Beispiel #1
0
         //just some helpful status information for the caller
         $msg->statuscode = 0;
         $msg->statusdesc = "Login successful";
     } else {
         //bad credentials
         $msg->statuscode = 1;
         $msg->statusdesc = "Invalid user name or password";
     }
     header("Content-type: application/json");
     echo json_encode($msg);
     //serialize the UATokenMessage
     break;
 case "getTokenFromPasswordRecovery":
     $msg = new UATokenMessage();
     $password = new PasswordRecovery($req->password->email, $req->password->password);
     if ($password->checkEmailAddress($email)) {
         if (tempPassword($email)) {
             $msg->statuscode = 0;
             $msg->statusdesc = "New password sent!";
         }
     } else {
         //bad credentials
         $msg->statuscode = 1;
         $msg->statusdesc = "Error!";
     }
     break;
 case "getTradeHistoryFromToken":
     $userID = sp_getUserIdFromToken($token);
     $history = new TradeHistory($userID);
     $history->mysql_query("CALL getTradeHistory(userID)") or die('Could not locate trade history: ' . mysql_error());
     break;