[freeside-commits] branch master updated. bc54a75d31ea0e70e5854e4ddb9122d8feecdd74

Ivan ivan at 420.am
Tue Nov 19 21:56:07 PST 2013


The branch, master has been updated
       via  bc54a75d31ea0e70e5854e4ddb9122d8feecdd74 (commit)
      from  4247bd18a51ef34403d648af6281101f25fc9a62 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bc54a75d31ea0e70e5854e4ddb9122d8feecdd74
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Nov 19 21:56:06 2013 -0800

    prohibit self-service changing of suspended packages, RT#26140

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 2aeecc1..241963f 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -2303,6 +2303,11 @@ sub change_pkg {
   my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $p->{pkgnum} } )
     or return { 'error' => "unknown package $p->{pkgnum}" };
 
+  #if someone does need self-service package change of suspended packages,
+  # figure out how to be more discriminating
+  return { error=>"Can't change a suspended package", pkgnum=>$cust_pkg->pkgnum}
+    if $cust_pkg->status eq 'suspended';
+
   my @newpkg;
   my $error = FS::cust_pkg::order( $custnum,
                                    [$p->{pkgpart}],
diff --git a/fs_selfservice/FS-SelfService/cgi/provision_list.html b/fs_selfservice/FS-SelfService/cgi/provision_list.html
index 2a3a8e9..24d6ff4 100644
--- a/fs_selfservice/FS-SelfService/cgi/provision_list.html
+++ b/fs_selfservice/FS-SelfService/cgi/provision_list.html
@@ -9,10 +9,14 @@ foreach my $pkg (
            || scalar(@{$_->{cust_svc}})
          } @cust_pkg
     ) {
+
   my $susp = $pkg->{'susp'} || '';
-  my @pkg_actions = ( [ 'customer_change_pkg' => 'change' ] );
-  push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] 
-    if $self_suspend_reason and !$susp;
+  my @pkg_actions = ();
+  if ( ! $susp ) {
+    push @pkg_actions, [ 'customer_change_pkg' => 'change' ];
+    push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] 
+      if $self_suspend_reason;
+  }
 
   my $bgcolor = $susp ? '"#ff9900"' : '"#8888ff"';
   $OUT .= #'<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#ffffff">'.

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm                       |    5 +++++
 .../FS-SelfService/cgi/provision_list.html         |   10 +++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list