X-Git-Url: http://scm.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=554a9930cdfc35ee6174c18a9893774fdd827cd7;hb=6b19958cbe351af8d5462f4e0e03b87875eec16a;hp=a9c7ea030177eb75948a2c5954e9242ab121487e;hpb=ca18864d1264fadfe9869b630f05c950876c2169;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index a9c7ea03..554a9930 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -49,6 +49,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 +69,6 @@ sub AUTOLOAD confess "Non-existant field '$AUTOLOAD'" if !$valid{$name}; if (@_) { $self->{$name} = shift; - # $self->put(); } return $self->{$name}; } @@ -211,8 +216,9 @@ sub decode my $s = shift; my $ref; $s = '$ref = ' . $s; - eval $s; - confess $@ if $@; + eval { $s; }; + Log('DXUser', $@) if $@; + $ref = undef if $@; return $ref; } @@ -324,5 +330,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__