? access.patch
? cck2.kpf
? files
? search_skip_types.patch
? state.patch
? theme.patch
? sites/.DS_Store
? sites/cck2
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.725
diff -u -p -r1.725 common.inc
--- includes/common.inc	26 Nov 2007 22:34:08 -0000	1.725
+++ includes/common.inc	30 Nov 2007 01:04:11 -0000
@@ -2728,7 +2728,7 @@ function drupal_alter($type, &$data) {
  *   The rendered HTML.
  */
 function drupal_render(&$elements) {
-  if (!isset($elements) || (isset($elements['#access']) && !$elements['#access'])) {
+  if (!isset($elements) || !element_access($elements)) {
     return NULL;
   }
 
@@ -2819,6 +2819,30 @@ function drupal_render(&$elements) {
 }
 
 /**
+ * Determine whether the user has access to view or edit an array element.
+ */
+function element_access(&$element, $op = 'view') {
+  if (isset($element['#access'])) {
+    if ($element['#access'] == FALSE) {
+      return FALSE;
+    }
+    elseif ($element['#access'] == TRUE) {
+      return TRUE;
+    }
+    else {
+      $function = $element['#access'];
+      if (function_exists($function)) {
+        return $function($element, $op);
+      }
+      else {
+        return TRUE;
+      }
+    }
+  }
+  return TRUE;
+}
+
+/**
  * Function used by uasort to sort structured arrays by weight.
  */
 function element_sort($a, $b) {
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.249
diff -u -p -r1.249 form.inc
--- includes/form.inc	26 Nov 2007 16:36:42 -0000	1.249
+++ includes/form.inc	30 Nov 2007 01:04:12 -0000
@@ -830,7 +830,7 @@ function form_builder($form_id, $form, &
     }
 
     // Deny access to child elements if parent is denied.
-    if (isset($form['#access']) && !$form['#access']) {
+    if (!element_access($form, 'edit')) {
       $form[$key]['#access'] = FALSE;
     }
 
@@ -916,7 +916,7 @@ function _form_builder_handle_input_elem
 
   if (!isset($form['#value']) && !array_key_exists('#value', $form)) {
     $function = !empty($form['#value_callback']) ? $form['#value_callback'] : 'form_type_'. $form['#type'] .'_value';
-    if (($form['#programmed']) || ((!isset($form['#access']) || $form['#access']) && isset($form['#post']) && (isset($form['#post']['form_id']) && $form['#post']['form_id'] == $form_id))) {
+    if (($form['#programmed']) || (element_access($form, 'edit') && isset($form['#post']) && (isset($form['#post']['form_id']) && $form['#post']['form_id'] == $form_id))) {
       $edit = $form['#post'];
       foreach ($form['#parents'] as $parent) {
         $edit = isset($edit[$parent]) ? $edit[$parent] : NULL;
