X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fhomenode.pl;h=d85c893229cecd36da68707a5b024231cc5c9677;hb=b4826d1f4125788e14fed3adbb99e66242904e74;hp=2c7c6c9f65d0340720ba240f199bd5e10af8bc5d;hpb=43ac48b5c2aecc7fe27af95d4b613b8d2dd08761;p=spider.git diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index 2c7c6c9f..d85c8932 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -5,3 +5,25 @@ # # $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('hnodee1')) if !$line; + +$user = DXUser->get_current($call); +if ($user) { + $line = uc $line; + $user->homenode($line); + $user->put(); + DXProt::broadcast_ak1a(DXProt::pc41($call, 4, $line), $DXProt::me); + return (1, $self->msg('hnode', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} +