X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fname.pl;h=4fae3e16f333546e362e85b93a722acb6252e2ad;hb=ab811a0c902225075a9bd69749f65594079433a9;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=6b6a8002929017b6d4217f68fa492a2d728ee1fe;p=spider.git diff --git a/cmd/set/name.pl b/cmd/set/name.pl index e69de29b..4fae3e16 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 +# +# +# + +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); + DXChannel::broadcast_all_nodes($s, $main::me) ; + return (1, $self->msg('name', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} +