diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-02-18 15:14:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-02-18 15:14:56 +0000 |
commit | 4371b627d51ffc5af9498fa1877d8e519a5f2c6e (patch) | |
tree | bc83240be6329005e30a5c21ff83163397ca0fd1 /includes/comment.inc | |
parent | c93bcff8b85a24fe200fe27bd4c8f860f7d01b9c (diff) | |
download | brdo-4371b627d51ffc5af9498fa1877d8e519a5f2c6e.tar.gz brdo-4371b627d51ffc5af9498fa1877d8e519a5f2c6e.tar.bz2 |
- added fine-grained user permission system which allows us to give
certain users access to specific administration sections only.
Ex. a FAQ maintainer can only edit the FAQ, and members of an
"editorial board" can only edit comments, diaries and
stories, ..
- code review => rewrote include/user.inc which is much easier now
- fixed 4 small bugs
Diffstat (limited to 'includes/comment.inc')
-rw-r--r-- | includes/comment.inc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/includes/comment.inc b/includes/comment.inc index c64a3e4dd..44909ac65 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -32,12 +32,12 @@ function comment_moderate($moderate) { $none = $comment_votes[key($comment_votes)]; foreach ($moderate as $id=>$vote) { - if ($vote != $comment_votes[$none] && !user_get_history($user->history, "c$id")) { + if ($vote != $comment_votes[$none] && !user_get($user, "history", "c$id")) { // Update the comment's score: $result = db_query("UPDATE comments SET score = score $vote, votes = votes + 1 WHERE cid = $id"); // Update the user's history: - user_set_history("c$id", $vote); + $user = user_set($user, "history", "c$id", $vote); } } } @@ -45,12 +45,7 @@ function comment_moderate($moderate) { function comment_settings($mode, $order, $threshold) { global $user; - if ($user->id) { - $data[mode] = $mode; - $data[sort] = $order; - $data[threshold] = $threshold; - user_save($data, $user->id); - } + if ($user->id) $user = user_save($user, array("mode" => $mode, "sort" => $order, "threshold" => $threshold)); } function comment_reply($pid, $id) { @@ -180,7 +175,7 @@ function comment_moderation($comment) { if ($op == "reply") { $output .= " "; } - else if ($user->id && $user->userid != $comment->userid && !user_get_history($user->history, "c$comment->cid")) { + else if ($user->id && $user->userid != $comment->userid && !user_get($user, "history", "c$comment->cid")) { $output .= "<SELECT NAME=\"moderate[$comment->cid]\">\n"; foreach ($comment_votes as $key=>$value) $output .= " <OPTION VALUE=\"$value\">$key</OPTION>\n"; $output .= "</SELECT>\n"; |