X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcontact.pm;h=d6869abc83151930d4cf5f01cc3b2710b712efce;hb=368ed08e24400e9d1faf401a1e4e23ea54d2c969;hp=fa047f59d7433d040075e01872f63759261a8ccc;hpb=e517b3733dd3d19a7af586c9f4b8cf9982a8b3d2;p=freeside.git diff --git a/FS/FS/contact.pm b/FS/FS/contact.pm index fa047f59d..d6869abc8 100644 --- a/FS/FS/contact.pm +++ b/FS/FS/contact.pm @@ -199,8 +199,6 @@ sub insert { } - $error ||= $self->insert_password_history; - if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -302,6 +300,15 @@ sub insert { } } + if ( $self->get('password') ) { + my $error = $self->is_password_allowed($self->get('password')) + || $self->change_password($self->get('password')); + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; ''; @@ -427,11 +434,12 @@ sub replace { my $prospectnum = $self->prospectnum; $self->prospectnum(''); my $custnum = $self->custnum; - $self->custnum(''); + $self->custnum(''); $old->custnum(''); # remove because now stored cust_contact my %link_hash = (); for (qw( classnum comment selfservice_access invoice_dest message_dest )) { $link_hash{$_} = $self->get($_); + $old->$_(''); ##remove values from old record, causes problem with history $self->$_(''); } @@ -811,7 +819,7 @@ sub authenticate_password { $hash eq $check_hash; - } else { + } else { return 0 if $self->_password eq '';