<& /elements/header-popup.html, 'Router added' &> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring'); my $host = $cgi->param('host'); 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; my $error = $nms->add_router($host,$community); errorpage_popup($error) if $error;