Index: webform.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v
retrieving revision 1.124.2.67
diff -u -r1.124.2.67 webform.module
--- webform.module	3 Nov 2008 16:59:43 -0000	1.124.2.67
+++ webform.module	28 Nov 2008 01:21:43 -0000
@@ -145,8 +145,8 @@
     'title' => 'Results',
     'page callback' => 'webform_results_submissions',
     'page arguments' => array(1),
-    'access callback' => 'user_access',
-    'access arguments' => array('access webform results'),
+    'access callback' => 'webform_results_access',
+    'access arguments' => array(1, 'access webform results'),
     'file' => 'webform_report.inc',
     'weight' => 2,
     'type' => MENU_LOCAL_TASK,
@@ -155,8 +155,8 @@
     'title' => 'Submissions',
     'page callback' => 'webform_results_submissions',
     'page arguments' => array(1),
-    'access callback' => 'user_access',
-    'access arguments' => array('access webform results'),
+    'access callback' => 'webform_results_access',
+    'access arguments' => array(1, 'access webform results'),
     'file' => 'webform_report.inc',
     'weight' => 4,
     'type' => MENU_DEFAULT_LOCAL_TASK,
@@ -165,8 +165,8 @@
     'title' => 'Analysis',
     'page callback' => 'webform_results_analysis',
     'page arguments' => array(1),
-    'access callback' => 'user_access',
-    'access arguments' => array('access webform results'),
+    'access callback' => 'webform_results_access',
+    'access arguments' => array(1, 'access webform results'),
     'file' => 'webform_report.inc',
     'weight' => 5,
     'type' => MENU_LOCAL_TASK,
@@ -175,8 +175,8 @@
     'title' => 'Table',
     'page callback' => 'webform_results_table',
     'page arguments' => array(1),
-    'access callback' => 'user_access',
-    'access arguments' => array('access webform results'),
+    'access callback' => 'webform_results_access',
+    'access arguments' => array(1, 'access webform results'),
     'file' => 'webform_report.inc',
     'weight' => 6,
     'type' => MENU_LOCAL_TASK,
@@ -185,8 +185,8 @@
     'title' => 'Download',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('webform_results_download_form', 1),
-    'access callback' => 'user_access',
-    'access arguments' => array('access webform results'),
+    'access callback' => 'webform_results_access',
+    'access arguments' => array(1, 'access webform results'),
     'file' => 'webform_report.inc',
     'weight' => 7,
     'type' => MENU_LOCAL_TASK,
@@ -195,8 +195,8 @@
     'title' => 'Clear',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('webform_results_clear_form', 1),
-    'access callback' => 'user_access',
-    'access arguments' => array('clear webform results'),
+    'access callback' => 'webform_results_access',
+    'access arguments' => array(1, 'clear webform results'),
     'file' => 'webform_report.inc',
     'weight' => 8,
     'type' => MENU_LOCAL_TASK,
@@ -311,6 +311,10 @@
   }
 }
 
+function webform_results_access($node, $perm) {
+  return node_access('view', $node) && user_access($perm);
+}
+
 /**
  * Implementation of hook_perm().
  */
@@ -2086,7 +2090,7 @@
  * Menu callback for admin/content/webform. Displays all webforms on the site.
  */
 function webform_admin_content() {
-  $result = db_query("SELECT * FROM {node} WHERE type = 'webform'");
+  $result = db_query(db_rewrite_sql("SELECT n.* FROM {node} n WHERE n.type = 'webform'"));
   $nodes = array();
   while ($node = db_fetch_object($result)) {
     $nodes[] = $node;

