X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fnms-add_router.html;h=a4c3423da0b74f7d19089bf6e58f83e483008f40;hb=639c645c0f00c082a735b40f97a4f830c5e84949;hp=bc437d2b362d393e13cd5348ddb16f1c191e6a2b;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html index bc437d2b3..a4c3423da 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;