}
        //Author
        if (!($infosMessage['messageAuthorId'] == $_SESSION['id'])) {
            throw new Exception("Vous n'êtes pas l'auteur de ce message");
        }
        //Verify Pin
        if (!($infosMessage['messagePin'] == $_GET['pin'])) {
            throw new Exception("Erreur dans le code pin");
        }
        //BDD connection
        $bdd = LOFConnect();
        //Update Message
        $req = $bdd->prepare('UPDATE ' . $GLOBALS['LOF_BDD_TABLE_messages'] . ' SET content = :content WHERE id = ' . $_GET['id'] . ' AND pin = "' . $_GET['pin'] . '"');
        $req->execute(array('content' => $_POST['message']));
        LOF_successPopup("Mise à jour effectuer ! Rediction en cours...");
        ?>
        <META http-equiv="refresh" content="1;URL=/forum/post.php?id=<?php 
        echo $_GET['postId'];
        ?>
&page=<?php 
        echo $_GET['postPage'];
        ?>
">    
        <?php 
    } catch (Exception $e) {
        LOF_errorPopup($e->getMessage());
    }
}
?>

    $postData = $bdd->query($request);
    $post = $postData->fetch();
    if (!($post['messageAuthorId'] == $_SESSION['id'])) {
        throw new Exception("Vous n'&ecirc;tes pas l'auteur de ce message");
    }
    if ($_GET['action'] <= 0 && $_GET['action'] >= 2) {
        throw new Exception("Erreur dans le type d'action");
    }
    // Update post
    $reqForum = $bdd->query('UPDATE ' . $GLOBALS['LOF_BDD_TABLE_posts'] . ' SET postState = ' . $_GET['action'] . ' WHERE id = ' . $post['postId'] . ' AND pin = "' . $_GET['pin'] . '"');
    $bdd = null;
    if ($_GET['action'] == 1) {
        LOF_successPopup("<strong>Le sujet est considéré comme résolu !</strong> Vous pouvez toujours répondre mais, si votre question est identique mais la solution proposée ici ne fonctionne pas/plus merci de faire un nouveau sujet.");
    } else {
        if ($_GET['action'] == 2) {
            LOF_errorPopup("Le sujet que vous consultez a été fermé par son auteur, vous ne pouvez plus y répondre.");
        }
    }
    ?>
 
    <noscript><META http-equiv="refresh" content="2;URL=/forum/post.php?id=<?php 
    echo $_GET['postId'];
    ?>
&page=1"></noscript>
    <?php 
} catch (Exception $e) {
    header("HTTP/1.0 500 Internal Server Error");
    echo "Erreur interne : la lecture du message &agrave; &eacute;chou&eacute;e.";
    die;
}
?>