2 # set the privilege of the user
4 # call as set/priv n <call> ...
6 # Copyright (c) 1998 Dirk Koopman G1TLH
10 my ($self, $line) = @_;
11 my @args = split /\s+/, $line;
13 my $priv = shift @args;
18 if ($self->priv < 9 || $self->remotecmd || $self->inscript) {
19 Log('DXCommand', $self->call . " attempted to set privilege $priv for @args");
20 return (1, $self->msg('e5'));
23 if ($priv < 0 || $priv > 9) {
24 return (1, $self->msg('e5'));
27 foreach $call (@args) {
29 unless ($self->remotecmd || $self->inscript) {
30 if ($ref = DXChannel::get($call)) {
32 $ref->user->priv($priv);
35 if (!$ref && ($user = DXUser::get($call))) {
40 push @out, $self->msg('priv', $call);
41 Log('DXCommand', "Privilege set to $priv on $call by " . $self->call);
43 push @out, $self->msg('e3', "Set Privilege", $call);
46 push @out, $self->msg('sorry');
47 Log('DXCommand', $self->call . " attempted to set privilege $priv for $call remotely");