fleshed out some commands (particularly flag setting and unsetting)
[spider.git] / cmd / show / user.pl
index 919fda66b85adb24d04ecc28c208948812c2b0c7..3b27777427511e70fcca08bcbf75f1ba856b6b35 100644 (file)
@@ -4,29 +4,21 @@
 # $Id$
 #
 
-my $self = shift;
-#return (0) if ($self->priv < 9); # only console users allowed
-my @list = split;                # generate a list of callsigns
+my ($self, $line) = @_;
+my @list = split /\s+/, $line;               # generate a list of callsigns
 @list = ($self->call) if !@list;  # my channel if no callsigns
 
 my $call;
 my @out;
 foreach $call (@list) {
+  $call = uc $call;
   my $ref = DXUser->get($call);
-  return (0, "User: $call not found") if !$ref;
-
-  my @fields = $ref->fields;
-  my $field;
-  push @out, "User Information $call";
-  foreach $field (@fields) {
-    my $prompt = $ref->field_prompt($field);
-    my $val = $ref->{$field};
-    push @out, "$prompt: $val";
-  } 
+  if ($ref) {
+    @out = print_all_fields($self, $ref, "User Information $call");
+  } else {
+    push @out, "User: $call not found";
+  }
+  push @out, "" if @list > 1;
 }
 
 return (1, @out);
-
-
-
-