diff options
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/nms-add_router.html | 4 | ||||
-rw-r--r-- | httemplate/misc/process/nms-add_iface.html | 11 | ||||
-rw-r--r-- | httemplate/misc/process/nms-add_router.html | 12 |
3 files changed, 16 insertions, 11 deletions
diff --git a/httemplate/misc/nms-add_router.html b/httemplate/misc/nms-add_router.html index c41e61977..c32ceb84c 100644 --- a/httemplate/misc/nms-add_router.html +++ b/httemplate/misc/nms-add_router.html @@ -1,4 +1,4 @@ -<% header('Add Router') %> +<& /elements/header-popup.html, 'Add Router' &> <FORM NAME="nms-add_iface" ACTION="<% popurl(1) %>process/nms-add_router.html" METHOD=POST> Router Hostname/IP @@ -16,7 +16,7 @@ SNMP Community String (optional) <BR> <INPUT TYPE="submit" NAME="submit" ID="submit_nms-add_router" VALUE="Add Router"> </FORM> - +</BODY></HTML> <%init> # XXX: access rights, disable/enable submit button, something's wrong with style diff --git a/httemplate/misc/process/nms-add_iface.html b/httemplate/misc/process/nms-add_iface.html index 5f51e5ce1..d21b3792a 100644 --- a/httemplate/misc/process/nms-add_iface.html +++ b/httemplate/misc/process/nms-add_iface.html @@ -1,4 +1,4 @@ -<% header('Interface added') %> +<& /elements/header-popup.html, 'Interface added') &> <SCRIPT TYPE="text/javascript"> window.top.location.reload(); </SCRIPT> @@ -9,16 +9,17 @@ 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 $iface = $cgi->param('iface'); -die 'invalid iface' unless $iface =~ /^[0-9A-Za-z_\-.\\\/ ]+$/; +errorpage_popup('invalid iface') unless $iface =~ /^[0-9A-Za-z_\-.\\\/ ]+$/; my $serviceid = $cgi->param('serviceid'); #die 'invalid serviceid' unless $serviceid =~ /^[0-9A-Za-z_\-.\\\/ ]+$/; -die 'invalid serviceid' unless $serviceid =~ /^[0-9A-Za-z_]+$/; +errorpage_popup('invalid serviceid') unless $serviceid =~ /^[0-9A-Za-z_]+$/; my $nms = new FS::NetworkMonitoringSystem; -$nms->add_interface($host,$iface,$serviceid); +my $error = $nms->add_interface($host,$iface,$serviceid); +errorpage_popup($error) if $error; </%init> diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html index a77d897d2..c3b42a8d3 100644 --- a/httemplate/misc/process/nms-add_router.html +++ b/httemplate/misc/process/nms-add_router.html @@ -1,4 +1,7 @@ -<% header('Router added') %> +<& /elements/header-popup.html, 'Router added' &> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> </BODY></HTML> <%init> @@ -6,12 +9,13 @@ 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'); -die 'invalid SNMP community string' unless $community =~ /^[0-9.a-zA-Z\-]*$/; +errorpage_popup('invalid SNMP community string') unless $community =~ /^[0-9.a-zA-Z\-]*$/; my $nms = new FS::NetworkMonitoringSystem; -$nms->add_router($host,$community); +my $error = $nms->add_router($host,$community); +errorpage_popup($error) if $error; </%init> |