use FS::cust_location;
use FS::contact_phone;
use FS::contact_email;
+use FS::contact::Import;
use FS::queue;
use FS::cust_pkg;
use FS::phone_type; #for cgi_contact_fields
}
}
- my $error = $self->SUPER::delete;
+ my $error = $self->delete_password_history
+ || $self->SUPER::delete;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
}
}
+ 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;
'';
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');
}
'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 {
#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
my @contact_fields = qw(
classnum first last title comment emailaddress selfservice_access
+ invoice_dest password
);
push @contact_fields, 'phonetypenum'. $_->phonetypenum