--- modules/user/views_plugin_argument_validate_user_original.inc 2010-03-10 20:23:39.000000000 -0500 +++ modules/user/views_plugin_argument_validate_user.inc 2010-05-24 10:08:49.000000000 -0400 @@ -22,8 +22,8 @@ class views_plugin_argument_validate_use '#title' => t('Type of user argument to allow'), '#options' => array( 'uid' => t('Only allow numeric UIDs'), - 'name' => t('Only allow string usernames'), - 'either' => t('Allow both numeric UIDs and string usernames'), + 'name' => t('Only allow string user fields'), + 'either' => t('Allow both numeric UIDs and string user fields'), ), '#default_value' => $this->argument->options['validate_user_argument_type'], '#process' => array('expand_radios', 'views_process_dependency'), @@ -74,7 +74,7 @@ class views_plugin_argument_validate_use if ($argument == $GLOBALS['user']->name) { $account = $GLOBALS['user']; } - $where = "name = '%s'"; + $where = $this->argument->options['field'] . " = '%s'"; } } @@ -84,7 +84,7 @@ class views_plugin_argument_validate_use } if (!isset($account)) { - $query = "SELECT uid, name FROM {users} WHERE $where"; + $query = "SELECT uid," . $this->argument->options['field'] . " FROM {users} WHERE $where"; $account = db_fetch_object(db_query($query, $argument)); } if (empty($account)) { @@ -106,7 +106,8 @@ class views_plugin_argument_validate_use } } - $this->argument->argument = $account->uid; + //return TRUE but set the argument to the right value for the field + $this->argument->argument = $account->{$this->argument->options['field']}; $this->argument->validated_title = check_plain($account->name); return TRUE; }