Subversion Repository Public Repository

Nextrek

Diff Revisions 568 vs 569 for /Android/SmartCharging/endPoints/nightly/repositories/UserRepository.php

Diff revisions: vs.
  @@ -84,11 +84,16 @@
84 84
85 85 }
86 86
87 - public function loginUser($username, $password) {
87 + public function loginUser($username, $password, $is_admin) {
88 88 $status = array();
89 89
90 90 try {
91 91 $query = "SELECT id, password, email, is_owner FROM utente WHERE username='".$username."' AND is_active=1";
92 +
93 + if ($is_admin) {
94 + $query = $query." AND is_admin=1";
95 + }
96 +
92 97 $result = $this->db->query($query);
93 98 $row = ($result->rowCount()>0) ? $result->fetch() : null;
94 99