9e9ef05e59c0799f6a64272ed71b9ef81af54da2
[spider.git] / cmd / set / usdb.pl
1 #
2 # Add/modify a USDB entry
3 #
4 # There are no checks and NO balances.
5 #
6 # Copyright (c) 2002 Dirk Koopman
7 #
8 # $Id$
9 #
10
11 my ($self, $line) = @_;
12 return (1, $self->msg('e5')) if $self->priv < 9;
13
14 my ($call, $state, $city) = split /\s+/, uc $line, 3;
15 return (1, $self->msg('susdb1')) if length $state != 2 || !is_callsign($call);
16
17 my ($ocity, $ostate) = USDB::get($call);
18 my @out;
19 push @out, $self->msg('susdb2', $call, $ocity, $ostate ) if $ocity;
20 USDB::add($call, $city, $state);
21 push @out, $self->msg('susdb3', $call, $city, $state );
22 Log('DXCommand', $self->msg('susdb3', $call, $city, $state));
23 return (1, @out);
24