|
@@ -346,7 +346,7 @@ |
346 |
346 |
|
if (!is_null($row)) { |
347 |
347 |
|
$status["return"] = 0; |
348 |
348 |
|
$status["id"] = $user_id; |
349 |
|
- |
$status["avatar"] = IMAGE_SERVER.AVATAR_PATH.$row["avatar"]; |
|
349 |
+ |
$status["avatar"] = ($row["avatar"] != "") ? IMAGE_SERVER.AVATAR_PATH.$row["avatar"] : ""; |
350 |
350 |
|
} else { |
351 |
351 |
|
$status = createErrorMessage(1, "User ID non disponibile"); |
352 |
352 |
|
//$status["return"] = 1; |
|
@@ -464,16 +464,27 @@ |
464 |
464 |
|
SET utente.is_active=0, utente.token='', locale.hidden=1 |
465 |
465 |
|
WHERE utente.id=".$user_id." AND locale.id_utente_owner=".$user_id;*/ |
466 |
466 |
|
|
467 |
|
- |
$query = "UPDATE utente,locale |
468 |
|
- |
SET utente.is_active=0, utente.token='', locale.hidden=1 |
469 |
|
- |
WHERE utente.id=:id_utente AND locale.id_utente_owner=:id_utente_owner"; |
|
467 |
+ |
$queryUtente = "UPDATE utente |
|
468 |
+ |
SET is_active=0, token='' |
|
469 |
+ |
WHERE id=:id_utente"; |
470 |
470 |
|
|
471 |
471 |
|
try { |
472 |
|
- |
$stmt = $this->db->prepare($query); |
|
472 |
+ |
$stmt = $this->db->prepare($queryUtente); |
473 |
473 |
|
$stmt->bindParam(':id_utente', $user_id); |
474 |
|
- |
$stmt->bindParam(':id_utente_owner', $user_id); |
475 |
|
- |
$stmt->execute(); |
|
474 |
+ |
$resultUtente = $stmt->execute(); |
476 |
475 |
|
|
|
476 |
+ |
if ($resultUtente) { |
|
477 |
+ |
$queryLocale = "UPDATE locale |
|
478 |
+ |
SET hidden=1 |
|
479 |
+ |
WHERE id_utente_owner=:id_utente_owner"; |
|
480 |
+ |
|
|
481 |
+ |
$stmt = $this->db->prepare($queryLocale); |
|
482 |
+ |
$stmt->bindParam(':id_utente_owner', $user_id); |
|
483 |
+ |
$stmt->execute(); |
|
484 |
+ |
} else { |
|
485 |
+ |
$status = createErrorMessage(1, "Errore DB"); |
|
486 |
+ |
return $status; |
|
487 |
+ |
} |
477 |
488 |
|
//$this->db->exec($query); |
478 |
489 |
|
$status["return"] = 0; |
479 |
490 |
|
return $status; |
|
@@ -491,15 +502,27 @@ |
491 |
502 |
|
SET utente.is_active=1, locale.hidden=0 |
492 |
503 |
|
WHERE utente.id=".$user_id." AND locale.id_utente_owner=".$user_id;*/ |
493 |
504 |
|
|
494 |
|
- |
$query = "UPDATE utente,locale |
495 |
|
- |
SET utente.is_active=1, locale.hidden=0 |
496 |
|
- |
WHERE utente.id=:id_utente AND locale.id_utente_owner=:id_utente_owner"; |
|
505 |
+ |
$queryUtente = "UPDATE utente |
|
506 |
+ |
SET is_active=1 |
|
507 |
+ |
WHERE id=:id_utente"; |
497 |
508 |
|
|
498 |
509 |
|
try { |
499 |
|
- |
$stmt = $this->db->prepare($query); |
|
510 |
+ |
$stmt = $this->db->prepare($queryUtente); |
500 |
511 |
|
$stmt->bindParam(':id_utente', $user_id); |
501 |
|
- |
$stmt->bindParam(':id_utente_owner', $user_id); |
502 |
|
- |
$stmt->execute(); |
|
512 |
+ |
$resultUtente = $stmt->execute(); |
|
513 |
+ |
|
|
514 |
+ |
if ($resultUtente) { |
|
515 |
+ |
$queryLocale = "UPDATE locale |
|
516 |
+ |
SET hidden=0 |
|
517 |
+ |
WHERE id_utente_owner=:id_utente_owner"; |
|
518 |
+ |
|
|
519 |
+ |
$stmt = $this->db->prepare($queryLocale); |
|
520 |
+ |
$stmt->bindParam(':id_utente_owner', $user_id); |
|
521 |
+ |
$stmt->execute(); |
|
522 |
+ |
} else { |
|
523 |
+ |
$status = createErrorMessage(1, "Errore DB"); |
|
524 |
+ |
return $status; |
|
525 |
+ |
} |
503 |
526 |
|
|
504 |
527 |
|
//$this->db->exec($query); |
505 |
528 |
|
$status["return"] = 0; |