diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-11-24 15:30:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-11-24 15:30:57 +0000 |
commit | f77bcddc7197a9a0b08621b8ec228c9963c3cc54 (patch) | |
tree | 49fe2e5529bcf87b8786468d7ffce7c076a62c75 | |
parent | eb7c5f60b965bb1385a4b209041ae99181fae3f5 (diff) | |
download | brdo-f77bcddc7197a9a0b08621b8ec228c9963c3cc54.tar.gz brdo-f77bcddc7197a9a0b08621b8ec228c9963c3cc54.tar.bz2 |
- 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.
-rw-r--r-- | modules/blog.module | 16 | ||||
-rw-r--r-- | modules/blog/blog.module | 16 |
2 files changed, 22 insertions, 10 deletions
diff --git a/modules/blog.module b/modules/blog.module index 408a35d87..02350798c 100644 --- a/modules/blog.module +++ b/modules/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(); 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(); |