From f77bcddc7197a9a0b08621b8ec228c9963c3cc54 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 24 Nov 2001 15:30:57 +0000 Subject: - Tuned the blog updating logic: Updating your own blog entry will demote it (if promoted), and will queue it in the moderation queue for promotion. If a node administrator updates his own blog entry through the blog update mechanism that regular users use, then he will be treated as a regular user and his blog entry will be demoted. But when an administrator updates blog entries through the admin pages, they will not be changed unless explicitly specified. --- modules/blog/blog.module | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'modules/blog/blog.module') diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 408a35d87..02350798c 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -40,7 +40,7 @@ function blog_access($op, $node) { } function blog_save($op, $node) { - global $user; + global $REQUEST_URI; if ($op == "approve") { return array("promote" => 1); @@ -55,18 +55,24 @@ function blog_save($op, $node) { } if ($op == "update") { - if ($user->uid == $node->uid) { + if (strstr($REQUEST_URI, "module.php?mod=node&op=edit")) { /* ** Updating your own blog entry will demote it (if promoted), ** and will queue it in the moderation queue for promotion. + ** If a node administrator updates his own blog entry through + ** the blog update mechanism that regular users use, then he + ** will be treated as a regular user and his blog entry will + ** be demoted. We use the $REQUEST_URI field to dectect this + ** as we don't want to interfer with the updating of blog + ** entries through the admin pages. */ return array("promote" => 0, "moderate" => 1, "score" => 0, "votes" => 0, "users" => 0); } - else { + else if (user_access("adminster nodes")) { /* - ** When an administrator updates someone else' blog entry, it - ** will not be changed unless explicitly specified. + ** When an administrator updates blog entries through the admin + ** pages, they will not be changed unless explicitly specified. */ return array(); -- cgit v1.2.3