[freeside-commits] freeside/FS/FS access_user.pm,1.25,1.25.2.1
Ivan,,,
ivan at wavetail.420.am
Sun Mar 28 17:50:30 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv16991
Modified Files:
Tag: FREESIDE_1_9_BRANCH
access_user.pm
Log Message:
add user_custnum to 1.9 for employee commissioning, RT#6991
Index: access_user.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/access_user.pm,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -w -d -r1.25 -r1.25.2.1
--- access_user.pm 22 Jun 2009 10:39:48 -0000 1.25
+++ access_user.pm 29 Mar 2010 00:50:28 -0000 1.25.2.1
@@ -10,6 +10,7 @@
use FS::access_user_pref;
use FS::access_usergroup;
use FS::agent;
+use FS::cust_main;
@ISA = qw( FS::m2m_Common FS::option_Common FS::Record );
#@ISA = qw( FS::m2m_Common FS::option_Common );
@@ -220,6 +221,9 @@
$dbh->rollback or die $dbh->errstr if $oldAutoCommit;
return $error;
}
+ } elsif ( $old->disabled && !$new->disabled
+ && $new->_password =~ /changeme/i ) {
+ return "Must change password when enabling this account";
}
my $error = $new->SUPER::replace($old, @_);
@@ -254,6 +258,7 @@
|| $self->ut_text('_password')
|| $self->ut_text('last')
|| $self->ut_text('first')
+ || $self->ut_foreign_keyn('user_custnum', 'cust_main', 'custnum')
|| $self->ut_enum('disabled', [ '', 'Y' ] )
;
return $error if $error;
@@ -272,6 +277,18 @@
$self->get('last'). ', '. $self->first;
}
+=item user_cust_main
+
+Returns the FS::cust_main object (see L<FS::cust_main>), if any, for this
+user.
+
+=cut
+
+sub user_cust_main {
+ my $self = shift;
+ qsearchs( 'cust_main', { 'custnum' => $self->user_custnum } );
+}
+
=item access_usergroup
Returns links to the the groups this user is a part of, as FS::access_usergroup
More information about the freeside-commits
mailing list