コード例 #1
0
$_POST = array_map('strip_tags', $_POST);
$commentDate = getdate();
$errors = [];
$msg = "error";
if (isset($_POST['submit'])) {
    // Récupère les données de l'article à sauvegarder
    $commentToEdit['id_article'] = $_POST['id_article'];
    $commentToEdit['author_comment'] = $_POST['author_comment'];
    $commentToEdit['content_comment'] = $_POST['content_comment'];
    $commentToEdit['emailauthor_comment'] = $_POST['emailauthor_comment'];
    $commentToEdit['gresponse'] = $_POST['g-recaptcha-response'];
    if (isset($commentToEdit['date_comment'])) {
        $commentDate = array_reverse(array_values($commentToEdit['date_comment']));
    }
    // sauvegarde d'un article
    $errors = validComment($commentToEdit);
    //verifiyIdentity()
    if (empty($errors)) {
        $commentToEdit['date_article'] = implode("-", $commentDate);
        saveComment($commentToEdit);
        $msg = "ok";
    }
    header('Location: index.php?id=' . $commentToEdit['id_article'] . "&msg={$msg}");
    exit;
} else {
    if (isset($_GET['id']) && isset($_SESSION['id_user'])) {
        moderateComment($_GET['id'], getUserById($_SESSION['id_user']));
    }
}
header('Location: index.php');
exit;
コード例 #2
0
Copyright (c) 1998-2014 Syncro Soft SRL, Romania.  All rights reserved.
Licensed under the terms stated in the license file EULA_Webhelp.txt 
available in the base directory of this Oxygen Webhelp plugin.
*/
require_once 'init.php';
if (isset($_POST['id']) && trim($_POST['id']) != '') {
    $encoded = $_POST['id'];
    $decoded = base64_decode($encoded);
    list($id, $action) = explode("&", $decoded);
    $fullUser = base64_encode($_POST['productName'] . "_" . $_POST['productVersion'] . "_user");
    $commentedPage = moderateComment($id, $action, $fullUser);
    echo __BASE_URL__ . $commentedPage;
} else {
    if (isset($_POST['uncodedId']) && trim($_POST['uncodedId']) != '') {
        $fullUser = base64_encode($_POST['product'] . "_" . $_POST['version'] . "_user");
        $commentedPage = moderateComment(trim($_POST['uncodedId']), trim($_POST['action']), $fullUser);
        echo __BASE_URL__ . $commentedPage;
    } else {
        if (isset($_POST['ids']) && trim($_POST['ids']) != '') {
            $fullUser = base64_encode($_POST['product'] . "_" . $_POST['version'] . "_user");
            $cmt = new Comment($dbConnectionInfo, "", $fullUser);
            $ids = trim($_POST['ids']);
            $return = $cmt->deleteComments($ids);
            echo $return;
        } else {
            if (isset($_POST['page']) && trim($_POST['page']) != '') {
                $fullUser = base64_encode($_POST['product'] . "_" . $_POST['version'] . "_user");
                approveAll(substr($_POST['page'], strlen(__BASE_URL__)), $fullUser);
                echo $_POST['page'];
            } else {
                echo "Invalid data!";