[freeside-commits] freeside/FS/FS svc_acct.pm, 1.217.2.28, 1.217.2.29

Ivan,,, ivan at wavetail.420.am
Tue Aug 4 16:49:35 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv308/FS

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	svc_acct.pm 
Log Message:
hopefully ignore errors about deleted accounts and properly finish freeside-sqlradius-reset, RT#5868

Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.217.2.28
retrieving revision 1.217.2.29
diff -u -d -r1.217.2.28 -r1.217.2.29
--- svc_acct.pm	24 Jul 2009 09:38:22 -0000	1.217.2.28
+++ svc_acct.pm	4 Aug 2009 23:49:33 -0000	1.217.2.29
@@ -1448,11 +1448,15 @@
   my $pw_attrib = length($password) <= 12 ? $radius_password : 'Crypt-Password';  $check{$pw_attrib} = $password;
 
   my $cust_svc = $self->cust_svc;
-  die "FATAL: no cust_svc record for svc_acct.svcnum ". $self->svcnum. "\n"
-    unless $cust_svc;
-  my $cust_pkg = $cust_svc->cust_pkg;
-  if ( $cust_pkg && $cust_pkg->part_pkg->is_prepaid && $cust_pkg->bill ) {
-    $check{'Expiration'} = time2str('%B %e %Y %T', $cust_pkg->bill ); #http://lists.cistron.nl/pipermail/freeradius-users/2005-January/040184.html
+  if ( $cust_svc ) {
+    my $cust_pkg = $cust_svc->cust_pkg;
+    if ( $cust_pkg && $cust_pkg->part_pkg->is_prepaid && $cust_pkg->bill ) {
+      $check{'Expiration'} = time2str('%B %e %Y %T', $cust_pkg->bill ); #http://lists.cistron.nl/pipermail/freeradius-users/2005-January/040184.html
+    }
+  } else {
+    warn "WARNING: no cust_svc record for svc_acct.svcnum ". $self->svcnum.
+         "; can't set Expiration\n"
+      unless $cust_svc;
   }
 
   %check;



More information about the freeside-commits mailing list