From: Ivan Kohler Date: Wed, 20 Nov 2013 05:56:07 +0000 (-0800) Subject: prohibit self-service changing of suspended packages, RT#26140 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=d0166fb1f52865916575ac6aa0eb043d792fe18b prohibit self-service changing of suspended packages, RT#26140 --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index c5a831652..db9ae5a38 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -2316,6 +2316,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 2a3a8e909..24d6ff436 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 .= #''.