projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
limit password reuse, core and svc_acct, #29354
[freeside.git]
/
FS
/
FS
/
svc_acct.pm
diff --git
a/FS/FS/svc_acct.pm
b/FS/FS/svc_acct.pm
index
ffcadc9
..
a8cb7ba
100644
(file)
--- a/
FS/FS/svc_acct.pm
+++ b/
FS/FS/svc_acct.pm
@@
-7,7
+7,11
@@
use base qw( FS::svc_Domain_Mixin
FS::svc_Radius_Mixin
FS::svc_Tower_Mixin
FS::svc_IP_Mixin
FS::svc_Radius_Mixin
FS::svc_Tower_Mixin
FS::svc_IP_Mixin
- FS::svc_Common );
+ FS::Password_Mixin
+ FS::svc_Common
+ );
+
+use strict;
use vars qw( $DEBUG $me $conf $skip_fuzzyfiles
$dir_prefix @shells $usernamemin
$usernamemax $passwordmin $passwordmax
use vars qw( $DEBUG $me $conf $skip_fuzzyfiles
$dir_prefix @shells $usernamemin
$usernamemax $passwordmin $passwordmax
@@
-261,6
+265,7
@@
sub table_info {
'display_weight' => 10,
'cancel_weight' => 50,
'ip_field' => 'slipip',
'display_weight' => 10,
'cancel_weight' => 50,
'ip_field' => 'slipip',
+ 'manual_require' => 1,
'fields' => {
'dir' => 'Home directory',
'uid' => {
'fields' => {
'dir' => 'Home directory',
'uid' => {
@@
-700,6
+705,9
@@
sub insert {
'child_objects' => $self->child_objects,
%options,
);
'child_objects' => $self->child_objects,
%options,
);
+
+ $error ||= $self->insert_password_history;
+
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
@@
-984,6
+992,12
@@
sub replace {
my $dbh = dbh;
$error = $new->SUPER::replace($old, @_); # usergroup here
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;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error if $error;