diff options
author | ivan <ivan> | 2005-10-03 01:42:22 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-10-03 01:42:22 +0000 |
commit | a5bbbed61e09dffffc5d7022cddb3f9ff62a955a (patch) | |
tree | f0e0a5d47a996f624da9d602e7022b0acd45d4ec /FS | |
parent | 90cdac3ff61ad57b42d2fc4743ad53f7c537e6fe (diff) |
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
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 17 | ||||
-rw-r--r-- | FS/FS/cust_svc.pm | 6 | ||||
-rw-r--r-- | FS/FS/part_svc.pm | 16 | ||||
-rw-r--r-- | FS/FS/svc_acct.pm | 9 |
4 files changed, 40 insertions, 8 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 37d649bf9..237ab1e58 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -668,7 +668,7 @@ httemplate/docs/config.html { 'key' => 'invoice_send_receipts', - 'section' => 'deprecated',q + 'section' => 'deprecated', 'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits. See the payment_receipt_email and XXXX instead.', 'type' => 'checkbox', }, @@ -1569,6 +1569,21 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'svc_acct-edit_uid', + 'section' => 'shell', + 'description' => 'Allow UID editing.', + 'type' => 'checkbox', + }, + + { + 'key' => 'svc_acct-edit_gid', + 'section' => 'shell', + 'description' => 'Allow GID editing.', + 'type' => 'checkbox', + }, + + ); 1; diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 2e349f6bd..e69befca2 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -384,10 +384,8 @@ sub seconds_since_sqlradacct { 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; diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 2bb8ab59e..0ece185f7 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -393,8 +393,8 @@ sub all_part_svc_column { =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 @@ sub part_export { 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. diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 4a618108f..167fcee88 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -467,7 +467,14 @@ sub replace { { #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 |