private function delete($post) { $post_model = new blogPostModel(); $post = $post_model->getFieldsById($post['id'], array('id', 'blog_id')); if ($post) { if (!$this->getUser()->isAdmin($this->getApp())) { // author of post if ($post['contact_id'] == $this->getUser()->getId()) { blogHelper::checkRights($post['blog_id'], $this->getUser()->getId(), blogRightConfig::RIGHT_READ_WRITE); } else { blogHelper::checkRights($post['blog_id'], $this->getUser()->getId(), blogRightConfig::RIGHT_FULL); } } $post_model->deleteById($post['id']); $this->response['redirect'] = '?blog=' . $post['blog_id']; } else { $this->response['redirect'] = '?'; } }