<?php /// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) $IV = array('POST' => array('targets' => array('list', 'mandatory' => false))); require ROOT . '/library/preprocessor.php'; importlib("model.blog.entry"); requireStrictRoute(); $isAjaxRequest = checkAjaxRequest(); if (isset($suri['id'])) { if (!Acl::check("group.editors")) { if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) { Respond::ResultPage(-1); exit; } } if ($isAjaxRequest) { if (deleteEntry($blogid, $suri['id']) === true) { Respond::ResultPage(0); } else { Respond::ResultPage(-1); } } else { deleteEntry($blogid, $suri['id']); header("Location: " . $_SERVER['HTTP_REFERER']); } } else { foreach (explode(',', $_POST['targets']) as $target) { // TeamBlog check if (!Acl::check('group.writers', 'entry.delete.' . $target)) {
function DEFENSIO_RevertItems() { global $blogid, $pluginMenuURL, $pluginURL, $pluginSelfParam, $blog, $user, $blogURL, $defaultURL, $hostURL, $service, $skinSetting, $configVal, $suri; $id = !empty($_GET['id']) ? $_GET['id'] : ''; $comment_TYPE = !empty($_GET['t']) ? $_GET['t'] : ''; if ($comment_TYPE != "T") { $comment_TYPE = "C"; } if ($id) { $isAjaxRequest = checkAjaxRequest(); $r = -1; if ($comment_TYPE == 'C') { if (revertCommentInOwner($blogid, $id) === true) { $r = 0; } } else { if (revertTrackback($blogid, $id) !== true) { $r = 0; } } defensio_make_to_ham($comment_TYPE, $id); defensio_clear_comments($comment_TYPE); $isAjaxRequest ? respond::ResultPage($r) : header("Location: " . $_SERVER['HTTP_REFERER']); } else { $targets = explode('~*_)', $_POST['targets']); $id = array(); foreach ($targets as $t) { if ($t == '') { continue; } array_push($id, $t); $comment_TYPE == 'C' ? revertCommentInOwner($blogid, $t, false) : revertTrackback($blogid, $t); } if (count($id) > 0) { defensio_make_to_ham($comment_TYPE, implode(',', $id)); } defensio_clear_comments($comment_TYPE); respond::ResultPage(0); } exit; }