X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fname.pl;h=30b1dc7184c5f22d51cea9a11c9c1d44daf55b6a;hb=b4826d1f4125788e14fed3adbb99e66242904e74;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=43ac48b5c2aecc7fe27af95d4b613b8d2dd08761;p=spider.git diff --git a/cmd/set/name.pl b/cmd/set/name.pl index e69de29b..30b1dc71 100644 --- a/cmd/set/name.pl +++ b/cmd/set/name.pl @@ -0,0 +1,28 @@ +# +# 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+$//; + +return (1, $self->msg('namee1')) if !$line; + +$user = DXUser->get_current($call); +if ($user) { + $user->name($line); + $user->put(); + DXProt::broadcast_ak1a(DXProt::pc41($call, 1, $line), $DXProt::me); + return (1, $self->msg('name', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} +