projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improve shellregex handling a bit esp. for SQL stuff
[spider.git]
/
perl
/
DXUser.pm
diff --git
a/perl/DXUser.pm
b/perl/DXUser.pm
index 8bbd0fbcb6a5ad3fb4ef8f28ea644dca4a7fb00c..adddce0a4cef1f5701536e8d361530cc303f6244 100644
(file)
--- a/
perl/DXUser.pm
+++ b/
perl/DXUser.pm
@@
-75,7
+75,7
@@
$v3 = 0;
pagelth => '0,Current Pagelth',
pingint => '9,Node Ping interval',
nopings => '9,Ping Obs Count',
pagelth => '0,Current Pagelth',
pingint => '9,Node Ping interval',
nopings => '9,Ping Obs Count',
- wantlogininfo => '
9,Login info r
eq,yesno',
+ wantlogininfo => '
0,Login Info R
eq,yesno',
wantgrid => '0,Show DX Grid,yesno',
wantann_talk => '0,Talklike Anns,yesno',
wantpc90 => '1,Req PC90,yesno',
wantgrid => '0,Show DX Grid,yesno',
wantann_talk => '0,Talklike Anns,yesno',
wantpc90 => '1,Req PC90,yesno',
@@
-212,17
+212,23
@@
sub finish
# new - create a new user
#
# new - create a new user
#
-sub
new
+sub
alloc
{
my $pkg = shift;
my $call = uc shift;
{
my $pkg = shift;
my $call = uc shift;
+ my $self = bless {call => $call, 'sort'=>'U'}, $pkg;
+ return $self;
+}
+
+sub new
+{
+ my $pkg = shift;
+ my $call = shift;
# $call =~ s/-\d+$//o;
# confess "can't create existing call $call in User\n!" if $u{$call};
# $call =~ s/-\d+$//o;
# confess "can't create existing call $call in User\n!" if $u{$call};
- my $self = bless {}, $pkg;
- $self->{call} = $call;
- $self->{'sort'} = 'U';
+ my $self = $pkg->alloc($call);
$self->put;
return $self;
}
$self->put;
return $self;
}
@@
-264,7
+270,7
@@
sub get_current
my $pkg = shift;
my $call = uc shift;
my $pkg = shift;
my $call = uc shift;
- my $dxchan = DXChannel
->
get($call);
+ my $dxchan = DXChannel
::
get($call);
return $dxchan->user if $dxchan;
my $rref = Route::get($call);
return $rref->user if $rref && exists $rref->{user};
return $dxchan->user if $dxchan;
my $rref = Route::get($call);
return $rref->user if $rref && exists $rref->{user};
@@
-482,16
+488,20
@@
print "There are $count user records and $err errors\n";
for ($action = R_FIRST; !$dbm->seq($key, $val, $action); $action = R_NEXT) {
if (!is_callsign($key) || $key =~ /^0/) {
for ($action = R_FIRST; !$dbm->seq($key, $val, $action); $action = R_NEXT) {
if (!is_callsign($key) || $key =~ /^0/) {
- Log('DXCommand', "Export Error1: $key\t$val");
+ my $eval = $val;
+ my $ekey = $key;
+ $eval =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg;
+ $ekey =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg;
+ Log('DXCommand', "Export Error1: $ekey\t$eval");
eval {$dbm->del($key)};
eval {$dbm->del($key)};
- dbg(carp("Export Error1: $
key\t$
val\n$@")) if $@;
+ dbg(carp("Export Error1: $
ekey\t$e
val\n$@")) if $@;
++$err;
next;
}
my $ref = decode($val);
if ($ref) {
my $t = $ref->{lastin} || 0;
++$err;
next;
}
my $ref = decode($val);
if ($ref) {
my $t = $ref->{lastin} || 0;
- if ($main::systime > $t + $tooold) {
+ if ($
ref->{sort} eq 'U' && !$ref->{priv} && $
main::systime > $t + $tooold) {
unless ($ref->{lat} && $ref->{long} || $ref->{qth} || $ref->{qra}) {
eval {$dbm->del($key)};
dbg(carp("Export Error2: $key\t$val\n$@")) if $@;
unless ($ref->{lat} && $ref->{long} || $ref->{qth} || $ref->{qra}) {
eval {$dbm->del($key)};
dbg(carp("Export Error2: $key\t$val\n$@")) if $@;