dbprefix}koolielu_waramu_comments WHERE ID=$comment_id"); if ($comment) { $rid = $comment->waramu_id; $obj = waramu_getResource('', $rid); // only owner, (resource subjects) moderator and editor have permission to delete if ($obj->hasPermissionTo("edit")) { $res = delete_data("DELETE FROM {$CONFIG->dbprefix}koolielu_waramu_comments WHERE ID=$comment_id"); } system_message(elgg_echo("generic_comment:deleted")); forward("pg/waramu/view/".$rid); } register_error(elgg_echo("generic_comment:notdeleted")); ?>