Commit 40f6197c authored by Dries's avatar Dries
Browse files

- Patch #11940 by kps: if the user is not allowed to view a newly submitted...

- Patch #11940 by kps: if the user is not allowed to view a newly submitted node, redirect him to the main page.
parent ef95773b
...@@ -1384,9 +1384,15 @@ function node_submit($node) { ...@@ -1384,9 +1384,15 @@ function node_submit($node) {
} }
} }
// Node was submitted successfully. Redirect to the viewing page.
drupal_set_message($msg); drupal_set_message($msg);
// Node was submitted successfully: redirect the user.
if (node_access('view', $node)) {
drupal_goto('node/'. $node->nid); drupal_goto('node/'. $node->nid);
}
else {
drupal_goto();
}
} }
/** /**
......
...@@ -1384,9 +1384,15 @@ function node_submit($node) { ...@@ -1384,9 +1384,15 @@ function node_submit($node) {
} }
} }
// Node was submitted successfully. Redirect to the viewing page.
drupal_set_message($msg); drupal_set_message($msg);
// Node was submitted successfully: redirect the user.
if (node_access('view', $node)) {
drupal_goto('node/'. $node->nid); drupal_goto('node/'. $node->nid);
}
else {
drupal_goto();
}
} }
/** /**
......
Supports Markdown
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