spider/cmd/set/arcluster.pl
minima 2a43619b67 1. make all newly learned nodes locked out by default.
2. add lock_nodes.pl which locks out all the nodes in the user file whose
privilege is 1 or less and which isn't mentioned as an argument to the
command on the command line.
3. make set/node, set/spider and their friends unlock a node as well as make
them one.
4. Make sh/log et al more efficient / less memory hungry
2001-08-26 13:06:11 +00:00

50 lines
848 B
Perl

#
# set user type to 'S' for Spider node
#
# Please note that this is only effective if the user is not on-line
#
# Copyright (c) 1998 - Dirk Koopman
#
# $Id$
#
my ($self, $line) = @_;
my @args = split /\s+/, $line;
my $call;
my @out;
my $user;
my $create;
return (1, $self->msg('e5')) if $self->priv < 5;
foreach $call (@args) {
$call = uc $call;
my $chan = DXChannel->get($call);
if ($chan) {
push @out, $self->msg('nodee1', $call);
} else {
$user = DXUser->get($call);
$create = !$user;
$user = DXUser->new($call) if $create;
if ($user) {
$user->sort('R');
$user->homenode($call);
$user->lockout(0);
$user->priv(1) unless $user->priv;
$user->close();
push @out, $self->msg($create ? 'noderc' : 'noder', $call);
} else {
push @out, $self->msg('e3', "Set Spider", $call);
}
}
}
return (1, @out);