=item expiration_date - UNIX timestamp
+=item max_accounts
+
=back
=head1 METHODS
'cancel_weight' => 60,
'fields' => {
'domain' => 'Domain',
+ 'max_accounts' => { label => 'Maximum number of accounts',
+ 'disable_inventory' => 1,
+ },
+ 'cgp_aliases' => {
+ label => 'Communigate aliases',
+ type => 'text',
+ disable_inventory => 1,
+ disable_select => 1,
+ },
+ 'cgp_accessmodes' => {
+ label => 'Communigate enabled services',
+ type => 'communigate_pro-accessmodes',
+ disable_inventory => 1,
+ disable_select => 1,
+ },
},
};
}
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- $error = $self->check;
- return $error if $error;
-
- return "Domain in use (here)"
- if qsearchs( 'svc_domain', { 'domain' => $self->domain } );
-
-
$error = $self->SUPER::insert(@_);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
: $new->replace_old;
return "Can't change domain - reorder."
- if $old->getfield('domain') ne $new->getfield('domain');
+ if $old->getfield('domain') ne $new->getfield('domain')
+ && ! $conf->exists('svc_domain-edit_domain');
# Better to do it here than to force the caller to remember that svc_domain is weird.
$new->setfield(action => 'I');
my $error = $self->ut_numbern('svcnum')
|| $self->ut_numbern('catchall')
+ || $self->ut_numbern('max_accounts')
+ || $self->ut_textn('cgp_aliases') #well
;
return $error if $error;
}
+sub _check_duplicate {
+ my $self = shift;
+
+ $self->lock_table;
+
+ if ( qsearchs( 'svc_domain', { 'domain' => $self->domain } ) ) {
+ return "Domain in use (here)";
+ } else {
+ return '';
+ }
+}
+
=item domain_record
=cut
'PTR' => sub { $_[0]->reczone <=> $_[1]->reczone },
);
+ map { $_ } #return $self->num_domain_record( PARAMS ) unless wantarray;
sort { $order{$a->rectype} <=> $order{$b->rectype}
or &{ $sort{$a->rectype} || sub { 0; } }($a, $b)
}