]> scm.dxcluster.org Git - spider.git/blob - cmd/delete/user.pl
add privilege checks to (un)set/show/bad* cmds
[spider.git] / cmd / delete / user.pl
1 #
2 # delete a user
3 #
4 # Please note that this is only effective if the user is not on-line
5 #
6 # Copyright (c) 1998 - Dirk Koopman
7 #
8 #
9 #
10
11 my ($self, $line) = @_;
12 my @args = split /\s+/, $line;
13 my $call;
14 my @out;
15 my $user;
16
17 return (1, $self->msg('e5')) if $self->priv < 9;
18
19 foreach $call (@args) {
20         $call = uc $call;
21         my $chan = DXChannel::get($call);
22         if ($chan) {
23                 push @out, $self->msg('nodee1', $call);
24         } else {
25                 $user = DXUser::get($call);
26                 if ($user) {
27                         $user->del;
28                         push @out, $self->msg('deluser', $call);
29                         Log('DXCommand', $self->msg('deluser', $call));
30                 } else {
31                         push @out, $self->msg('e3', "Delete/User", $call);
32                 }
33         }
34 }
35 return (1, @out);