diff options
author | ivan <ivan> | 2008-04-15 13:42:40 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-04-15 13:42:40 +0000 |
commit | 477015901c379f8cd6ba46cfaa4a9ae284ae582d (patch) | |
tree | f4307128f80570f1f9f38250fb1769e942ec4b99 /FS/FS/svc_domain.pm | |
parent | 22a294936609cfcb452742a158fafaa55d3a6fd1 (diff) |
new package editor
Diffstat (limited to 'FS/FS/svc_domain.pm')
-rw-r--r-- | FS/FS/svc_domain.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index 758b399b..47aa8f3 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -6,6 +6,7 @@ use vars qw( @ISA $whois_hack $conf $soarefresh $soaretry ); use Carp; +use Scalar::Util qw( blessed ); use Date::Format; #use Net::Whois::Raw; use Net::Domain::TLD qw(tld_exists); @@ -289,10 +290,11 @@ returns the error, otherwise returns false. =cut sub replace { - my ( $new, $old ) = ( shift, shift ); + my $new = shift; - # We absolutely have to have an old vs. new record to make this work. - $old = $new->replace_old unless defined($old); + my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') ) + ? shift + : $new->replace_old; return "Can't change domain - reorder." if $old->getfield('domain') ne $new->getfield('domain'); |