allow private ip ranges in ips-and-ports as some configurations require that; fixes #802
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -6,6 +6,7 @@ $header
|
||||
{$title}
|
||||
</h2>
|
||||
</header>
|
||||
<script type="text/javascript" src="templates/{$theme}/assets/js/ipsandports.js"></script>
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ $header
|
||||
{$title}
|
||||
</h2>
|
||||
</header>
|
||||
<script type="text/javascript" src="templates/{$theme}/assets/js/ipsandports.js"></script>
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
46
templates/Sparkle/assets/js/ipsandports.js
vendored
Normal file
46
templates/Sparkle/assets/js/ipsandports.js
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* check for internal ip and output a notice if private-range ip is given
|
||||
*/
|
||||
$('#ip').change(function() {
|
||||
var ipval = $(this).val();
|
||||
if (ipval.length > 0) {
|
||||
var sid = getUrlParameter('s');
|
||||
$.ajax({
|
||||
url: "admin_ipsandports.php?s="+sid+"&page=overview&action=jqCheckIP",
|
||||
type: "POST",
|
||||
data: {
|
||||
ip: ipval
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
if (json != 0) {
|
||||
$('#ip').parent().append(json);
|
||||
} else {
|
||||
$('#ipnote').remove();
|
||||
}
|
||||
},
|
||||
error: function(a, b) {
|
||||
console.log(a, b);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user