prevent reload loops on process pages, #71249
[freeside.git] / httemplate / misc / process / nms-add_router.html
1 <& /elements/header-popup.html, 'Router added' &>
2   <SCRIPT TYPE="text/javascript">
3     topreload();
4   </SCRIPT>
5 </BODY></HTML>
6 <%init>
7
8 die "access denied"
9   unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring');
10
11 my $host = $cgi->param('host'); 
12 errorpage_popup('invalid host') unless $host =~ /^[0-9.a-zA-Z\-]+$/;
13
14 my $community = $cgi->param('community'); 
15 errorpage_popup('invalid SNMP community string') unless $community =~ /^[0-9.a-zA-Z\-]*$/;
16
17 my $nms = new FS::NetworkMonitoringSystem;
18 my $error = $nms->add_router($host,$community);
19 errorpage_popup($error) if $error;
20
21 </%init>