[freeside-commits] branch master updated. 876bc8b0e9976e0c4761bf6679354febe7c2ae69
Jonathan Prykop
jonathan at 420.am
Wed Apr 8 20:16:41 PDT 2015
The branch, master has been updated
via 876bc8b0e9976e0c4761bf6679354febe7c2ae69 (commit)
from f65ac2eaef54f51964c0ee1d626d434b32c406cc (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 876bc8b0e9976e0c4761bf6679354febe7c2ae69
Author: Jonathan Prykop <jonathan at freeside.biz>
Date: Wed Apr 8 22:16:12 2015 -0500
RT#18834: Cacti integration [agent access]
diff --git a/httemplate/misc/cacti_graphs.html b/httemplate/misc/cacti_graphs.html
index 90a4350..9a90b89 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 f2baeb4..a4df722 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>
-----------------------------------------------------------------------
Summary of changes:
httemplate/misc/cacti_graphs.html | 15 +++++++++++++++
httemplate/misc/process/cacti_graphs.cgi | 16 ++++++++++++++++
2 files changed, 31 insertions(+)
More information about the freeside-commits
mailing list