diff options
author | ivan <ivan> | 2009-10-28 19:04:53 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-10-28 19:04:53 +0000 |
commit | f274814c7cde3681578ca594a2b00475370e4c92 (patch) | |
tree | 2981a7fca22e5e0fb3c05693445cac232fe90a83 /FS/FS/svc_domain.pm | |
parent | 2cb70470a8e5c3287146008e4ce2c4eb9f242373 (diff) |
fix problems using inventory for UID (and other fields controlled by check in svc_acct and also svc_www, svc_domain and svc_forward), RT#6366
Diffstat (limited to 'FS/FS/svc_domain.pm')
-rw-r--r-- | FS/FS/svc_domain.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index 3311ac5..8ca30c2 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -181,13 +181,6 @@ sub insert { 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; @@ -392,6 +385,18 @@ sub check { } +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 |