summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-11-15 09:55:28 +0000
committerDries Buytaert <dries@buytaert.net>2004-11-15 09:55:28 +0000
commit40f6197c5b74cef722478793fd486a8cb326690a (patch)
tree1afc3a724aa17c681e4e624435b4b32896733fe6 /modules/node.module
parentef95773b1c6e3b2de1363e607d31f4e8808ec304 (diff)
downloadbrdo-40f6197c5b74cef722478793fd486a8cb326690a.tar.gz
brdo-40f6197c5b74cef722478793fd486a8cb326690a.tar.bz2
- Patch #11940 by kps: if the user is not allowed to view a newly submitted node, redirect him to the main page.
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/node.module b/modules/node.module
index d16b60127..195cba7e8 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -75,7 +75,7 @@ function node_help_page() {
* Gather a listing of links to nodes.
*
* @param $result
- * A DB result object from a query to fetch node objects. If your query joins the <code>node_comment_statistics</code> table so that the <code>comment_count</code> field is available, a title attribute will be added to show the number of comments.
+ * A DB result object from a query to fetch node objects. If your query joins the <code>node_comment_statistics</code> table so that the <code>comment_count</code> field is available, a title attribute will be added to show the number of comments.
* field to be set.
* @param $title
* A heading for the resulting list.
@@ -1384,9 +1384,15 @@ function node_submit($node) {
}
}
- // Node was submitted successfully. Redirect to the viewing page.
drupal_set_message($msg);
- drupal_goto('node/'. $node->nid);
+
+ // Node was submitted successfully: redirect the user.
+ if (node_access('view', $node)) {
+ drupal_goto('node/'. $node->nid);
+ }
+ else {
+ drupal_goto();
+ }
}
/**