Exemplo n.º 1
0
     }
     if (isset($_REQUEST['s'])) {
         $CreateSession = $_REQUEST['s'] == "true" ? true : false;
     } else {
         return;
     }
     $DB = new Database();
     $InUse = $DB->ValidateUserCredentials($EmailAddress, $Password);
     $ValidCredentials = $InUse > 0 ? true : false;
     if ($ValidCredentials && $CreateSession) {
         $Profile = $DB->GetUserProfile($EmailAddress);
         if ($Profile->validated != 1) {
             print JSONResponse::PrepareResponse(false, "Authentication status enclosed", "Email not confirmed");
             die;
         } else {
             UserManagement::CreateSession($EmailAddress);
         }
     }
     print JSONResponse::PrepareResponse($ValidCredentials, "Authentication status enclosed", $InUse);
     break;
 case 'stocklookup':
     if (isset($_REQUEST['s'])) {
         $Search = $_REQUEST['s'];
     } else {
         return;
     }
     $DB = new Database();
     $Results = $DB->StockLookup($Search);
     print JSONResponse::PrepareResponse(count($Results) > 0, "Lookup enclosed", $Results);
     break;
 case 'complexstocksearch':