getUtente($handle, $_GET["id"]); } else { header("location: login.php"); } } else { if (isset($_SESSION["UtenteID"])) { if (isset($_GET["a"])) { $azione = $_GET["a"]; // --------------------------------------------------------------- MODIFICA PASSWORD if ($azione == "R2") { $azione = "R1"; if ($_POST["Password1"] != "" && $_POST["Password2"] != "") { if ($_POST["Password1"] == $_POST["Password2"]) { $utente->modUtentePassword($handle, $_POST["Password1"]); $alertJS = "Password correttamente modificata!"; $azione = ""; } else { $alertJS = "Le due password inserite non coincidono!"; } } else { $alertJS = "La nuova password va inserita due volte!"; } } // --------------------------------------------------------------- MODIFICA DATI PERSONALI if ($azione == "U2") { $azione = "U1"; if ($_POST["Email"] != "") { if (checkEmail($_POST["Email"])) { $mostraEmail = 0; if (isset($_POST["MostraEmail"])) { if ($_POST["MostraEmail"] == "on") { $mostraEmail = 1; } } $utente->modUtenteData($handle, $_POST["Descrizione"], $_POST["Email"], $_POST["Telefono"], $mostraEmail, $_POST["ZonaAttiva"]); $alertJS = "Dati correttamente modificati!"; $azione = ""; } else { $alertJS = "La mail inserita non è valida!"; } } else { $alertJS = "La mail non può essere vuota!"; } } // --------------------------------------------------------------- MODIFICA FOTO if ($azione == "I2") { $azione = "I1" ; if (isset($_FILES['Foto'])) { if (is_uploaded_file($_FILES['Foto']['tmp_name'])) { $allowedExtensions = array("jpg", "jpeg", "gif", "png"); if (in_array(end(explode(".", strtolower($_FILES['Foto']['name']))), $allowedExtensions)) { $utente->uploadFoto($handle, $_FILES['Foto']); $alertJS = "Foto correttamente aggiornata!"; $azione = ""; } else { $alertJS = "Formato non valido della foto, sono accettate solo GIF, PNG e JPG!"; } } else { $alertJS = "Problemi nel caricamento della foto!"; } } else { $alertJS = "Non è stata selezionata nessuna immagine!"; } } } } else { header("location: login.php"); } } if (!isset($_GET["id"])) { $display = true; switch ($azione) { case "R1": ?>