Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
cf2f3059
Commit
cf2f3059
authored
Nov 07, 2006
by
drumm
Browse files
#83288
by chx and pwolanin. Remove a redundant access check.
parent
235d9a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/node/node.module
View file @
cf2f3059
...
...
@@ -2162,22 +2162,14 @@ function node_form_submit($form_id, $form_values) {
// Prepare the node's body:
if
(
$node
->
nid
)
{
// Check whether the current user has the proper access rights to
// perform this operation:
if
(
node_access
(
'update'
,
$node
))
{
node_save
(
$node
);
watchdog
(
'content'
,
t
(
'@type: updated %title.'
,
array
(
'@type'
=>
t
(
$node
->
type
),
'%title'
=>
$node
->
title
)),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
'node/'
.
$node
->
nid
));
drupal_set_message
(
t
(
'The %post has been updated.'
,
array
(
'%post'
=>
node_get_types
(
'name'
,
$node
))));
}
node_save
(
$node
);
watchdog
(
'content'
,
t
(
'@type: updated %title.'
,
array
(
'@type'
=>
t
(
$node
->
type
),
'%title'
=>
$node
->
title
)),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
'node/'
.
$node
->
nid
));
drupal_set_message
(
t
(
'The %post has been updated.'
,
array
(
'%post'
=>
node_get_types
(
'name'
,
$node
))));
}
else
{
// Check whether the current user has the proper access rights to
// perform this operation:
if
(
node_access
(
'create'
,
$node
))
{
node_save
(
$node
);
watchdog
(
'content'
,
t
(
'@type: added %title.'
,
array
(
'@type'
=>
t
(
$node
->
type
),
'%title'
=>
$node
->
title
)),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
"node/
$node->nid
"
));
drupal_set_message
(
t
(
'Your %post has been created.'
,
array
(
'%post'
=>
node_get_types
(
'name'
,
$node
))));
}
node_save
(
$node
);
watchdog
(
'content'
,
t
(
'@type: added %title.'
,
array
(
'@type'
=>
t
(
$node
->
type
),
'%title'
=>
$node
->
title
)),
WATCHDOG_NOTICE
,
l
(
t
(
'view'
),
"node/
$node->nid
"
));
drupal_set_message
(
t
(
'Your %post has been created.'
,
array
(
'%post'
=>
node_get_types
(
'name'
,
$node
))));
}
if
(
$node
->
nid
)
{
if
(
node_access
(
'view'
,
$node
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment