From: Dirk Koopman Date: Tue, 6 May 2008 14:00:00 +0000 (+0100) Subject: Change DXUser->get* to DXUser::get* X-Git-Tag: 1.55 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=996d9774dad0fc0133f8497d9d264f4f5a4265b3;p=spider.git Change DXUser->get* to DXUser::get* and also check the output of thaw more carefully, complain if it isn't a DXUser. --- diff --git a/Changes b/Changes index c97a6e5c..66f67086 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +06May08======================================================================= +1. Finally made the incompatible change of changing DXUser->get* to +DXUser::get*. This will break any third party addons or commands use these +commands. 22Apr08======================================================================= 1. Added two Xmas Is calls. 15Apr08======================================================================= diff --git a/cmd/Notes.txt b/cmd/Notes.txt index c058941b..4e23e130 100644 --- a/cmd/Notes.txt +++ b/cmd/Notes.txt @@ -1,4 +1,4 @@ -Programming Notes ($Id$) +Programming Notes * Every command that can used on the command line lives in either this directory ('cmd') or in a local version ('local_cmd'). You are cajoled or @@ -98,7 +98,7 @@ Programming Notes ($Id$) locators * It is important that you remember when you have tie hashes using MLDBM - et al. If you do a DXUser->get($call) you will get a different (older) + et al. If you do a DXUser::get($call) you will get a different (older) thing than the one in $self->$user. This is almost certainly NOT what you want if want to modify a user that is currently connected. diff --git a/cmd/catchup.pl b/cmd/catchup.pl index 81bf0539..2bf0d5e7 100644 --- a/cmd/catchup.pl +++ b/cmd/catchup.pl @@ -16,7 +16,7 @@ my @f = split /\s+/, $line; return (1, "usage: catchup all|[= 2; my $call = uc shift @f; -my $user = DXUser->get_current($call); +my $user = DXUser::get_current($call); return (1, "$call not a node") unless $user && $user->sort ne 'U'; my @out; diff --git a/cmd/clear/announce.pl b/cmd/clear/announce.pl index 9abee68b..7e41c475 100644 --- a/cmd/clear/announce.pl +++ b/cmd/clear/announce.pl @@ -18,7 +18,7 @@ my $f; if ($self->priv >= 8) { if (@f && is_callsign(uc $f[0])) { $f = uc shift @f; - my $uref = DXUser->get($f); + my $uref = DXUser::get($f); $call = $uref->call if $uref; } elsif (@f && lc $f[0] eq 'node_default' || lc $f[0] eq 'user_default') { $call = lc shift @f; diff --git a/cmd/clear/route.pl b/cmd/clear/route.pl index 403a777a..f7ab802a 100644 --- a/cmd/clear/route.pl +++ b/cmd/clear/route.pl @@ -18,7 +18,7 @@ my $f; if ($self->priv >= 8) { if (@f && is_callsign(uc $f[0])) { $f = uc shift @f; - my $uref = DXUser->get($f); + my $uref = DXUser::get($f); $call = $uref->call if $uref; } elsif (@f && lc $f[0] eq 'node_default' || lc $f[0] eq 'user_default') { $call = lc shift @f; diff --git a/cmd/clear/spots.pl b/cmd/clear/spots.pl index 5ba0c8de..a7aa20af 100644 --- a/cmd/clear/spots.pl +++ b/cmd/clear/spots.pl @@ -18,7 +18,7 @@ my $f; if ($self->priv >= 8) { if (@f && is_callsign(uc $f[0])) { $f = uc shift @f; - my $uref = DXUser->get($f); + my $uref = DXUser::get($f); $call = $uref->call if $uref; } elsif (@f && lc $f[0] eq 'node_default' || lc $f[0] eq 'user_default') { $call = lc shift @f; diff --git a/cmd/clear/wcy.pl b/cmd/clear/wcy.pl index fe9583ef..68706046 100644 --- a/cmd/clear/wcy.pl +++ b/cmd/clear/wcy.pl @@ -18,7 +18,7 @@ my $f; if ($self->priv >= 8) { if (@f && is_callsign(uc $f[0])) { $f = uc shift @f; - my $uref = DXUser->get($f); + my $uref = DXUser::get($f); $call = $uref->call if $uref; } elsif (@f && lc $f[0] eq 'node_default' || lc $f[0] eq 'user_default') { $call = lc shift @f; diff --git a/cmd/clear/wwv.pl b/cmd/clear/wwv.pl index 0d52f5c8..8201eb47 100644 --- a/cmd/clear/wwv.pl +++ b/cmd/clear/wwv.pl @@ -18,7 +18,7 @@ my $f; if ($self->priv >= 8) { if (@f && is_callsign(uc $f[0])) { $f = uc shift @f; - my $uref = DXUser->get($f); + my $uref = DXUser::get($f); $call = $uref->call if $uref; } elsif (@f && lc $f[0] eq 'node_default' || lc $f[0] eq 'user_default') { $call = lc shift @f; diff --git a/cmd/connect.pl b/cmd/connect.pl index 24002985..fd893974 100644 --- a/cmd/connect.pl +++ b/cmd/connect.pl @@ -11,7 +11,7 @@ return (1, $self->msg('already', $call)) if DXChannel::get($call); return (1, $self->msg('outconn', $call)) if grep {$_->{call} eq $call} @main::outstanding_connects; return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall"; -my $user = DXUser->get($call); +my $user = DXUser::get($call); return (1, $self->msg('lockout', $call)) if $user && $user->lockout; my @out; diff --git a/cmd/create/user.pl b/cmd/create/user.pl index 4eeece8a..3b30f2ff 100644 --- a/cmd/create/user.pl +++ b/cmd/create/user.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd; foreach $call (@args) { $call = uc $call; - $user = DXUser->get($call); + $user = DXUser::get($call); unless ($user) { $user = DXUser->new($call); $user->sort('U'); diff --git a/cmd/delete/user.pl b/cmd/delete/user.pl index 2dc60db9..27065d98 100644 --- a/cmd/delete/user.pl +++ b/cmd/delete/user.pl @@ -22,7 +22,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); if ($user) { $user->del; push @out, $self->msg('deluser', $call); diff --git a/cmd/forward/latlong.pl b/cmd/forward/latlong.pl index 2282be3c..e9afd710 100644 --- a/cmd/forward/latlong.pl +++ b/cmd/forward/latlong.pl @@ -29,7 +29,7 @@ use DB_File; my ($action, $count, $key, $data); for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { if ($data =~ m{(?:lat|long) =>}) { - my $u = DXUser->get_current($key); + my $u = DXUser::get_current($key); if ($u) { my $lat = $u->lat; my $long = $u->long; diff --git a/cmd/forward/opername.pl b/cmd/forward/opername.pl index 91acc8b4..08333724 100644 --- a/cmd/forward/opername.pl +++ b/cmd/forward/opername.pl @@ -22,7 +22,7 @@ if ($self->priv < 1) { my $call; foreach $call (@f) { - my $ref = DXUser->get_current($call); + my $ref = DXUser::get_current($call); if ($ref) { my $name = $ref->name; my $qth = $ref->qth; diff --git a/cmd/set/arcluster.pl b/cmd/set/arcluster.pl index cfed97ab..1587f703 100644 --- a/cmd/set/arcluster.pl +++ b/cmd/set/arcluster.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; if ($user) { diff --git a/cmd/set/bbs.pl b/cmd/set/bbs.pl index d0960a30..8709dcd0 100644 --- a/cmd/set/bbs.pl +++ b/cmd/set/bbs.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; if ($user) { diff --git a/cmd/set/believe.pl b/cmd/set/believe.pl index 95d776c3..479aa920 100644 --- a/cmd/set/believe.pl +++ b/cmd/set/believe.pl @@ -15,13 +15,13 @@ my @nodes; return (1, $self->msg('e5')) if $self->priv < 6; return (1, $self->msg('e22', $node)) unless is_callsign($node); -my $user = DXUser->get_current($node); +my $user = DXUser::get_current($node); return (1, $self->msg('e13', $node)) unless $user->is_node; foreach $call (@args) { return (1, $self->msg('e22', $node)) unless is_callsign($call); - my $u = DXUser->get_current($call); + my $u = DXUser::get_current($call); if ($u->is_node) { push @nodes, $call; } else { diff --git a/cmd/set/clx.pl b/cmd/set/clx.pl index f27174ad..eaead5ab 100644 --- a/cmd/set/clx.pl +++ b/cmd/set/clx.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; if ($user) { diff --git a/cmd/set/dxcq.pl b/cmd/set/dxcq.pl index 89c1a9c7..bfe40760 100644 --- a/cmd/set/dxcq.pl +++ b/cmd/set/dxcq.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantdxcq(1); if ($user->wantdxitu) { diff --git a/cmd/set/dxgrid.pl b/cmd/set/dxgrid.pl index 0dfd29dd..8a2798b8 100644 --- a/cmd/set/dxgrid.pl +++ b/cmd/set/dxgrid.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantgrid(1); $user->put; diff --git a/cmd/set/dxitu.pl b/cmd/set/dxitu.pl index 45e07497..0e002ba7 100644 --- a/cmd/set/dxitu.pl +++ b/cmd/set/dxitu.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantdxitu(1); if ($user->wantdxcq) { diff --git a/cmd/set/dxnet.pl b/cmd/set/dxnet.pl index 2d184adb..6d201136 100644 --- a/cmd/set/dxnet.pl +++ b/cmd/set/dxnet.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; if ($user) { diff --git a/cmd/set/email.pl b/cmd/set/email.pl index ac6c991c..c5bfe52b 100644 --- a/cmd/set/email.pl +++ b/cmd/set/email.pl @@ -15,7 +15,7 @@ my @f = split /\s+/, $line; return (1, $self->msg('emaile1')) if !$line; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $user->email(\@f); $user->wantemail(1); diff --git a/cmd/set/homebbs.pl b/cmd/set/homebbs.pl index 72a48f0a..ca563975 100644 --- a/cmd/set/homebbs.pl +++ b/cmd/set/homebbs.pl @@ -16,7 +16,7 @@ $line =~ s/\s+$//; return (1, $self->msg('bbse1')) if !$line; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $line = uc $line; $user->bbs($line); diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index a643bed7..605c0c21 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -17,7 +17,7 @@ $line =~ s/[{}]//g; # no braces allowed return (1, $self->msg('hnodee1')) if !$line; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $line = uc $line; $user->homenode($line); diff --git a/cmd/set/isolate.pl b/cmd/set/isolate.pl index 90de6683..893c204c 100644 --- a/cmd/set/isolate.pl +++ b/cmd/set/isolate.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; my $f; diff --git a/cmd/set/language.pl b/cmd/set/language.pl index 8429a384..5c85b303 100644 --- a/cmd/set/language.pl +++ b/cmd/set/language.pl @@ -22,7 +22,7 @@ $line = lc $line; return (1, $self->msg('lange1', join(',', @lang))) unless grep $_ eq $line, @lang; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $user->lang($line); $user->put(); diff --git a/cmd/set/local_node.pl b/cmd/set/local_node.pl index b221c881..0605c959 100644 --- a/cmd/set/local_node.pl +++ b/cmd/set/local_node.pl @@ -13,7 +13,7 @@ my @out; return (1, $self->msg('e5')) unless $self->priv >= 5; foreach my $call (@args) { - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); push(@out, $self->msg('e3', 'set/localnode', $call)), next unless $user; push(@out, $self->msg('e13', $call)), next unless $user->is_node; my $group = $user->group || []; diff --git a/cmd/set/location.pl b/cmd/set/location.pl index 1e758f81..834ce613 100644 --- a/cmd/set/location.pl +++ b/cmd/set/location.pl @@ -18,7 +18,7 @@ return (1, $self->msg('loce1')) if !$line; return (1, $self->msg('loce3', uc $line)) if is_qra($line); return (1, $self->msg('loce2', $line)) unless is_latlong($line); -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $line = uc $line; my ($lat, $long) = DXBearing::stoll($line); diff --git a/cmd/set/lockout.pl b/cmd/set/lockout.pl index ac7cc83a..feb326eb 100644 --- a/cmd/set/lockout.pl +++ b/cmd/set/lockout.pl @@ -21,7 +21,7 @@ if ($self->priv < 9) { foreach $call (@args) { $call = uc $call; unless ($self->remotecmd || $self->inscript) { - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->lockout(1); $ref->put(); push @out, $self->msg("lockout", $call); diff --git a/cmd/set/name.pl b/cmd/set/name.pl index b8dd3150..4fae3e16 100644 --- a/cmd/set/name.pl +++ b/cmd/set/name.pl @@ -17,7 +17,7 @@ $line =~ s/[{}]//g; # no braces allowed return (1, $self->msg('namee1')) if !$line; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $user->name($line); $user->put(); diff --git a/cmd/set/node.pl b/cmd/set/node.pl index 82e8be11..8a1f8111 100644 --- a/cmd/set/node.pl +++ b/cmd/set/node.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; if ($user) { diff --git a/cmd/set/obscount.pl b/cmd/set/obscount.pl index 1e9b53b5..1bf73e2d 100644 --- a/cmd/set/obscount.pl +++ b/cmd/set/obscount.pl @@ -22,7 +22,7 @@ foreach $call (@args) { $call = uc $call; my $dxchan = DXChannel::get($call); $user = $dxchan->user if $dxchan; - $user = DXUser->get_current($call); + $user = DXUser::get_current($call); if ($user) { unless ($user->is_node) { push @out, $self->msg('e13', $call); diff --git a/cmd/set/passphrase.pl b/cmd/set/passphrase.pl index 9cd270c6..7e6b743f 100644 --- a/cmd/set/passphrase.pl +++ b/cmd/set/passphrase.pl @@ -25,7 +25,7 @@ if ($call) { return (1, $self->msg('e5')); } return (1, $self->msg('e29')) unless @args; - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->passphrase($args[0]); $ref->put(); push @out, $self->msg("passphrase", $call); diff --git a/cmd/set/password.pl b/cmd/set/password.pl index 3a1dc242..9366c0bb 100644 --- a/cmd/set/password.pl +++ b/cmd/set/password.pl @@ -26,7 +26,7 @@ if ($call) { return (1, $self->msg('e5')); } return (1, $self->msg('e29')) unless @args; - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->passwd($args[0]); $ref->put(); push @out, $self->msg("password", $call); diff --git a/cmd/set/pinginterval.pl b/cmd/set/pinginterval.pl index 33131cc5..4d215747 100644 --- a/cmd/set/pinginterval.pl +++ b/cmd/set/pinginterval.pl @@ -34,7 +34,7 @@ foreach $call (@args) { $call = uc $call; my $dxchan = DXChannel::get($call); $user = $dxchan->user if $dxchan; - $user = DXUser->get($call) unless $user; + $user = DXUser::get($call) unless $user; if ($user) { unless ($user->is_node) { push @out, $self->msg('e13', $call); diff --git a/cmd/set/privilege.pl b/cmd/set/privilege.pl index 183c101b..865819e7 100644 --- a/cmd/set/privilege.pl +++ b/cmd/set/privilege.pl @@ -32,7 +32,7 @@ foreach $call (@args) { $ref->user->priv($priv); $ref->user->put(); } - if (!$ref && ($user = DXUser->get($call))) { + if (!$ref && ($user = DXUser::get($call))) { $user->priv($priv); $user->put(); } diff --git a/cmd/set/prompt.pl b/cmd/set/prompt.pl index 3ff1291e..61045672 100644 --- a/cmd/set/prompt.pl +++ b/cmd/set/prompt.pl @@ -16,7 +16,7 @@ $line =~ s/\s+$//; return (1, $self->msg('e9')) if !$line; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $user->prompt($line); $self->{prompt} = $line; # this is like this because $self->prompt is a function that does something else diff --git a/cmd/set/qra.pl b/cmd/set/qra.pl index e4c4edcb..96000de4 100644 --- a/cmd/set/qra.pl +++ b/cmd/set/qra.pl @@ -17,7 +17,7 @@ $line =~ s/\s+$//; return (1, $self->msg('qrae1')) if !$line; return (1, $self->msg('qrae2', $line)) unless is_qra($line); -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { my $qra = uc $line; my $oldqra = $user->qra || ""; diff --git a/cmd/set/qth.pl b/cmd/set/qth.pl index 03c5c849..84462f0c 100644 --- a/cmd/set/qth.pl +++ b/cmd/set/qth.pl @@ -17,7 +17,7 @@ $line =~ s/[{}]//g; # no braces allowed return (1, $self->msg('qthe1')) if !$line; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $user->qth($line); $user->put(); diff --git a/cmd/set/register.pl b/cmd/set/register.pl index 22c85be9..ac96c2a4 100644 --- a/cmd/set/register.pl +++ b/cmd/set/register.pl @@ -22,7 +22,7 @@ return (1, $self->msg('reginac')) unless $main::reqreg; foreach $call (@args) { $call = uc $call; unless ($self->remotecmd || $self->inscript) { - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->registered(1); $ref->put(); push @out, $self->msg("reg", $call); diff --git a/cmd/set/routepc19.pl b/cmd/set/routepc19.pl index 4c5d2efc..a63af3cf 100644 --- a/cmd/set/routepc19.pl +++ b/cmd/set/routepc19.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantroutepc19(1); $user->put; diff --git a/cmd/set/sendpc16.pl b/cmd/set/sendpc16.pl index 11ca2e87..a33c8160 100644 --- a/cmd/set/sendpc16.pl +++ b/cmd/set/sendpc16.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantsendpc16(1); $user->put; diff --git a/cmd/set/spider.pl b/cmd/set/spider.pl index bd50853c..23cdd378 100644 --- a/cmd/set/spider.pl +++ b/cmd/set/spider.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); $create = !$user; $user = DXUser->new($call) if $create; if ($user) { diff --git a/cmd/set/sys_location.pl b/cmd/set/sys_location.pl index 428d5bfc..33633b67 100644 --- a/cmd/set/sys_location.pl +++ b/cmd/set/sys_location.pl @@ -20,7 +20,7 @@ return (1, $self->msg('loce1')) if !$line; return (1, $self->msg('loce3', uc $line)) if is_qra($line); return (1, $self->msg('loce2', $line)) unless is_latlong($line); -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $line = uc $line; my ($lat, $long) = DXBearing::stoll($line); diff --git a/cmd/set/user.pl b/cmd/set/user.pl index 832dcac6..209f0e98 100644 --- a/cmd/set/user.pl +++ b/cmd/set/user.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); return (1, $self->msg('usernf', $call)) if !$user; $user->sort('U'); $user->priv(0); diff --git a/cmd/set/uservar.pl b/cmd/set/uservar.pl index c5e39fb7..9d955a7c 100644 --- a/cmd/set/uservar.pl +++ b/cmd/set/uservar.pl @@ -14,7 +14,7 @@ return (1, $self->msg('suser1')) if @args < 3; my $call = uc $args[0]; -my $ref = DXUser->get_current($call); +my $ref = DXUser::get_current($call); my $field = $args[1]; my $value = $args[2]; diff --git a/cmd/set/usstate.pl b/cmd/set/usstate.pl index f6c56721..3babc880 100644 --- a/cmd/set/usstate.pl +++ b/cmd/set/usstate.pl @@ -17,7 +17,7 @@ return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantusstate(1); if ($user->wantdxitu) { diff --git a/cmd/set/wantpc16.pl b/cmd/set/wantpc16.pl index 0567de40..9006b1c6 100644 --- a/cmd/set/wantpc16.pl +++ b/cmd/set/wantpc16.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantpc16(1); $user->put; diff --git a/cmd/set/wantpc9x.pl b/cmd/set/wantpc9x.pl index 60566f04..2a5f42f9 100644 --- a/cmd/set/wantpc9x.pl +++ b/cmd/set/wantpc9x.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantpc9x(1); $user->put; diff --git a/cmd/show/grayline.pl b/cmd/show/grayline.pl index c2c6fcff..c1a50922 100644 --- a/cmd/show/grayline.pl +++ b/cmd/show/grayline.pl @@ -33,7 +33,7 @@ my @in; if (@list) { foreach $l (@list) { - my $user = DXUser->get_current(uc $l); + my $user = DXUser::get_current(uc $l); if ($user && $user->lat && $user->long) { push @in, [$user->qth, $user->lat, -$user->long, uc $l ]; } else { diff --git a/cmd/show/isolate.pl b/cmd/show/isolate.pl index 17470bde..daa77f42 100644 --- a/cmd/show/isolate.pl +++ b/cmd/show/isolate.pl @@ -18,7 +18,7 @@ use DB_File; my ($action, $count, $key, $data) = (0,0,0,0); for ($action = DXUser::R_FIRST, $count=0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { if ($data =~ m{isolate}) { - my $u = DXUser->get_current($key); + my $u = DXUser::get_current($key); if ($u && $u->isolate) { push @out, $key; ++$count; diff --git a/cmd/show/lockout.pl b/cmd/show/lockout.pl index ff56ca19..91ae4f4a 100644 --- a/cmd/show/lockout.pl +++ b/cmd/show/lockout.pl @@ -26,7 +26,7 @@ my ($action, $count, $key, $data) = (0,0,0,0); eval qq{for (\$action = DXUser::R_FIRST, \$count = 0; !\$DXUser::dbm->seq(\$key, \$data, \$action); \$action = DXUser::R_NEXT) { if (\$data =~ m{lockout}) { if (\$line eq 'ALL' || \$key =~ /^$line/) { - my \$ur = DXUser->get_current(\$key); + my \$ur = DXUser::get_current(\$key); if (\$ur && \$ur->lockout) { push \@out, \$key; ++\$count; diff --git a/cmd/show/moon.pl b/cmd/show/moon.pl index 6203797f..1bc61479 100644 --- a/cmd/show/moon.pl +++ b/cmd/show/moon.pl @@ -40,7 +40,7 @@ my @in; if (@list) { foreach $l (@list) { - my $user = DXUser->get_current(uc $l); + my $user = DXUser::get_current(uc $l); if ($user && $user->lat && $user->long) { push @in, [$user->qth, $user->lat, -$user->long, uc $l ]; } else { diff --git a/cmd/show/node.pl b/cmd/show/node.pl index 1c6ee49e..b41cd93f 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -39,7 +39,7 @@ if (@call == 0) { my $call; foreach $call (sort @call) { my $clref = Route::Node::get($call); - my $uref = DXUser->get_current($call); + my $uref = DXUser::get_current($call); my ($sort, $ver, $build); my $pcall = sprintf "%-11s", $call; diff --git a/cmd/show/registered.pl b/cmd/show/registered.pl index 593ef0f5..5eb6d78d 100644 --- a/cmd/show/registered.pl +++ b/cmd/show/registered.pl @@ -24,7 +24,7 @@ my ($action, $count, $key, $data) = (0,0,0,0); eval qq{for (\$action = DXUser::R_FIRST, \$count = 0; !\$DXUser::dbm->seq(\$key, \$data, \$action); \$action = DXUser::R_NEXT) { if (\$data =~ m{registered}) { if (!\$line || (\$line && \$key =~ /^$line/)) { - my \$u = DXUser->get_current(\$key); + my \$u = DXUser::get_current(\$key); if (\$u && \$u->registered) { push \@out, \$key; ++\$count; diff --git a/cmd/show/station.pl b/cmd/show/station.pl index a5ffe2ad..55976a69 100644 --- a/cmd/show/station.pl +++ b/cmd/show/station.pl @@ -26,7 +26,7 @@ if (@f <= 2 && uc $f[0] eq 'ALL') { } foreach $call (@calls) { - my $ref = DXUser->get_current($call); + my $ref = DXUser::get_current($call); next if !$ref; my $lat = $ref->lat; my $long = $ref->long; @@ -42,7 +42,7 @@ if (@f <= 2 && uc $f[0] eq 'ALL') { } } else { foreach $call (@f) { - my $ref = DXUser->get_current($call); + my $ref = DXUser::get_current($call); if ($ref) { my $name = $ref->name; my $qth = $ref->qth; diff --git a/cmd/show/sun.pl b/cmd/show/sun.pl index 36aaa078..cf27423e 100644 --- a/cmd/show/sun.pl +++ b/cmd/show/sun.pl @@ -39,7 +39,7 @@ my @in; if (@list) { foreach $l (@list) { - my $user = DXUser->get_current(uc $l); + my $user = DXUser::get_current(uc $l); if ($user && $user->lat && $user->long) { push @in, [$user->qth, $user->lat, -$user->long, uc $l ]; } else { diff --git a/cmd/show/users.pl b/cmd/show/users.pl index 125b23d1..1d665eba 100644 --- a/cmd/show/users.pl +++ b/cmd/show/users.pl @@ -12,7 +12,7 @@ my @out; if (@list) { foreach my $call (sort @list) { - my $uref = DXUser->get_current($call); + my $uref = DXUser::get_current($call); if ($uref) { my $name = $uref->name || '?'; my $qth = $uref->qth || '?'; diff --git a/cmd/spoof.pl b/cmd/spoof.pl index ad2f9b8c..e0194a11 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -26,7 +26,7 @@ if ($self->priv < 9) { my @out; $call = uc $call; -my $user = DXUser->get_current($call); +my $user = DXUser::get_current($call); unless ($user) { $user = DXUser->new($call); push @out, $self->msg('spf1', $call); diff --git a/cmd/stat/user.pl b/cmd/stat/user.pl index 1e0f15da..5cb57f29 100644 --- a/cmd/stat/user.pl +++ b/cmd/stat/user.pl @@ -12,7 +12,7 @@ my $call; my @out; foreach $call (@list) { $call = uc $call; - my $ref = DXUser->get_current($call); + my $ref = DXUser::get_current($call); if ($ref) { if ($self->consort eq 'ax25') { @out = grep { !/(Password|Privilege)/ } print_all_fields($self, $ref, "User Information $call"); diff --git a/cmd/sysop.pl b/cmd/sysop.pl index ba42ba60..6dcef2c2 100644 --- a/cmd/sysop.pl +++ b/cmd/sysop.pl @@ -6,7 +6,7 @@ # my ($self, $line) = @_; -my $user = DXUser->get_current($self->call); +my $user = DXUser::get_current($self->call); my $passwd = $user->passwd if $user; my $lth = length $passwd; $lth = 100 unless $lth; diff --git a/cmd/uncatchup.pl b/cmd/uncatchup.pl index 8a6d736a..8a6f02a6 100644 --- a/cmd/uncatchup.pl +++ b/cmd/uncatchup.pl @@ -16,7 +16,7 @@ my @f = split /\s+/, $line; return (1, "usage: catchup all|[= 2; my $call = uc shift @f; -my $user = DXUser->get_current($call); +my $user = DXUser::get_current($call); return (1, "$call not a node") unless $user && $user->sort ne 'U'; my @out; diff --git a/cmd/unset/believe.pl b/cmd/unset/believe.pl index 2d0a6e3a..a7dcfb83 100644 --- a/cmd/unset/believe.pl +++ b/cmd/unset/believe.pl @@ -15,13 +15,13 @@ my @nodes; return (1, $self->msg('e5')) if $self->priv < 6; return (1, $self->msg('e22', $node)) unless is_callsign($node); -my $user = DXUser->get_current($node); +my $user = DXUser::get_current($node); return (1, $self->msg('e13', $node)) unless $user->is_node; foreach $call (@args) { return (1, $self->msg('e22', $node)) unless is_callsign($call); - my $u = DXUser->get_current($call); + my $u = DXUser::get_current($call); push @nodes, $call; } diff --git a/cmd/unset/dxcq.pl b/cmd/unset/dxcq.pl index fc2d7c5e..6cc68f05 100644 --- a/cmd/unset/dxcq.pl +++ b/cmd/unset/dxcq.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantdxcq(0); $user->put; diff --git a/cmd/unset/dxgrid.pl b/cmd/unset/dxgrid.pl index f18f2c22..bee3d906 100644 --- a/cmd/unset/dxgrid.pl +++ b/cmd/unset/dxgrid.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantgrid(0); $user->put; diff --git a/cmd/unset/dxitu.pl b/cmd/unset/dxitu.pl index 27b7fc41..1b4c2456 100644 --- a/cmd/unset/dxitu.pl +++ b/cmd/unset/dxitu.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantdxitu(0); $user->put; diff --git a/cmd/unset/email.pl b/cmd/unset/email.pl index 0f61405e..c05a9e53 100644 --- a/cmd/unset/email.pl +++ b/cmd/unset/email.pl @@ -10,7 +10,7 @@ my ($self, $line) = @_; my $call = $self->call; my $user; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { $user->wantemail(0); $user->put(); diff --git a/cmd/unset/isolate.pl b/cmd/unset/isolate.pl index 07ad21dc..df14e8a9 100644 --- a/cmd/unset/isolate.pl +++ b/cmd/unset/isolate.pl @@ -23,7 +23,7 @@ foreach $call (@args) { if ($chan) { push @out, $self->msg('nodee1', $call); } else { - $user = DXUser->get($call); + $user = DXUser::get($call); return (1, $self->msg('usernf', $call)) if !$user; $user->isolate(0); $user->close(); diff --git a/cmd/unset/local_node.pl b/cmd/unset/local_node.pl index c9439ae3..9753fb59 100644 --- a/cmd/unset/local_node.pl +++ b/cmd/unset/local_node.pl @@ -13,7 +13,7 @@ my @out; return (1, $self->msg('e5')) unless $self->priv >= 5; foreach my $call (@args) { - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); push(@out, $self->msg('e3', 'set/localnode', $call)), next unless $user; push(@out, $self->msg('e13', $call)), next unless $user->is_node; my $group = $user->group || []; diff --git a/cmd/unset/lockout.pl b/cmd/unset/lockout.pl index 406d2125..02169f30 100644 --- a/cmd/unset/lockout.pl +++ b/cmd/unset/lockout.pl @@ -21,7 +21,7 @@ if ($self->priv < 9) { foreach $call (@args) { $call = uc $call; unless ($self->remotecmd || $self->inscript) { - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->lockout(0); $ref->put(); push @out, $self->msg("lockoutun", $call); diff --git a/cmd/unset/passphrase.pl b/cmd/unset/passphrase.pl index 9bf6a61c..15ef58d1 100644 --- a/cmd/unset/passphrase.pl +++ b/cmd/unset/passphrase.pl @@ -24,7 +24,7 @@ if ($self->priv < 9) { for (@args) { my $call = uc $_; - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->unset_passphrase; $ref->put(); push @out, $self->msg("passphraseu", $call); diff --git a/cmd/unset/password.pl b/cmd/unset/password.pl index fcaa4c74..0a844ca7 100644 --- a/cmd/unset/password.pl +++ b/cmd/unset/password.pl @@ -24,7 +24,7 @@ if ($self->priv < 9) { for (@args) { my $call = uc $_; - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->unset_passwd; $ref->put(); push @out, $self->msg("passwordu", $call); diff --git a/cmd/unset/prompt.pl b/cmd/unset/prompt.pl index 4aff6d4a..063c9d48 100644 --- a/cmd/unset/prompt.pl +++ b/cmd/unset/prompt.pl @@ -10,7 +10,7 @@ my ($self, $line) = @_; my $call = $self->call; my $user; -$user = DXUser->get_current($call); +$user = DXUser::get_current($call); if ($user) { delete $user->{prompt}; delete $self->{prompt}; diff --git a/cmd/unset/register.pl b/cmd/unset/register.pl index 5ba142d6..a0c36d78 100644 --- a/cmd/unset/register.pl +++ b/cmd/unset/register.pl @@ -22,7 +22,7 @@ return (1, $self->msg('reginac')) unless $main::reqreg; foreach $call (@args) { $call = uc $call; unless ($self->remotecmd || $self->inscript) { - if ($ref = DXUser->get_current($call)) { + if ($ref = DXUser::get_current($call)) { $ref->registered(0); $ref->put(); my $dxchan = DXChannel::get($call); diff --git a/cmd/unset/routepc19.pl b/cmd/unset/routepc19.pl index ffb46f89..d04bedca 100644 --- a/cmd/unset/routepc19.pl +++ b/cmd/unset/routepc19.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantroutepc19(0); $user->put; diff --git a/cmd/unset/sendpc16.pl b/cmd/unset/sendpc16.pl index 59919491..0ef16cb3 100644 --- a/cmd/unset/sendpc16.pl +++ b/cmd/unset/sendpc16.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantsendpc16(0); $user->put; diff --git a/cmd/unset/usstate.pl b/cmd/unset/usstate.pl index df61bae5..2a2d95dd 100644 --- a/cmd/unset/usstate.pl +++ b/cmd/unset/usstate.pl @@ -17,7 +17,7 @@ return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present; foreach $call (@args) { $call = uc $call; - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantusstate(0); $user->put; diff --git a/cmd/unset/wantpc16.pl b/cmd/unset/wantpc16.pl index f87b6db5..a749084a 100644 --- a/cmd/unset/wantpc16.pl +++ b/cmd/unset/wantpc16.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantpc16(0); $user->put; diff --git a/cmd/unset/wantpc9x.pl b/cmd/unset/wantpc9x.pl index 2bc876ba..e7279583 100644 --- a/cmd/unset/wantpc9x.pl +++ b/cmd/unset/wantpc9x.pl @@ -16,7 +16,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { return (1, $self->msg('e12')) unless is_callsign($call); - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if ($user) { $user->wantpc9x(0); $user->put; diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index cdde9a20..854a6354 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -971,7 +971,7 @@ sub format_dx_spot my $comment = substr (($_[3] || ''), 0, $clth); $comment .= ' ' x ($clth - length($comment)); if ($self->{user}->wantgrid) { - my $ref = DXUser->get_current($_[4]); + my $ref = DXUser::get_current($_[4]); if ($ref) { $loc = $ref->qra || ''; $loc = ' ' . substr($loc, 0, 4) if $loc; @@ -1015,7 +1015,7 @@ sub dx_spot } elsif ($self->{gtk}) { my ($dxloc, $byloc); - my $ref = DXUser->get_current($_[4]); + my $ref = DXUser::get_current($_[4]); if ($ref) { $byloc = $ref->qra; $byloc = substr($byloc, 0, 4) if $byloc; @@ -1023,7 +1023,7 @@ sub dx_spot my $spot = $_[1]; $spot =~ s|/\w{1,4}$||; - $ref = DXUser->get_current($spot); + $ref = DXUser::get_current($spot); if ($ref) { $dxloc = $ref->qra; $dxloc = substr($dxloc, 0, 4) if $dxloc; @@ -1191,7 +1191,7 @@ sub import_cmd if ($dxchan) { @out = $s->run($dxchan, 1); } else { - my $u = DXUser->get($call); + my $u = DXUser::get($call); if ($u) { $dxchan = $main::me; my $old = $dxchan->{call}; diff --git a/perl/DXCron.pm b/perl/DXCron.pm index 2c02be53..70c8e660 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -219,7 +219,7 @@ sub last_connect { my $call = uc shift; return $main::systime if DXChannel::get($call); - my $user = DXUser->get($call); + my $user = DXUser::get($call); return $user ? $user->lastin : 0; } diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 9c75a048..e6662b59 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -124,7 +124,7 @@ sub alloc $self->{gotit} = []; # $self->{lastt} = $main::systime; $self->{lines} = []; - $self->{private} = 1 if $bulltopriv && DXUser->get_current($self->{to}); + $self->{private} = 1 if $bulltopriv && DXUser::get_current($self->{to}); return $self; } @@ -200,7 +200,7 @@ sub handle_28 $ref->{lastt} = $main::systime; # look to see whether this is a non private message sent to a known callsign - my $uref = DXUser->get_current($ref->{to}); + my $uref = DXUser::get_current($ref->{to}); if (is_callsign($ref->{to}) && !$ref->{private} && $uref && $uref->homenode) { $ref->{private} = 1; dbg("set bull to $ref->{to} to private") if isdbg('msg'); @@ -476,7 +476,7 @@ sub notify { my $ref = shift; my $to = $ref->{to}; - my $uref = DXUser->get_current($to); + my $uref = DXUser::get_current($to); my $dxchan = DXChannel::get($to); if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) { my $email = $uref->email; diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 4d79ecf5..69eb2228 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -232,7 +232,7 @@ sub init do "$main::data/hop_table.pl" if -e "$main::data/hop_table.pl"; confess $@ if $@; - my $user = DXUser->get($main::mycall); + my $user = DXUser::get($main::mycall); die "User $main::mycall not setup or disappeared RTFM" unless $user; $myprot_version += $main::version*100; @@ -1122,7 +1122,7 @@ sub process_rcmd { my ($self, $tonode, $fromnode, $user, $cmd) = @_; if ($tonode eq $main::mycall) { - my $ref = DXUser->get_current($fromnode); + my $ref = DXUser::get_current($fromnode); my $cref = Route::Node::get($fromnode); Log('rcmd', 'in', ($ref->{priv}||0), $fromnode, $cmd); if ($cmd !~ /^\s*rcmd/i && $cref && $ref && $ref->homenode && $cref->call eq $ref->homenode) { # not allowed to relay RCMDS! @@ -1141,7 +1141,7 @@ sub process_rcmd $self->send_rcmd_reply($main::mycall, $fromnode, $user, "your attempt is logged, Tut tut tut...!"); } } else { - my $ref = DXUser->get_current($tonode); + my $ref = DXUser::get_current($tonode); if ($ref && $ref->is_clx) { $self->route($tonode, pc84($fromnode, $tonode, $user, $cmd)); } else { @@ -1166,7 +1166,7 @@ sub process_rcmd_reply $dxchan->send($line) if $dxchan; } } else { - my $ref = DXUser->get_current($tonode); + my $ref = DXUser::get_current($tonode); if ($ref && $ref->is_clx) { $self->route($tonode, pc85($fromnode, $tonode, $user, $line)); } else { diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index f28de6d0..e7160d7c 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -226,7 +226,7 @@ sub handle_11 # # fix up qra locators of known users - my $user = DXUser->get_current($spot[4]); + my $user = DXUser::get_current($spot[4]); if ($user) { my $qra = $user->qra; unless ($qra && is_qra($qra)) { @@ -463,7 +463,7 @@ sub handle_16 # reject this if we think it is a node already my $r = Route::Node::get($call); - my $u = DXUser->get_current($call) unless $r; + my $u = DXUser::get_current($call) unless $r; if ($r || ($u && $u->is_node)) { dbg("PCPROT: $call is a node") if isdbg('chanerr'); next; @@ -485,7 +485,7 @@ sub handle_16 } # add this station to the user database, if required - my $user = DXUser->get_current($ncall); + my $user = DXUser::get_current($ncall); $user = DXUser->new($call) unless $user; $user->homenode($parent->call) if !$user->homenode; $user->node($parent->call); @@ -568,7 +568,7 @@ sub handle_17 $parent->del_user($uref); # send info to all logged in thingies - my $user = DXUser->get_current($ncall); + my $user = DXUser::get_current($ncall); $self->tell_login('logoutu', "$ncall: $ucall") if $user && $user->is_local_node; $self->tell_buddies('logoutb', $ucall, $ncall); @@ -638,7 +638,7 @@ sub check_add_node my $call = shift; # add this station to the user database, if required (don't remove SSID from nodes) - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); if (!$user) { $user = DXUser->new($call); $user->priv(1); # I have relented and defaulted nodes @@ -1142,7 +1142,7 @@ sub handle_41 } # add this station to the user database, if required - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); $user = DXUser->new($call) unless $user; if ($sort == 1) { diff --git a/perl/DXUser.pm b/perl/DXUser.pm index c4e3996b..e2c24f59 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -237,7 +237,6 @@ sub new sub get { - my $pkg = shift; my $call = uc shift; my $data; @@ -248,6 +247,11 @@ sub get # search for it unless ($dbm->get($call, $data)) { $ref = decode($data); + dbg("DXUser::get: data error on $call $!") unless $ref; + if ($ref && ref $ref ne 'DXUser') { + dbg("DXUser::get: got strange answer from decode ". ref $ref. " ignoring"); + return undef; + } $lru->put($call, $ref); return $ref; } @@ -264,14 +268,11 @@ sub get sub get_current { - my $pkg = shift; my $call = uc shift; my $dxchan = DXChannel::get($call); return $dxchan->user if $dxchan; - my $rref = Route::get($call); - return $rref->user if $rref && exists $rref->{user}; - return $pkg->get($call); + return get($call); } # diff --git a/perl/DXXml/Cmd.pm b/perl/DXXml/Cmd.pm index f9521e46..5f894568 100644 --- a/perl/DXXml/Cmd.pm +++ b/perl/DXXml/Cmd.pm @@ -33,7 +33,7 @@ sub handle_input @in = (DXCommandmode::run_cmd($dxchan, $cmd)); } else { # remote command - my $ref = DXUser->get_current($self->{o}); + my $ref = DXUser::get_current($self->{o}); my $cref = Route::Node::get($self->{o}); my $answer; @@ -61,7 +61,7 @@ sub topcxx { my $self = shift; - my $ref = DXUser->get_current($self->{to}); + my $ref = DXUser::get_current($self->{to}); my $s; if ($ref && $ref->is_clx && $self->{u}) { diff --git a/perl/DXXml/Ping.pm b/perl/DXXml/Ping.pm index 29d7ab1c..27058719 100644 --- a/perl/DXXml/Ping.pm +++ b/perl/DXXml/Ping.pm @@ -68,7 +68,7 @@ sub add push @$ref, $self; $pings{$to} = $ref; - my $u = DXUser->get_current($to); + my $u = DXUser::get_current($to); if ($u) { $u->lastping(($via || $from), $main::systime); $u->put; @@ -137,7 +137,7 @@ sub _handle_believe { my ($from, $via) = @_; - my $user = DXUser->get_current($from); + my $user = DXUser::get_current($from); if ($user) { $user->set_believe($via); $user->put; diff --git a/perl/DXXml/Text.pm b/perl/DXXml/Text.pm index 34bacc68..3b8b5b44 100644 --- a/perl/DXXml/Text.pm +++ b/perl/DXXml/Text.pm @@ -40,7 +40,7 @@ sub topcxx my $dxchan = shift; my @out; - my $ref = DXUser->get_current($self->{to}); + my $ref = DXUser::get_current($self->{to}); for (split /(?:%0D)?\%0A/, $self->{content}) { my $line = $_; $line =~ s/\s*$//; diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index ae50f036..0ca2de83 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -106,7 +106,7 @@ sub dequeue my $sort = $conn->{csort}; $sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1'; my $uref; - if ($main::passwdreq || ($uref = DXUser->get_current($msg)) && $uref->passwd ) { + if ($main::passwdreq || ($uref = DXUser::get_current($msg)) && $uref->passwd ) { $conn->conns($msg); $conn->{state} = 'WP'; $conn->{decho} = $conn->{echo}; @@ -120,7 +120,7 @@ sub dequeue $conn->disconnect; } } elsif ($conn->{state} eq 'WP' ) { - my $uref = DXUser->get_current($conn->{call}); + my $uref = DXUser::get_current($conn->{call}); $msg =~ s/[\r\n]+$//; if ($uref && $msg eq $uref->passwd) { my $sort = $conn->{csort}; diff --git a/perl/Filter.pm b/perl/Filter.pm index e599c59b..b71ee95a 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -385,7 +385,7 @@ sub parse while (@f) { if ($ntoken == 0) { - if (@f && $dxchan->priv >= 8 && ((is_callsign(uc $f[0]) && DXUser->get(uc $f[0])) || $f[0] =~ /(?:node|user)_default/)) { + if (@f && $dxchan->priv >= 8 && ((is_callsign(uc $f[0]) && DXUser::get(uc $f[0])) || $f[0] =~ /(?:node|user)_default/)) { $call = shift @f; if ($f[0] eq 'input') { shift @f; @@ -550,7 +550,7 @@ sub cmd return $dxchan->msg('filter5') unless $line; my ($r, $filter, $fno, $user, $s) = $self->parse($dxchan, $sort, $line); - my $u = DXUser->get_current($user); + my $u = DXUser::get_current($user); return (1, $dxchan->msg('isow', $user)) if $u && $u->isolate; return (1, $filter) if $r; diff --git a/perl/VE7CC.pm b/perl/VE7CC.pm index c0138cd7..81a11144 100644 --- a/perl/VE7CC.pm +++ b/perl/VE7CC.pm @@ -27,7 +27,7 @@ sub dx_spot my $t = shift; my $loc_spotted = ''; my $loc_spotter = ''; - my $ref = DXUser->get_current($spotted); + my $ref = DXUser::get_current($spotted); if ($ref) { my $loc = $ref->qra || ''; $loc_spotted =substr($loc, 0, 4) if $loc; @@ -42,7 +42,7 @@ sub dx_spot my $spotted_cc = (Prefix::cty_data($spotted))[5]; my $spotter_cc = (Prefix::cty_data($_[1]))[5]; - $ref = DXUser->get_current($_[1]); + $ref = DXUser::get_current($_[1]); if ($ref) { my $loc = $ref->qra || ''; $loc_spotter = substr($loc, 0, 4) if $loc; diff --git a/perl/Version.pm b/perl/Version.pm index 95d16219..aded7d3d 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '219'; +$build = '220'; 1; diff --git a/perl/cluster.pl b/perl/cluster.pl index 4b7abd58..67918966 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -165,7 +165,7 @@ sub new_channel # set up the basic channel info # is there one already connected to me - locally? - my $user = DXUser->get_current($call); + my $user = DXUser::get_current($call); my $dxchan = DXChannel::get($call); if ($dxchan) { if ($user && $user->is_node) { @@ -186,7 +186,7 @@ sub new_channel # is he locked out ? my $basecall = $call; $basecall =~ s/-\d+$//; - my $baseuser = DXUser->get_current($basecall); + my $baseuser = DXUser::get_current($basecall); my $lock = $user->lockout if $user; if ($baseuser && $baseuser->lockout || $lock) { if (!$user || !defined $lock || $lock) { @@ -387,9 +387,9 @@ DXUser->init($userfn, 1); # look for the sysop and the alias user and complain if they aren't there { - my $ref = DXUser->get($mycall); + my $ref = DXUser::get($mycall); die "$mycall missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9; - $ref = DXUser->get($myalias); + $ref = DXUser::get($myalias); die "$myalias missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9; } diff --git a/perl/convert_users.pl b/perl/convert_users.pl index 4aa3978b..b55daea0 100755 --- a/perl/convert_users.pl +++ b/perl/convert_users.pl @@ -50,7 +50,7 @@ package DXUser; @all = DXUser::get_all_calls(); for $a (@all) { - my $ref = DXUser->get($a); + my $ref = DXUser::get($a); my $s = $ref->encode() if $ref; print OUT "'$a' => q{$s},\n" if $a; $count++; diff --git a/perl/create_sysop.pl b/perl/create_sysop.pl index 622bc056..c0ac9e3a 100755 --- a/perl/create_sysop.pl +++ b/perl/create_sysop.pl @@ -28,7 +28,7 @@ sub delete_it sub create_it { - my $ref = DXUser->get(uc $mycall); + my $ref = DXUser::get(uc $mycall); $ref->del() if $ref; my $self = DXUser->new(uc $mycall); @@ -51,7 +51,7 @@ sub create_it $self->close(); # now do one for the alias - $ref = DXUser->get(uc $myalias); + $ref = DXUser::get(uc $myalias); $ref->del() if $ref; $self = DXUser->new(uc $myalias); diff --git a/perl/lock_nodes.pl b/perl/lock_nodes.pl index d57a6a0a..4763fb12 100755 --- a/perl/lock_nodes.pl +++ b/perl/lock_nodes.pl @@ -45,7 +45,7 @@ my @ignore; my ($action, $key, $data) = (0,0,0); for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { if ($data =~ m{sort => '[ACRSX]'}) { - my $user = DXUser->get($key); + my $user = DXUser::get($key); if ($user->is_node) { $nodes ++; if (grep $key eq $_, (@nodes, $mycall)) { diff --git a/perl/update_sysop.pl b/perl/update_sysop.pl index cec9f56e..2fccbb5a 100755 --- a/perl/update_sysop.pl +++ b/perl/update_sysop.pl @@ -29,7 +29,7 @@ sub create_it { my $ref; - while ($ref = DXUser->get(uc $mycall)) { + while ($ref = DXUser::get(uc $mycall)) { print "old call $mycall deleted\n"; $ref->del(); } @@ -55,7 +55,7 @@ sub create_it print "new call $mycall added\n"; # now do one for the alias - while ($ref = DXUser->get($myalias)) { + while ($ref = DXUser::get($myalias)) { print "old call $myalias deleted\n"; $ref->del(); }