Subversion Repository Public Repository

Nextrek

Diff Revisions 611 vs 612 for /Android/SmartCharging/endPoints/repositories/UserRepository.php

Diff revisions: vs.
  @@ -344,9 +344,9 @@
344 344
345 345 public function deleteUser($user_id) {
346 346 $status = array();
347 - $query = "UPDATE utente
348 - SET is_active=0, token=''
349 - WHERE id=".$user_id;
347 + $query = "UPDATE utente,locale
348 + SET utente.is_active=0, utente.token='', locale.hidden=1
349 + WHERE utente.id=".$user_id." AND locale.id_utente_owner=".$user_id;
350 350
351 351 try {
352 352 $this->db->exec($query);
  @@ -362,9 +362,9 @@
362 362
363 363 public function enableUser($user_id) {
364 364 $status = array();
365 - $query = "UPDATE utente
366 - SET is_active=1
367 - WHERE id=".$user_id;
365 + $query = "UPDATE utente,locale
366 + SET utente.is_active=1, locale.hidden=0
367 + WHERE utente.id=".$user_id." AND locale.id_utente_owner=".$user_id;
368 368
369 369 try {
370 370 $this->db->exec($query);