Index: viewsphpfilter.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/viewsphpfilter/viewsphpfilter.views.inc,v
retrieving revision 1.1
diff -u -p -r1.1 viewsphpfilter.views.inc
--- viewsphpfilter.views.inc	27 May 2009 17:53:23 -0000	1.1
+++ viewsphpfilter.views.inc	26 Sep 2009 08:46:22 -0000
@@ -30,14 +30,32 @@ function viewsphpfilter_views_data_alter
             ),
     ),*/
     );
+  $data['users']['uid_php'] = array(
+    'real field' => 'uid',
+    'title' => t('User ID PHP handler'),
+    'title short' => t('PHP filter'),
+    'help' => t('This filter allows nodes to be filtered by Node ID.  PHP code should return an array with node IDs.  ID lists should be separated by commas.'),
+    'filter' => array(
+      //'field' => 'uid',
+      //'name table' => 'users',
+      'handler' => 'viewsphpfilter_handler_filter_users_uid_php',
+    ),
+  );
 }
 
 function viewsphpfilter_views_handlers() {
     return array(
-        'handlers' => array(
-            'views_handler_filter_node_nid_php' => array(
-                'parent' => 'views_handler_filter',
-            ),
-        ),
+      'info' => array(
+        'path' => drupal_get_path('module', 'viewsphpfilter'),
+      ),
+      'handlers' => array(
+          // Filters
+          'views_handler_filter_node_nid_php' => array(
+              'parent' => 'views_handler_filter',
+          ),
+          'viewsphpfilter_handler_filter_users_uid_php' => array(
+              'parent' => 'views_handler_filter_node_nid_php',
+          ),
+      ),
     );
 }
Index: viewsphpfilter_handler_filter_users_uid_php.inc
===================================================================
RCS file: viewsphpfilter_handler_filter_users_uid_php.inc
diff -N viewsphpfilter_handler_filter_users_uid_php.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ viewsphpfilter_handler_filter_users_uid_php.inc	26 Sep 2009 08:46:22 -0000
@@ -0,0 +1,50 @@
+<?php
+// $Id$
+/**
+ * @file
+ *   Filter handler to filter per uid.
+ */
+class viewsphpfilter_handler_filter_users_uid_php extends views_handler_filter_node_nid_php {
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    unset($form['handler']['#options']['nid']);
+    $form['handler']['#options']['uid'] = t('User ID list');
+  }
+
+  function query() {
+    //to do: validation should be factored out
+    $rawcode = $this->value;
+    //error_log('php: ' . print_r($rawcode,TRUE));
+    if ($this->options['handler'] == 'php') {
+      $result = eval ($rawcode);
+      //error_log('eval: ' . print_r($result,TRUE));
+    } else $result = $rawcode;
+    if (!is_array($result)) {
+      $result = explode(',',$result);
+    }
+    foreach ($result as $i => $val) $result[$i] = trim($val, " \t\n\r\0\x0B,");
+    //error_log('result: ' . print_r($result, TRUE));
+    $allints = true;
+    foreach ($result as $retval) {
+      if ( ((string)((int)$retval)) != $retval ) {
+        $allints = false;
+        //error_log('Views PHP Filter check failure: ' . print_r($retval, TRUE) . " | " . (int)$retval . " | " . (string)((int)$retval) );
+      }
+    }
+    if (!empty($result) and $allints) {
+      //error_log('everything passed!');
+      //error_log('result again: ' . print_r($result, TRUE));
+      $this->ensure_my_table();
+      if ($this->operator == 'OR') {
+        $this->query->add_where($this->options['group'], "users.uid IN (%s)", implode(",", $result));
+      }
+      else if ($this->operator == 'NOR') {
+        $this->query->add_where($this->options['group'], "users.uid NOT IN (%s)", implode(",", $result));
+      }
+    }
+    else {
+      //should print out a user warning on form validate if fails
+    }
+  }
+}
+
