+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=======================================================================
-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
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.
return (1, "usage: catchup <node call> all|[<msgno ...]") unless @f >= 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;
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;
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;
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;
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;
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;
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;
foreach $call (@args) {
$call = uc $call;
- $user = DXUser->get($call);
+ $user = DXUser::get($call);
unless ($user) {
$user = DXUser->new($call);
$user->sort('U');
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);
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;
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;
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) {
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) {
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 {
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) {
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) {
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;
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) {
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) {
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);
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);
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);
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;
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();
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 || [];
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);
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);
return (1, $self->msg('namee1')) if !$line;
-$user = DXUser->get_current($call);
+$user = DXUser::get_current($call);
if ($user) {
$user->name($line);
$user->put();
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) {
$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);
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);
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);
$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);
$ref->user->priv($priv);
$ref->user->put();
}
- if (!$ref && ($user = DXUser->get($call))) {
+ if (!$ref && ($user = DXUser::get($call))) {
$user->priv($priv);
$user->put();
}
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
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 || "";
return (1, $self->msg('qthe1')) if !$line;
-$user = DXUser->get_current($call);
+$user = DXUser::get_current($call);
if ($user) {
$user->qth($line);
$user->put();
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);
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;
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;
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) {
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);
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);
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];
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) {
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;
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;
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 {
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;
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;
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 {
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;
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;
}
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;
}
} 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;
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 {
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 || '?';
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);
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");
#
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;
return (1, "usage: catchup <node call> all|[<msgno ...]") unless @f >= 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;
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;
}
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;
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;
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;
my $call = $self->call;
my $user;
-$user = DXUser->get_current($call);
+$user = DXUser::get_current($call);
if ($user) {
$user->wantemail(0);
$user->put();
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();
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 || [];
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);
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);
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);
my $call = $self->call;
my $user;
-$user = DXUser->get_current($call);
+$user = DXUser::get_current($call);
if ($user) {
delete $user->{prompt};
delete $self->{prompt};
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);
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;
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;
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;
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;
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;
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;
} 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;
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;
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};
{
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;
}
$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;
}
$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');
{
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;
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;
{
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!
$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 {
$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 {
#
# 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)) {
# 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;
}
# 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);
$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);
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
}
# 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) {
sub get
{
- my $pkg = shift;
my $call = uc shift;
my $data;
# 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;
}
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);
}
#
@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;
{
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}) {
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;
{
my ($from, $via) = @_;
- my $user = DXUser->get_current($from);
+ my $user = DXUser::get_current($from);
if ($user) {
$user->set_believe($via);
$user->put;
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*$//;
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};
$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};
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;
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;
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;
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;
$version = '1.54';
$subversion = '0';
-$build = '219';
+$build = '220';
1;
# 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) {
# 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) {
# 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;
}
@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++;
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);
$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);
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)) {
{
my $ref;
- while ($ref = DXUser->get(uc $mycall)) {
+ while ($ref = DXUser::get(uc $mycall)) {
print "old call $mycall deleted\n";
$ref->del();
}
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();
}