1 package FS::acct_snarf;
7 @ISA = qw( FS::Record );
11 FS::acct_snarf - Object methods for acct_snarf records
17 $record = new FS::acct_snarf \%hash;
18 $record = new FS::acct_snarf { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::svc_acct object represents an external mail account, typically for
31 download of mail. FS::acct_snarf inherits from FS::Record. The following
32 fields are currently supported:
36 =item snarfnum - primary key
38 =item svcnum - Account (see L<FS::svc_acct>)
40 =item machine - external machine to download mail from
42 =item protocol - protocol (pop3, imap, etc.)
44 =item username - external login username
46 =item _password - external login password
56 Creates a new record. To add the record to the database, see L<"insert">.
58 Note that this stores the hash reference, not a distinct copy of the hash it
59 points to. You can ask the object for a copy with the I<hash> method.
63 sub table { 'acct_snarf'; }
67 Adds this record to the database. If there is an error, returns the error,
68 otherwise returns false.
72 # the insert method can be inherited from FS::Record
76 Delete this record from the database.
80 # the delete method can be inherited from FS::Record
82 =item replace OLD_RECORD
84 Replaces the OLD_RECORD with this one in the database. If there is an error,
85 returns the error, otherwise returns false.
89 # the replace method can be inherited from FS::Record
93 Checks all fields to make sure this is a valid external mail account. If
94 there is an error, returns the error, otherwise returns false. Called by the
95 insert and replace methods.
102 $self->ut_numbern('snarfnum')
103 || $self->ut_number('svcnum')
104 || $self->ut_foreign_key('svcnum', 'svc_acct', 'svcnum')
105 || $self->ut_domain('machine')
106 || $self->ut_alphan('protocol')
107 || $self->ut_textn('username')
109 return $error if $error;
111 $self->_password =~ /^[^\t\n]*$/ or return "illegal password";
112 $self->_password($1);
123 L<FS::Record>, schema.html from the base documentation.