X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fname.pl;h=3291757455974a77f209057463d7a199b2459a36;hb=5275b86607057a0960cdf03b41b8092a3d813e57;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=6b6a8002929017b6d4217f68fa492a2d728ee1fe;p=spider.git diff --git a/cmd/set/name.pl b/cmd/set/name.pl index e69de29b..32917574 100644 --- a/cmd/set/name.pl +++ b/cmd/set/name.pl @@ -0,0 +1,31 @@ +# +# set the name of the user +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my $call = $self->call; +my $user; + +# remove leading and trailing spaces +$line =~ s/^\s+//; +$line =~ s/\s+$//; +$line =~ s/[{}]//g; # no braces allowed + +return (1, $self->msg('namee1')) if !$line; + +$user = DXUser->get_current($call); +if ($user) { + $user->name($line); + $user->put(); + my $s = DXProt::pc41($call, 1, $line); + DXProt::eph_dup($s); + DXProt::broadcast_all_ak1a($s, $DXProt::me) ; + return (1, $self->msg('name', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} +