[freeside-commits] freeside/FS/FS Upgrade.pm,1.1.2.18,1.1.2.19
Ivan,,,
ivan at wavetail.420.am
Mon Oct 6 17:09:08 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv372
Modified Files:
Tag: FREESIDE_1_7_BRANCH
Upgrade.pm
Log Message:
when setting last_login/last_logout, ensure only accounts actually attached to the export are updated
Index: Upgrade.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Upgrade.pm,v
retrieving revision 1.1.2.18
retrieving revision 1.1.2.19
diff -u -d -r1.1.2.18 -r1.1.2.19
--- Upgrade.pm 9 Sep 2008 21:04:39 -0000 1.1.2.18
+++ Upgrade.pm 7 Oct 2008 00:09:05 -0000 1.1.2.19
@@ -186,17 +186,24 @@
my ($username, $realm, $start, $stop) = @$row;
$username = lc($username) unless $conf->exists('username-uppercase');
- my $extra_sql = '';
+
+ my $exportnum = $part_export->exportnum;
+ my $extra_sql = " AND exportnum = $exportnum ".
+ " AND exportsvcnum IS NOT NULL ";
+
if ( ref($part_export) =~ /withdomain/ ) {
- $extra_sql = " And '$realm' = ( SELECT domain FROM svc_domain
+ $extra_sql = " AND '$realm' = ( SELECT domain FROM svc_domain
WHERE svc_domain.svcnum = svc_acct.domsvc ) ";
}
- my $svc_acct = qsearchs( 'svc_acct',
- { 'username' => $username },
- '',
- $extra_sql,
- );
+ my $svc_acct = qsearchs({
+ 'table' => 'svc_acct.*',
+ 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum )'.
+ 'LEFT JOIN export_svc USING ( svcpart )',
+ 'hashref' => { 'username' => $username },
+ 'extra_sql' => $extra_sql,
+ });
+
if ($svc_acct) {
$svc_acct->last_login($start)
if $start && (!$svc_acct->last_login || $start > $svc_acct->last_login);
More information about the freeside-commits
mailing list