summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2003-11-04 17:30:15 +0000
committerivan <ivan>2003-11-04 17:30:15 +0000
commit8e70e767b1fc7384d11d38246868d17ea0ec560e (patch)
treec803dc1109df3b548c06c9b88690f624f1b775d7
parent3f0c721ee27ead3504df80addd947057e4fc4c14 (diff)
make snarf info available to exports
-rw-r--r--FS/FS/part_export/shellcommands.pm7
-rw-r--r--FS/FS/svc_acct.pm18
2 files changed, 24 insertions, 1 deletions
diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm
index da24e5ca7..f65638984 100644
--- a/FS/FS/part_export/shellcommands.pm
+++ b/FS/FS/part_export/shellcommands.pm
@@ -40,6 +40,13 @@ sub _export_command {
{
no strict 'refs';
${$_} = $svc_acct->getfield($_) foreach $svc_acct->fields;
+
+ my $count = 1;
+ foreach my $acct_snarf ( $svc_acct->acct_snarf ) {
+ ${"snarf_$_$count"} = shell_quote( $acct_snarf->get($_) )
+ foreach qw( machine username _password );
+ $count++;
+ }
}
my $cust_pkg = $svc_acct->cust_svc->cust_pkg;
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 4ea7734d4..e4acf7459 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -16,7 +16,7 @@ use Carp;
use Fcntl qw(:flock);
use FS::UID qw( datasrc );
use FS::Conf;
-use FS::Record qw( qsearch qsearchs fields dbh );
+use FS::Record qw( qsearch qsearchs fields dbh dbdef );
use FS::svc_Common;
use FS::cust_svc;
use FS::part_svc;
@@ -951,6 +951,22 @@ sub email {
$self->username. '@'. $self->domain;
}
+=item acct_snarf
+
+Returns an array of FS::acct_snarf records associated with the account.
+If the acct_snarf table does not exist or there are no associated records,
+an empty list is returned
+
+=cut
+
+sub acct_snarf {
+ my $self = shift;
+ return () unless dbdef->table('acct_snarf');
+ eval "use FS::acct_snarf;";
+ die $@ if $@;
+ qsearch('acct_snarf', { 'svcnum' => $self->svcnum } );
+}
+
=item seconds_since TIMESTAMP
Returns the number of seconds this account has been online since TIMESTAMP,