Commit 000ee5d1 authored by Kjartan's avatar Kjartan

- cleaning up the access checks in node.module.

- reverting a taxonomy patch that added $context checking to node/comments.
parent 9a4a9bef
......@@ -145,11 +145,9 @@ function comment_edit($cid) {
}
function comment_reply($pid, $nid) {
global $theme, $node;
global $theme;
// we must provide a taxonomy context for user_access()
$context->nid = $nid;
if (user_access("access comments", $context)) {
if (user_access("access comments")) {
if ($pid) {
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%s'", $pid));
comment_view($comment, t("reply to this comment"));
......
......@@ -145,11 +145,9 @@ function comment_edit($cid) {
}
function comment_reply($pid, $nid) {
global $theme, $node;
global $theme;
// we must provide a taxonomy context for user_access()
$context->nid = $nid;
if (user_access("access comments", $context)) {
if (user_access("access comments")) {
if ($pid) {
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%s'", $pid));
comment_view($comment, t("reply to this comment"));
......
......@@ -1007,15 +1007,9 @@ function node_preview($node, $error = NULL) {
}
function node_submit($node) {
global $theme, $user, $tid;
if (!user_access("post content")) {
return message_access();
}
$context->tid = $tid;
if (user_access("post content", $context)) {
global $user, $theme;
if (user_access("post content")) {
/*
** Fixup the node when required:
......
......@@ -1007,15 +1007,9 @@ function node_preview($node, $error = NULL) {
}
function node_submit($node) {
global $theme, $user, $tid;
if (!user_access("post content")) {
return message_access();
}
$context->tid = $tid;
if (user_access("post content", $context)) {
global $user, $theme;
if (user_access("post content")) {
/*
** Fixup the node when required:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment