diff options
author | Mark Wells <mark@freeside.biz> | 2015-11-12 16:49:39 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-11-13 13:00:42 -0500 |
commit | d3f33fa4dbabb61cd94dac9f4f63cd8f249313da (patch) | |
tree | f9559ddf824ab90fcc68e1854e1219caeef5e907 /FS/FS/svc_acct.pm | |
parent | 75a3ac488dc908290e75edd09471e01dba2199cb (diff) |
limit password reuse, core and svc_acct, #29354
Diffstat (limited to 'FS/FS/svc_acct.pm')
-rw-r--r-- | FS/FS/svc_acct.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index f307033..d3e23f2 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -4,6 +4,7 @@ use base qw( FS::svc_Domain_Mixin FS::svc_PBX_Mixin FS::svc_Radius_Mixin FS::svc_Tower_Mixin FS::svc_IP_Mixin + FS::Password_Mixin FS::svc_Common ); @@ -684,6 +685,9 @@ sub insert { 'child_objects' => $self->child_objects, %options, ); + + $error ||= $self->insert_password_history; + if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -893,6 +897,12 @@ sub replace { my $dbh = dbh; $error = $new->SUPER::replace($old, @_); # usergroup here + + # don't need to record this unless the password was changed + if ( $old->_password ne $new->_password ) { + $error ||= $new->insert_password_history; + } + if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error if $error; |