X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=a6474abe51db668752c5832d7150dc97e6958cbc;hb=81e9887d5b7cee45d2b810ab0f8f19d21f048eab;hp=97aca375c325bccac68ac9fb609c46a4fc86ca19;hpb=6aca4e461103870de99b0ce452f21cf7fedeb54b;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 97aca375..a6474abe 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -11,6 +11,7 @@ package DXUser; require Exporter; @ISA = qw(Exporter); +use DXLog; use DB_File; use Fcntl; use Carp; @@ -49,6 +50,12 @@ $filename = undef; hmsgno => '0,Highest Msgno', group => '0,Access Group,parray', # used to create a group of users/nodes for some purpose or other isolate => '9,Isolate network,yesno', + wantbeep => '0,Rec Beep,yesno', + wantann => '0,Rec Announce,yesno', + wantwwv => '0,Rec WWV,yesno', + wanttalk => '0,Rec Talk,yesno', + wantwx => '0,Rec WX,yesno', + wantdx => '0,Rec DX Spots,yesno', ); no strict; @@ -63,7 +70,6 @@ sub AUTOLOAD confess "Non-existant field '$AUTOLOAD'" if !$valid{$name}; if (@_) { $self->{$name} = shift; - # $self->put(); } return $self->{$name}; } @@ -94,6 +100,7 @@ use strict; sub finish { + undef $dbm; untie %u; } @@ -211,7 +218,8 @@ sub decode my $ref; $s = '$ref = ' . $s; eval $s; - confess $@ if $@; + Log('DXUser', $@) if $@; + $ref = undef if $@; return $ref; } @@ -323,5 +331,41 @@ sub sort my $self = shift; @_ ? $self->{'sort'} = shift : $self->{'sort'} ; } + +# some accessors +sub _want +{ + my $n = shift; + my $self = shift; + my $s = "want$n"; + return $self->{$n} = shift if @_; + return defined $self->{$n} ? $self->{$n} : 1; +} + +sub wantbeep +{ + return _want('beep', @_); +} + +sub wantann +{ + return _want('ann', @_); +} + +sub wantwwv +{ + return _want('wwv', @_); +} + +sub wantwx +{ + return _want('wx', @_); +} + +sub wantdx +{ + return _want('dx', @_); +} + 1; __END__