projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix dx.pl Spot::dup typo
[spider.git]
/
perl
/
DXUser.pm
diff --git
a/perl/DXUser.pm
b/perl/DXUser.pm
index 8890fae9185b4d990bf9f0d6737304d22b6088a6..4af135e7e795aefe0a7a39bc2f8a189828d442df 100644
(file)
--- a/
perl/DXUser.pm
+++ b/
perl/DXUser.pm
@@
-31,7
+31,7
@@
$dbm = undef;
$filename = undef;
$lastoperinterval = 60*24*60*60;
$lasttime = 0;
$filename = undef;
$lastoperinterval = 60*24*60*60;
$lasttime = 0;
-$lrusize =
10
000;
+$lrusize =
5
000;
$tooold = 86400 * 365; # this marks an old user who hasn't given enough info to be useful
$v3 = 0;
our $maxconnlist = 3; # remember this many connection time (duration) [start, end] pairs
$tooold = 86400 * 365; # this marks an old user who hasn't given enough info to be useful
$v3 = 0;
our $maxconnlist = 3; # remember this many connection time (duration) [start, end] pairs
@@
-108,6
+108,7
@@
my $json;
startt => '0,Start Time,cldatetime',
connlist => '1,Connections,parraydifft',
width => '0,Preferred Width',
startt => '0,Start Time,cldatetime',
connlist => '1,Connections,parraydifft',
width => '0,Preferred Width',
+ rbnseeme => '0,RBN See Me',
);
#no strict;
);
#no strict;
@@
-135,17
+136,19
@@
sub init
{
my $mode = shift;
{
my $mode = shift;
- $json = DXJSON->new->canonical(1);
+
$json = DXJSON->new->canonical(1);
my $fn = "users";
$filename = localdata("$fn.v3j");
my $fn = "users";
$filename = localdata("$fn.v3j");
- unless (-e $filename || $mode == 2) {
- LogDbg('DXUser', "New User File version $filename does not exist, running conversion from users.v3 or v2, please wait");
- system('/spider/perl/convert-users-v3-to-v3j.pl');
- init(1);
- export();
- return;
+ unless (-e $filename || $mode == 2 ) {
+ if (-e localdata("$fn.v3") || -e localdata("$fn.v2")) {
+ LogDbg('DXUser', "New User File version $filename does not exist, running conversion from users.v3 or v2, please wait");
+ system('/spider/perl/convert-users-v3-to-v3j.pl');
+ init(1);
+ export();
+ return;
+ }
}
}
- if (-e $filename || $mode
== 2
) {
+ if (-e $filename || $mode) {
$lru = LRU->newbase("DXUser", $lrusize);
if ($mode) {
$dbm = tie (%u, 'DB_File', $filename, O_CREAT|O_RDWR, 0666, $DB_BTREE) or confess "can't open user file: $fn ($!) [rebuild it from user_json?]";
$lru = LRU->newbase("DXUser", $lrusize);
if ($mode) {
$dbm = tie (%u, 'DB_File', $filename, O_CREAT|O_RDWR, 0666, $DB_BTREE) or confess "can't open user file: $fn ($!) [rebuild it from user_json?]";
@@
-833,6
+836,16
@@
sub lastping
$b->{$call} = shift if @_;
return $b->{$call};
}
$b->{$call} = shift if @_;
return $b->{$call};
}
+
+sub registered
+{
+ my $self = shift;
+ if (exists $self->{registered}) {
+ return $self->{registered} || 0;
+ }
+ return ''; # to stop undef warnings
+}
+
1;
__END__
1;
__END__