summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/cacti_graphs.html15
-rw-r--r--httemplate/misc/process/cacti_graphs.cgi16
2 files changed, 31 insertions, 0 deletions
diff --git a/httemplate/misc/cacti_graphs.html b/httemplate/misc/cacti_graphs.html
index 90a435091..9a90b894d 100644
--- a/httemplate/misc/cacti_graphs.html
+++ b/httemplate/misc/cacti_graphs.html
@@ -43,6 +43,21 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
my $svcnum = $cgi->param('svcnum') or die 'Illegal svcnum';
+
+# false laziness with view/elements/svc_Common.html
+# only doing this to check agent access, don't actually use $svc_x
+my $svc_x = qsearchs({
+ 'select' => 'svc_broadband.*',
+ 'table' => 'svc_broadband',
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
+ 'hashref' => { 'svcnum' => $svcnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
+ 'null_right' => 'View/link unlinked services'
+ ),
+}) or die "Unknown svcnum $svcnum in svc_broadband table\n";
+
my $load = $cgi->param('load');
my $graphnum = $cgi->param('graphnum') || '';
diff --git a/httemplate/misc/process/cacti_graphs.cgi b/httemplate/misc/process/cacti_graphs.cgi
index f2baeb455..a4df72288 100644
--- a/httemplate/misc/process/cacti_graphs.cgi
+++ b/httemplate/misc/process/cacti_graphs.cgi
@@ -4,6 +4,22 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
+# false laziness with view/elements/svc_Common.html
+# only doing this to check agent access, don't actually use $svc_x
+my %param = $cgi->param('arg');
+my $svcnum = $param{'svcnum'};
+my $svc_x = qsearchs({
+ 'select' => 'svc_broadband.*',
+ 'table' => 'svc_broadband',
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
+ 'hashref' => { 'svcnum' => $svcnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
+ 'null_right' => 'View/link unlinked services'
+ ),
+}) or die "Unknown svcnum $svcnum in svc_broadband table\n";
+
my $server = FS::UI::Web::JSRPC->new('FS::part_export::cacti::process_graphs', $cgi);
</%init>