X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fnms-add_router.html;h=c3b42a8d3cdfeb3629aa52cca6f9ae34ccf1f23c;hb=ec479b83db152b2658e99901e03d29d2a458acb9;hp=bc437d2b362d393e13cd5348ddb16f1c191e6a2b;hpb=3a4bf42c4385863ea83423b279b39ff6e650f79d;p=freeside.git diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html index bc437d2b3..c3b42a8d3 100644 --- a/httemplate/misc/process/nms-add_router.html +++ b/httemplate/misc/process/nms-add_router.html @@ -1,13 +1,21 @@ -<% header('Router added') %> +<& /elements/header-popup.html, 'Router added' &> + <%init> -# XXX: access rights +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring'); my $host = $cgi->param('host'); -die 'invalid host' unless $host =~ /^[0-9.a-zA-Z\-]+$/; +errorpage_popup('invalid host') unless $host =~ /^[0-9.a-zA-Z\-]+$/; + +my $community = $cgi->param('community'); +errorpage_popup('invalid SNMP community string') unless $community =~ /^[0-9.a-zA-Z\-]*$/; my $nms = new FS::NetworkMonitoringSystem; -$nms->add_router($host); +my $error = $nms->add_router($host,$community); +errorpage_popup($error) if $error;