summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorlevinse <levinse>2011-02-05 06:04:32 +0000
committerlevinse <levinse>2011-02-05 06:04:32 +0000
commitbc8bc32def6ab636129c205ebd5b7db76b805ac5 (patch)
tree9c2521ffa41c78cc30aefd1bbb2d0690b9635390 /httemplate
parent3d01805cd88f7c4a37d7060117a9a42631c4bb5e (diff)
torrus, add interface UI, RT10574
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/misc/nms-add_iface.html2
-rw-r--r--httemplate/misc/process/nms-add_iface.html22
2 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/misc/nms-add_iface.html b/httemplate/misc/nms-add_iface.html
index 1de0249ef..11456f2e8 100644
--- a/httemplate/misc/nms-add_iface.html
+++ b/httemplate/misc/nms-add_iface.html
@@ -2,6 +2,8 @@ Adding interface <B><% $iface %></B> for <B><% $host %></B>
<BR>
<FORM NAME="nms-add_iface" ACTION="<% popurl(1) %>process/nms-add_iface.html" METHOD=POST>
+<INPUT TYPE="HIDDEN" name="iface" value="<%$iface%>">
+<INPUT TYPE="HIDDEN" name="host" value="<%$host%>">
Torrus Service Id
<% include('/elements/input-text.html',
'field' => 'serviceid',
diff --git a/httemplate/misc/process/nms-add_iface.html b/httemplate/misc/process/nms-add_iface.html
new file mode 100644
index 000000000..ffc70d9cc
--- /dev/null
+++ b/httemplate/misc/process/nms-add_iface.html
@@ -0,0 +1,22 @@
+<% header('Interface added') %>
+</BODY></HTML>
+<%init>
+
+# XXX: access rights
+
+my $host = $cgi->param('host');
+die 'invalid host' unless $host =~ /^[0-9.a-zA-Z\-]+$/;
+
+my $iface = $cgi->param('iface');
+die 'invalid iface' unless $iface =~ /^[0-9A-Za-z_\-.\\\/ ]+$/;
+
+my $serviceid = $cgi->param('serviceid');
+die 'invalid serviceid' unless $serviceid =~ /^[0-9A-Za-z_\-.\\\/ ]+$/;
+
+my $conf = new FS::Conf;
+my $system = $conf->config('network_monitoring_system');
+
+my $nms = new FS::NetworkMonitoringSystem;
+$nms->add_interface($host,$iface,$serviceid);
+
+</%init>