use Fcntl qw(:flock);
use Date::Format;
use Crypt::PasswdMD5 1.2;
+use Data::Dumper;
use FS::UID qw( datasrc );
use FS::Conf;
use FS::Record qw( qsearch qsearchs fields dbh dbdef );
sub table { 'svc_acct'; }
+sub _fieldhandlers {
+ #false laziness with edit/svc_acct.cgi
+ 'usergroup' => sub {
+ my $usergroup = shift;
+ if ( ref($usergroup) eq 'ARRAY' ) {
+ $usergroup;
+ } elsif ( length($usergroup) ) {
+ [ split(/\s*,\s*/, $usergroup) ];
+ } else {
+ [];
+ }
+ },
+}
+
=item insert [ , OPTION => VALUE ... ]
Adds this account to the database. If there is an error, returns the error,
sub insert {
my $self = shift;
my %options = @_;
- my $error;
+
+ if ( $DEBUG ) {
+ warn "[$me] insert called on $self: ". Dumper($self).
+ "\nwith options: ". Dumper(%options);
+ }
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- $error = $self->check;
+ my $error = $self->check;
return $error if $error;
if ( $self->svcnum && qsearchs('cust_svc',{'svcnum'=>$self->svcnum}) ) {