? handle_unpub.patch
? not_anon.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/README.txt,v
retrieving revision 1.4
diff -u -p -r1.4 README.txt
--- README.txt	15 Jan 2007 00:28:16 -0000	1.4
+++ README.txt	16 Aug 2007 02:49:53 -0000
@@ -14,15 +14,22 @@ This module provides an admin interface 
 and an optional block to show how many posts are in moderation and the titles
 of recently added posts. 
 
+After installation of this module, nodes have an extra publishing option called 
+'In moderation queue'. Generally, each content type which requires moderation,
+should have this option checked. (path: admin/content/types)
+
 The admin interface allows a user with the "moderate content" permission to 
 preview content in moderation, as well as approve or delete each moderated post, 
 and (optionally) to send an e-mail to the author informing him/her of the choice.
-*Important note:* the 5.x version will not show unpublished nodes in the 
-moderation queue listing (unlike the 4.7 version). Posts to be moderated should
-generally be set to be published so that users without the "administer  nodes" 
-permission can also effectively work as moderators.
+*Important note:* as of version 5.x-2.3 unpublished nodes in the WILL be shown 
+in the moderation queue listing for users with the "adminiser nodes" permission.
+For these users, approving a post in the queue will also publish it. However, 
+posts to be moderated should generally be set to be published so that users 
+without the "administer nodes" permission can also effectively work as 
+moderators.
 
-Visit the settings page to customize the e-mail messages and set other defaults.
+Visit the settings page to customize the e-mail messages and set other defaults 
+(path: admin/settings/modr8).
 
 As of version 5.x-2.0, modr8 also includes a moderation log to record the
 actions of moderators on items in the moderation queue.  This may be especially
Index: modr8.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8.module,v
retrieving revision 1.16
diff -u -p -r1.16 modr8.module
--- modr8.module	16 Aug 2007 02:24:52 -0000	1.16
+++ modr8.module	16 Aug 2007 02:49:53 -0000
@@ -189,9 +189,14 @@ function modr8_form_alter($form_id, &$fo
  */
 function modr8_page() {
   require_once drupal_get_path('module', 'modr8'). '/modr8_admin.inc';
-  
-  $count_sql = db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE n.status = 1 AND n.moderate = 1');
-  $page_sql = db_rewrite_sql('SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.moderate = 1 ORDER BY n.changed DESC');
+
+  $is_published = '';
+  if (!user_access('administer nodes')) {
+    // Users who don't have the 'administer nodes' permission can only see published nodes.
+    $is_published = 'n.status = 1 AND ';
+  }
+  $count_sql = db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE '. $is_published .' n.moderate = 1');
+  $page_sql = db_rewrite_sql('SELECT n.nid FROM {node} n WHERE '. $is_published .' n.moderate = 1 ORDER BY n.changed DESC');
   $result = pager_query($page_sql, variable_get('modr8_nodes_per_page', 10), 0, $count_sql);
   
   $output = '<p>'. l(t('Show log of all actions on moderated content.'), 'admin/logs/modr8') .'</p>';
@@ -254,10 +259,15 @@ function modr8_block($op = 'list', $delt
   elseif ($op == 'view') {
     if (user_access('moderate content')){
       $block['subject'] = t('Moderation queue');
-      $count = db_result(db_query(db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE n.status = 1 AND n.moderate = 1')));
+      $is_published = '';
+      if (!user_access('administer nodes')) {
+        // Users who don't have the 'administer nodes' permission can only see published nodes.
+        $is_published = 'n.status = 1 AND ';
+      }
+      $count = db_result(db_query(db_rewrite_sql('SELECT COUNT(*) FROM {node} n WHERE '. $is_published .' n.moderate = 1')));
       $content = '<p>'. l(t('@items in moderation',array('@items' => format_plural($count, '1 post', '@count posts'))),'admin/content/modr8'). '</p>';
       if ($count) {
-        $sql = db_rewrite_sql('SELECT n.nid, n.title FROM {node} n WHERE n.status = 1 AND n.moderate = 1 ORDER BY n.changed DESC');
+        $sql = db_rewrite_sql('SELECT n.nid, n.title FROM {node} n WHERE '. $is_published .' n.moderate = 1 ORDER BY n.changed DESC');
         $result = db_query_range($sql,0,6);
         $content .= node_title_list($result, t('Recent additions:'));
       }
Index: modr8_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8_admin.inc,v
retrieving revision 1.10
diff -u -p -r1.10 modr8_admin.inc
--- modr8_admin.inc	13 Feb 2007 02:34:39 -0000	1.10
+++ modr8_admin.inc	16 Aug 2007 02:49:53 -0000
@@ -222,16 +222,20 @@ function modr8_form_submit($form_id, $fo
     $message = '';   
     switch ($values['ops']) {
       case 'approve':
-        if(variable_get('modr8_send_approve', FALSE)){
+        if (variable_get('modr8_send_approve', FALSE)){
           $message = modr8_usermail('approve', $nid, $values);
         }
-        db_query('UPDATE {node} SET moderate = 0 WHERE nid = %d', $nid);
+        $publish = '';
+        if (user_access('administer nodes')) {
+          $publish = ', status = 1';
+        }
+        db_query('UPDATE {node} SET moderate = 0 '. $publish .' WHERE nid = %d', $nid);
         drupal_set_message(t('The %type with title %title has been approved.', array('%title' => $values['title'], '%type' => $values['type'])));
         cache_clear_all();
         modr8_log_action('approve', $nid, $values, $message);
         break;
       case 'delete':
-        if(variable_get('modr8_send_deny', FALSE)){
+        if (variable_get('modr8_send_deny', FALSE)){
           $message = modr8_usermail('deny', $nid, $values);
         }
         node_delete($nid);
@@ -239,7 +243,7 @@ function modr8_form_submit($form_id, $fo
         modr8_log_action('delete', $nid, $values, $message);
         break;
       case 'nada':
-        if(variable_get('modr8_send_noact', FALSE) && !empty($values['note'])){
+        if (variable_get('modr8_send_noact', FALSE) && !empty($values['note'])){
           $message = modr8_usermail('nada', $nid, $values);
           modr8_log_action('nada', $nid, $values, $message);
         }    
