X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcontact.pm;h=8a381a509d6655195dc4e6b1e703061bbaf12f54;hb=f633e15977df07607b8b91782237f919328e6cc9;hp=4012109a77f295916f4934c1f6b5c7b3a63f50ac;hpb=9967e37ce23ef112fddc2606390ba5a89a51adaa;p=freeside.git diff --git a/FS/FS/contact.pm b/FS/FS/contact.pm index 4012109a7..8a381a509 100644 --- a/FS/FS/contact.pm +++ b/FS/FS/contact.pm @@ -370,6 +370,15 @@ sub replace { } } + 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; ''; @@ -456,7 +465,7 @@ and replace methods. sub check { my $self = shift; - if ( $self->selfservice_access eq 'R' ) { + if ( $self->selfservice_access eq 'R' || $self->selfservice_access eq 'E' || $self->selfservice_access eq 'P' ) { $self->selfservice_access('Y'); $self->_resend('Y'); } @@ -675,7 +684,10 @@ sub send_reset_email { 'svcnum' => $opt{'svcnum'}, }; - my $timeout = '24 hours'; #? + + my $conf = new FS::Conf; + my $timeout = + ($conf->config('selfservice-password_reset_hours') || 24 ). ' hours'; my $reset_session_id; do { @@ -687,8 +699,6 @@ sub send_reset_email { #email it - my $conf = new FS::Conf; - my $cust_main = $self->cust_main or die "no customer"; #reset a password for a prospect contact? someday @@ -741,6 +751,7 @@ sub cgi_contact_fields { my @contact_fields = qw( classnum first last title comment emailaddress selfservice_access + invoice_dest password ); push @contact_fields, 'phonetypenum'. $_->phonetypenum