X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fmaxconnect.pl;fp=cmd%2Fset%2Fmaxconnect.pl;h=715b355d5ac80c3d7d98fa9b097475f7d81a6d0c;hb=963ead7224e53e257c7c661683174a75c2935cda;hp=0000000000000000000000000000000000000000;hpb=8081646e932b160975ad061a7a2741418b099761;p=spider.git diff --git a/cmd/set/maxconnect.pl b/cmd/set/maxconnect.pl new file mode 100644 index 00000000..715b355d --- /dev/null +++ b/cmd/set/maxconnect.pl @@ -0,0 +1,31 @@ +# +# set the maximum no of connections this user/node can have +# whilst connecting to this node +# +# Copyright (c) 2008 - Dirk Koopman G1TLH +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; +my $user; +my $val = shift @args if @args; + + +return (1, $self->msg('e5')) if $self->priv < 8; +return (1, $self->msg('e14')) unless defined $val; +return (1, $self->msg('e12')) unless @args; + +foreach $call (@args) { + $call = uc $call; + $user = DXUser::get_current($call); + if ($user) { + $user->maxconnect($val); + $user->put; + push @out, $self->msg('maxconnect', $call, $val); + } else { + push @out, $self->msg('e3', "set/maxconnect", $call); + } +} +return (1, @out);