This commit was manufactured by cvs2svn to create tag 'freeside_2_1_1'.
[freeside.git] / FS / FS / access_user.pm
index 25aa8af..72e9140 100644 (file)
@@ -270,7 +270,9 @@ Returns a name string for this user: "Last, First".
 
 sub name {
   my $self = shift;
-  $self->get('last'). ', '. $self->first;
+  return $self->username
+    if $self->get('last') eq 'Lastname' && $self->first eq 'Firstname';
+  return $self->get('last'). ', '. $self->first;
 }
 
 =item user_cust_main
@@ -413,10 +415,10 @@ sub agentnum {
   $sth->fetchrow_arrayref->[0];
 }
 
-=item agents
+=item agents [ HASHREF | OPTION => VALUE ... ]
 
 Returns the list of agents this user can view (via group membership), as
-FS::agent objects.
+FS::agent objects.  Accepts the same options as the agentnums_sql method.
 
 =cut
 
@@ -425,7 +427,7 @@ sub agents {
   qsearch({
     'table'     => 'agent',
     'hashref'   => { disabled=>'' },
-    'extra_sql' => ' AND '. $self->agentnums_sql,
+    'extra_sql' => ' AND '. $self->agentnums_sql(@_),
   });
 }