Subversion Repository Public Repository

Nextrek

Diff Revisions 708 vs 709 for /Android/SmartCharging/endPoints/nightly/repositories/UserRepository.php

Diff revisions: vs.
  @@ -22,10 +22,15 @@
22 22
23 23 public static function checkToken($token, $conn) {
24 24 try {
25 - $queryToken = "SELECT id FROM utente WHERE token='".$token."'";
26 - //echo "<br/>".$queryToken."<br/>";
27 - $result = $conn->query($queryToken);
28 - return ($result->rowCount()>0);
25 + //$queryToken = "SELECT id FROM utente WHERE token='".$token."'";
26 + $queryToken = "SELECT id FROM utente WHERE token=:token";
27 + $stmt = $conn->prepare($queryToken);
28 + $stmt->bindParam(':token', $token);
29 + $result = $stmt->execute();
30 +
31 + var_dump($result);
32 +
33 + return ($stmt->rowCount()>0);
29 34 } catch (PDOException $e) {
30 35 echo $e->getMessage();
31 36 return false;