[freeside-commits] freeside/FS/FS part_svc.pm, 1.21, 1.22 cust_svc.pm, 1.57, 1.58 svc_acct.pm, 1.185, 1.186

Ivan,,, ivan at wavetail.420.am
Sun Oct 2 18:41:46 PDT 2005


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv22822/FS/FS

Modified Files:
	part_svc.pm cust_svc.pm svc_acct.pm 
Log Message:
update account view and edit: convert to proper templates, make sure usage information displays for any usage-capable export, add ability to edit uid/gid

Index: part_svc.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_svc.pm,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- part_svc.pm	7 Sep 2005 10:40:58 -0000	1.21
+++ part_svc.pm	3 Oct 2005 01:41:44 -0000	1.22
@@ -393,8 +393,8 @@
 
 =item part_export [ EXPORTTYPE ]
 
-Returns all exports (see L<FS::part_export>) for this service, or, if an
-export type is specified, only returns exports of the given type.
+Returns a list of all exports (see L<FS::part_export>) for this service, or,
+if an export type is specified, only returns exports of the given type.
 
 =cut
 
@@ -406,6 +406,18 @@
     qsearch('export_svc', { 'svcpart' => $self->svcpart } );
 }
 
+=item part_export_usage
+
+Returns a list of any exports (see L<FS::part_export>) for this service that
+are capable of reporting usage information.
+
+=cut
+
+sub part_export_usage {
+  my $self = shift;
+  grep $_->can('usage_sessions'), $self->part_export;
+}
+
 =item cust_svc
 
 Returns a list of associated FS::cust_svc records.

Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- svc_acct.pm	29 Sep 2005 20:19:56 -0000	1.185
+++ svc_acct.pm	3 Oct 2005 01:41:44 -0000	1.186
@@ -467,7 +467,14 @@
   {
     #no warnings 'numeric';  #alas, a 5.006-ism
     local($^W) = 0;
-    return "Can't change uid!" if $old->uid != $new->uid;
+
+    foreach my $xid (qw( uid gid )) {
+
+      return "Can't change $xid!"
+        if ! $conf->exists("svc_acct-edit_$xid")
+           && $old->$xid() != $new->$xid();
+    }
+
   }
 
   #change homdir when we change username

Index: cust_svc.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_svc.pm,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- cust_svc.pm	7 Aug 2005 00:40:02 -0000	1.57
+++ cust_svc.pm	3 Oct 2005 01:41:44 -0000	1.58
@@ -384,10 +384,8 @@
 
   my $svc_x = $self->svc_x;
 
-  my @part_export = $self->part_svc->part_export('sqlradius');
-  push @part_export, $self->part_svc->part_export('sqlradius_withdomain');
-  die "no sqlradius or sqlradius_withdomain export configured for this".
-      "service type"
+  my @part_export = $self->part_svc->part_export_usage;
+  die "no usage-capable export configured for this service type"
     unless @part_export;
     #or return undef;
 



More information about the freeside-commits mailing list