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)) { if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) { Respond::ResultPage(-1); exit; } } if (!deleteEntry($blogid, $target)) { Respond::ResultPage(-1); } } Respond::ResultPage(0); }
static function authorName($blogid = null, $entryId) { if (is_null($blogid)) { $blogid = getBlogId(); } // Read userId of entry from relation table. $userid = getUserIdOfEntry($blogid, $entryId); if (isset($userid)) { return User::getName($userid); } else { return false; } }