? domain_content.patch
Index: domain_content.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/domain_content.module,v
retrieving revision 1.6
diff -p -0 -r1.6 domain_content.module
*** domain_content.module	10 Nov 2007 01:56:52 -0000	1.6
--- domain_content.module	10 Nov 2007 22:31:21 -0000
*************** function domain_content_admin() {
*** 184 ****
--- 185,192 ----
+  * Test hook_db_rewrite_sql
+  */
+ function domain_content_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
+  # print $query;
+  # print '<hr />';
+   
+ }
+ /**
*************** function domain_content_form() {
*** 194 ****
--- 203,222 ----
+   
+   // Bypass the superuser permissions by forcing an AND on {node_access}.
+   $filter['join'] .= " INNER JOIN {node_access} na ON na.nid = n.nid ";
+   $arg = arg(3);
+   if ($arg != 'all') {
+     if (empty($filter['where'])) {
+       $filter['where'] = " WHERE na.realm = 'domain_id' AND na.gid = ". $_domain['domain_id'] ." ";
+     }
+     else {
+       $filter['where'] = " AND na.realm = 'domain_id' AND na.gid = ". $_domain['domain_id'] ." ";
+     }
+   }
+   else {
+     if (empty($filter['where'])) {
+       $filter['where'] = " WHERE na.realm = 'domain_site' AND na.gid = 0 ";
+     }
+     else {
+       $filter['where'] = " AND na.realm = 'domain_id' AND na.gid = 0 ";
+     }
+   }
