From 683047c1123ad9c4bac52039fa669deb6198aa75 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Mon, 30 Sep 2013 11:38:58 +0200 Subject: [PATCH] MT#3975 Prevent subadmin from terminating himself. --- lib/NGCP/Panel/Controller/Subscriber.pm | 5 ----- share/templates/customer/details.tt | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index 9dba57ab66..6e72fdb4e8 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -55,7 +55,6 @@ Catalyst Controller. sub auto :Private { my ($self, $c) = @_; $c->log->debug(__PACKAGE__ . '::auto'); - $c->log->debug(">>>>>>>>>>>>>>>>> subscriber::auto"); NGCP::Panel::Utils::Navigation::check_redirect_chain(c => $c); return 1; } @@ -63,8 +62,6 @@ sub auto :Private { sub sub_list :Chained('/') :PathPart('subscriber') :CaptureArgs(0) { my ($self, $c) = @_; - $c->log->debug(">>>>>>>>>>>>>>>>> subscriber::sub_list"); - $c->stash( template => 'subscriber/list.tt', ); @@ -264,8 +261,6 @@ sub create_list :Chained('sub_list') :PathPart('create') :Args(0) :Does(ACL) :AC sub base :Chained('sub_list') :PathPart('') :CaptureArgs(1) { my ($self, $c, $subscriber_id) = @_; - $c->log->debug(">>>>>>>>>>>>>>>>> subscriber::base"); - unless($subscriber_id && $subscriber_id->is_integer) { NGCP::Panel::Utils::Message->error( c => $c, diff --git a/share/templates/customer/details.tt b/share/templates/customer/details.tt index 8bb8c00269..afe7b6d53d 100644 --- a/share/templates/customer/details.tt +++ b/share/templates/customer/details.tt @@ -184,11 +184,11 @@
- [% UNLESS c.user.readonly -%] - Terminate - [% END -%] Details Preferences + [% IF (!c.user.readonly && (c.user.role == 'admin' || c.user.role == 'reseller')) || c.user.uuid != subscriber.uuid -%] + Terminate + [% END -%]