summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-04-08 22:16:12 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-04-08 22:16:12 -0500
commit876bc8b0e9976e0c4761bf6679354febe7c2ae69 (patch)
tree6c7cea1687c5e4869847d20031b119d9940a87b1 /httemplate/misc
parentf65ac2eaef54f51964c0ee1d626d434b32c406cc (diff)
RT#18834: Cacti integration [agent access]
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>