summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/addr_range.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-12-10 20:59:42 -0800
committerIvan Kohler <ivan@freeside.biz>2013-12-10 20:59:42 -0800
commit430b2c784d2ee9ea5be00b821d2dbd27279ef132 (patch)
treec8a224219c1425bd3fa03b1a54487bf1f3de7449 /httemplate/edit/process/addr_range.html
parent6ced51db0e73603461591e54b7f606467e7c7af0 (diff)
parente1157f37c618a7b9cdb2793d61999458076dc51b (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts: FS/FS/Mason.pm FS/MANIFEST
Diffstat (limited to 'httemplate/edit/process/addr_range.html')
-rw-r--r--httemplate/edit/process/addr_range.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/httemplate/edit/process/addr_range.html b/httemplate/edit/process/addr_range.html
new file mode 100644
index 000000000..6b05d23a5
--- /dev/null
+++ b/httemplate/edit/process/addr_range.html
@@ -0,0 +1,22 @@
+<& elements/process.html,
+ 'table' => 'addr_range',
+ 'popup_reload' => 'Address range changed',
+ 'precheck_callback' => sub {
+ my ($cgi) = @_;
+ my $start = NetAddr::IP->new($cgi->param('start'), 0)
+ or return 'Illegal or empty (IP address) start: '.$cgi->param('start');
+ if ( length($cgi->param('end')) ) {
+ my $end = NetAddr::IP->new($cgi->param('end'), 0)
+ or return 'Illegal or empty (IP address) end: '.$cgi->param('end');
+ if ( $end < $start ) {
+ ($start, $end) = ($end, $start);
+ $cgi->param('end', $end->addr);
+ $cgi->param('start', $start->addr);
+ }
+ $cgi->param('length', $end - $start + 1);
+ } else {
+ $cgi->param('length', 1);
+ }
+ '';
+ },
+&>