mirror of
https://github.com/itflow-org/itflow
synced 2026-03-11 00:04:50 +00:00
Update Networks, remove subnet mask in favor of CIDR, Global View show clients in first column, allow for IPv6 and provide IPv6 placeholder examples, gateway no longer required reword DHCP Range to IP Range moved DNS to the end, chnaged out some icons
This commit is contained in:
@@ -39,7 +39,7 @@ ob_start();
|
|||||||
<div class="tab-pane fade show active" id="pills-details">
|
<div class="tab-pane fade show active" id="pills-details">
|
||||||
|
|
||||||
<?php if ($client_id) { ?>
|
<?php if ($client_id) { ?>
|
||||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -56,7 +56,7 @@ ob_start();
|
|||||||
while ($row = mysqli_fetch_assoc($sql)) {
|
while ($row = mysqli_fetch_assoc($sql)) {
|
||||||
$client_id_select = intval($row['client_id']);
|
$client_id_select = intval($row['client_id']);
|
||||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name; ?></option>
|
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?= $client_id_select ?>"><?= $client_name ?></option>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
@@ -65,26 +65,6 @@ ob_start();
|
|||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Name <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="name" placeholder="Network name (VLAN, WAN, LAN2 etc)" maxlength="200" required autofocus>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Description</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="description" placeholder="Short Description">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($client_id) { ?>
|
<?php if ($client_id) { ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Location</label>
|
<label>Location</label>
|
||||||
@@ -111,56 +91,65 @@ ob_start();
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Name <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="LAN, WAN, VOIP, Uplink" maxlength="200" required autofocus>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Description</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-align-left"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="description" placeholder="Guest WiFi, VoIP VLAN, Server LAN, WAN Uplink">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-network">
|
<div class="tab-pane fade" id="pills-network">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>vLAN</label>
|
<label>VLAN</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*" name="vlan" placeholder="ex. 20">
|
<input type="number" min="1" max="4094" class="form-control" name="vlan" placeholder="ex. 20">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>IP / Network <strong class="text-danger">*</strong></label>
|
<label>Network (CIDR) <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-network-wired"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-network-wired"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="network" placeholder="Network or IP ex 192.168.1.0/24" maxlength="200" required>
|
<input type="text" class="form-control" name="network" placeholder="192.168.1.0/24 or 2001:db8::/64" maxlength="200" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Subnet Mask</label>
|
<label>Assignable IP Range</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-mask"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-arrows-alt-h"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="subnet" placeholder="ex 255.255.255.0" maxlength="200" data-inputmask="'alias': 'ip'" data-mask>
|
<input type="text" class="form-control" name="dhcp_range" placeholder="192.168.1.100-192.168.1.200" maxlength="200">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Gateway <strong class="text-danger">*</strong></label>
|
<label>Gateway</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-route"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-route"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="gateway" placeholder="ex 192.168.1.1" maxlength="200" data-inputmask="'alias': 'ip'" data-mask required>
|
<input type="text" class="form-control" name="gateway" placeholder="192.168.1.1 or 2001:db8::1" maxlength="200">
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>DHCP Range / IPs</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199" maxlength="200">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -171,9 +160,9 @@ ob_start();
|
|||||||
<label>Primary DNS</label>
|
<label>Primary DNS</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="primary_dns" placeholder="ex 9.9.9.9" maxlength="200" data-inputmask="'alias': 'ip'" data-mask>
|
<input type="text" class="form-control" name="primary_dns" placeholder="9.9.9.9 or 2620:fe::fe" maxlength="200">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -181,9 +170,9 @@ ob_start();
|
|||||||
<label>Secondary DNS</label>
|
<label>Secondary DNS</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="secondary_dns" placeholder="ex 1.1.1.1" maxlength="200" data-inputmask="'alias': 'ip'" data-mask>
|
<input type="text" class="form-control" name="secondary_dns" placeholder="1.1.1.1 or 2606:4700:4700::1111" maxlength="200">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ $network_name = nullable_htmlentities($row['network_name']);
|
|||||||
$network_description = nullable_htmlentities($row['network_description']);
|
$network_description = nullable_htmlentities($row['network_description']);
|
||||||
$network_vlan = intval($row['network_vlan']);
|
$network_vlan = intval($row['network_vlan']);
|
||||||
$network = nullable_htmlentities($row['network']);
|
$network = nullable_htmlentities($row['network']);
|
||||||
$network_subnet = nullable_htmlentities($row['network_subnet']);
|
|
||||||
$network_gateway = nullable_htmlentities($row['network_gateway']);
|
$network_gateway = nullable_htmlentities($row['network_gateway']);
|
||||||
$network_primary_dns = nullable_htmlentities($row['network_primary_dns']);
|
$network_primary_dns = nullable_htmlentities($row['network_primary_dns']);
|
||||||
$network_secondary_dns = nullable_htmlentities($row['network_secondary_dns']);
|
$network_secondary_dns = nullable_htmlentities($row['network_secondary_dns']);
|
||||||
@@ -20,33 +19,32 @@ $network_notes = nullable_htmlentities($row['network_notes']);
|
|||||||
$network_location_id = intval($row['network_location_id']);
|
$network_location_id = intval($row['network_location_id']);
|
||||||
$client_id = intval($row['network_client_id']);
|
$client_id = intval($row['network_client_id']);
|
||||||
|
|
||||||
// Generate the HTML form content using output buffering.
|
|
||||||
ob_start();
|
ob_start();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="modal-header bg-dark">
|
<div class="modal-header bg-dark">
|
||||||
<h5 class="modal-title"><i class="fa fa-fw fa-network-wired mr-2"></i>Editing network: <span class="text-bold"><?php echo $network_name; ?></span></h5>
|
<h5 class="modal-title"><i class="fa fa-fw fa-network-wired mr-2"></i>Editing network: <span class="text-bold"><?= $network_name ?></span></h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="network_id" value="<?php echo $network_id; ?>">
|
<input type="hidden" name="network_id" value="<?= $network_id ?>">
|
||||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" data-toggle="pill" href="#pillsEditDetails<?php echo $network_id; ?>">Details</a>
|
<a class="nav-link active" data-toggle="pill" href="#pillsEditDetails">Details</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="pill" href="#pillsEditNetwork<?php echo $network_id; ?>">Network</a>
|
<a class="nav-link" data-toggle="pill" href="#pillsEditNetwork">Network</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="pill" href="#pillsEditDNS<?php echo $network_id; ?>">DNS</a>
|
<a class="nav-link" data-toggle="pill" href="#pillsEditDNS">DNS</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="pill" href="#pillsEditNotes<?php echo $network_id; ?>">Notes</a>
|
<a class="nav-link" data-toggle="pill" href="#pillsEditNotes">Notes</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -54,27 +52,7 @@ ob_start();
|
|||||||
|
|
||||||
<div class="tab-content" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
|
<div class="tab-content" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
|
||||||
|
|
||||||
<div class="tab-pane fade show active" id="pillsEditDetails<?php echo $network_id; ?>">
|
<div class="tab-pane fade show active" id="pillsEditDetails">
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Name <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="name" placeholder="Network name (VLAN, WAN, LAN2 etc)" value="<?php echo $network_name; ?>" maxlength="200" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Description</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="description" placeholder="Short Description" value="<?php echo $network_description; ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Location</label>
|
<label>Location</label>
|
||||||
@@ -90,8 +68,8 @@ ob_start();
|
|||||||
$location_id = intval($row['location_id']);
|
$location_id = intval($row['location_id']);
|
||||||
$location_name = nullable_htmlentities($row['location_name']);
|
$location_name = nullable_htmlentities($row['location_name']);
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo $location_id; ?>" <?php if ($location_id == $network_location_id) { echo "selected"; } ?>>
|
<option value="<?= $location_id ?>" <?php if ($location_id == $network_location_id) { echo "selected"; } ?>>
|
||||||
<?php echo $location_name; ?>
|
<?= $location_name ?>
|
||||||
</option>
|
</option>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@@ -100,37 +78,57 @@ ob_start();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pillsEditNetwork<?php echo $network_id; ?>">
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>vLAN</label>
|
<label>Name <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*" name="vlan" placeholder="ex. 20" value="<?php echo $network_vlan; ?>">
|
<input type="text" class="form-control" name="name" placeholder="LAN, WAN, VOIP, Uplink" value="<?= $network_name ?>" maxlength="200" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>IP / Network <strong class="text-danger">*</strong></label>
|
<label>Description</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-align-left"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="description" placeholder="Guest WiFi, VoIP VLAN, Server LAN, WAN Uplink" value="<?= $network_description ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pillsEditNetwork">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>VLAN</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="number" min="1" max="4094" name="vlan" placeholder="ex. 20" value="<?= $network_vlan ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Network (CIDR) <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-network-wired"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-network-wired"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="network" placeholder="Network or IP ex 192.168.1.0/24" maxlength="200" value="<?php echo $network; ?>" required>
|
<input type="text" class="form-control" name="network" placeholder="192.168.1.0/24 or 2001:db8::/64" maxlength="200" value="<?= $network ?>" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Subnet Mask</label>
|
<label>Assignable IP Range</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-mask"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-arrows-alt-h"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="subnet" placeholder="ex 255.255.255.0" maxlength="200" data-inputmask="'alias': 'ip'" data-mask value="<?php echo $network_subnet; ?>">
|
<input type="text" class="form-control" name="dhcp_range" placeholder="192.168.1.100-192.168.1.200" maxlength="200" value="<?= $network_dhcp_range ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -140,31 +138,21 @@ ob_start();
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-route"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-route"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="gateway" placeholder="ex 192.168.1.1" maxlength="200" data-inputmask="'alias': 'ip'" data-mask value="<?php echo $network_gateway; ?>" required>
|
<input type="text" class="form-control" name="gateway" placeholder="192.168.1.1 or 2001:db8::1" maxlength="200" value="<?= $network_gateway ?>" required>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>DHCP Range / IPs</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199" maxlength="200" value="<?php echo $network_dhcp_range; ?>">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pillsEditDNS<?php echo $network_id; ?>">
|
<div class="tab-pane fade" id="pillsEditDNS">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Primary DNS</label>
|
<label>Primary DNS</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="primary_dns" placeholder="ex 9.9.9.9" maxlength="200" data-inputmask="'alias': 'ip'" data-mask value="<?php echo $network_primary_dns; ?>">
|
<input type="text" class="form-control" name="primary_dns" placeholder="9.9.9.9 or 2620:fe::fe" maxlength="200" value="<?= $network_primary_dns ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -172,21 +160,21 @@ ob_start();
|
|||||||
<label>Secondary DNS</label>
|
<label>Secondary DNS</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="secondary_dns" placeholder="ex 1.1.1.1" maxlength="200" data-inputmask="'alias': 'ip'" data-mask value="<?php echo $network_secondary_dns; ?>">
|
<input type="text" class="form-control" name="secondary_dns" placeholder="1.1.1.1 or 2606:4700:4700::1111" maxlength="200" value="<?= $network_secondary_dns ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pillsEditNotes<?php echo $network_id; ?>">
|
<div class="tab-pane fade" id="pillsEditNotes">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea class="form-control" rows="12" name="notes" placeholder="Enter some notes"><?php echo $network_notes; ?></textarea>
|
<textarea class="form-control" rows="12" name="notes" placeholder="Enter some notes"><?= $network_notes ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="text-muted text-right"><?php echo $network_id; ?></p>
|
<p class="text-muted text-right"><?= $network_id ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form autocomplete="off">
|
<form autocomplete="off">
|
||||||
<?php if ($client_url) { ?>
|
<?php if ($client_url) { ?>
|
||||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
<input type="hidden" name="archived" value="<?= $archived ?>">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
@@ -127,7 +127,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$location_id = intval($row['location_id']);
|
$location_id = intval($row['location_id']);
|
||||||
$location_name = nullable_htmlentities($row['location_name']);
|
$location_name = nullable_htmlentities($row['location_name']);
|
||||||
?>
|
?>
|
||||||
<option <?php if ($location_filter == $location_id) { echo "selected"; } ?> value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
|
<option <?php if ($location_filter == $location_id) { echo "selected"; } ?> value="<?= $location_id ?>"><?= $location_name ?></option>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -166,7 +166,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="btn-group float-right">
|
<div class="btn-group float-right">
|
||||||
<a href="?<?php echo $client_url; ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
<a href="?<?= $client_url ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||||
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
|
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
|
||||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||||
</a>
|
</a>
|
||||||
@@ -190,7 +190,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<div class="table-responsive-sm">
|
<div class="table-responsive-sm">
|
||||||
|
|
||||||
<form id="bulkActions" action="post.php" method="post">
|
<form id="bulkActions" action="post.php" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||||
|
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||||
@@ -200,48 +200,48 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" onclick="checkAll(this)">
|
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" onclick="checkAll(this)">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=network_name&order=<?php echo $disp; ?>">
|
|
||||||
Name <?php if ($sort == 'network_name') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=network_vlan&order=<?php echo $disp; ?>">
|
|
||||||
vLAN <?php if ($sort == 'network_vlan') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=network&order=<?php echo $disp; ?>">
|
|
||||||
IP / Network <?php if ($sort == 'network') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=network_gateway&order=<?php echo $disp; ?>">
|
|
||||||
Gateway <?php if ($sort == 'network_gateway') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=network_primary_dns&order=<?php echo $disp; ?>">
|
|
||||||
DNS <?php if ($sort == 'network_primary_dns') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=network_dhcp_range&order=<?php echo $disp; ?>">
|
|
||||||
DHCP Range <?php if ($sort == 'network_dhcp_range') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=location_name&order=<?php echo $disp; ?>">
|
|
||||||
Location <?php if ($sort == 'location_name') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<?php if (!$client_url) { ?>
|
<?php if (!$client_url) { ?>
|
||||||
<th>
|
<th>
|
||||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=network_name&order=<?= $disp ?>">
|
||||||
|
Name <?php if ($sort == 'network_name') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=location_name&order=<?= $disp ?>">
|
||||||
|
Location <?php if ($sort == 'location_name') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=network_vlan&order=<?= $disp ?>">
|
||||||
|
VLAN <?php if ($sort == 'network_vlan') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=network&order=<?= $disp ?>">
|
||||||
|
Network (CIDR) <?php if ($sort == 'network') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=network_gateway&order=<?= $disp ?>">
|
||||||
|
Gateway <?php if ($sort == 'network_gateway') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=network_dhcp_range&order=<?= $disp ?>">
|
||||||
|
IP Range <?php if ($sort == 'network_dhcp_range') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?= $url_query_strings_sort ?>&sort=network_primary_dns&order=<?= $disp ?>">
|
||||||
|
DNS <?php if ($sort == 'network_primary_dns') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -261,7 +261,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$network_vlan_display = "-";
|
$network_vlan_display = "-";
|
||||||
}
|
}
|
||||||
$network = nullable_htmlentities($row['network']);
|
$network = nullable_htmlentities($row['network']);
|
||||||
$network_subnet = nullable_htmlentities($row['network_subnet']);
|
|
||||||
$network_gateway = nullable_htmlentities($row['network_gateway']);
|
$network_gateway = nullable_htmlentities($row['network_gateway']);
|
||||||
$network_primary_dns = nullable_htmlentities($row['network_primary_dns']);
|
$network_primary_dns = nullable_htmlentities($row['network_primary_dns']);
|
||||||
$network_secondary_dns = nullable_htmlentities($row['network_secondary_dns']);
|
$network_secondary_dns = nullable_htmlentities($row['network_secondary_dns']);
|
||||||
@@ -292,51 +291,48 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<input class="form-check-input bulk-select" type="checkbox" name="network_ids[]" value="<?php echo $network_id ?>">
|
<input class="form-check-input bulk-select" type="checkbox" name="network_ids[]" value="<?php echo $network_id ?>">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
<?php if (!$client_url) { ?>
|
||||||
|
<td><a href="networks.php?client_id=<?= $client_id ?>"><?= $client_name ?></a></td>
|
||||||
|
<?php } ?>
|
||||||
<td>
|
<td>
|
||||||
<a class="text-dark ajax-modal" href="#" data-modal-url="modals/network/network_edit.php?id=<?= $network_id ?>">
|
<a class="text-dark ajax-modal" href="#" data-modal-url="modals/network/network_edit.php?id=<?= $network_id ?>">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<i class="fa fa-fw fa-2x fa-network-wired mr-3"></i>
|
<i class="fa fa-fw fa-2x fa-network-wired mr-2"></i>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<div><?php echo $network_name; ?></div>
|
<div><?= $network_name ?></div>
|
||||||
<div><small class="text-secondary"><?php echo $network_description; ?></small></div>
|
<div><small class="text-secondary"><?= $network_description ?></small></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo $network_vlan_display; ?></td>
|
<td><?= $location_name_display ?></td>
|
||||||
<td>
|
<td><?= $network_vlan_display ?></td>
|
||||||
<?php echo $network; ?>
|
<td><?= $network ?></td>
|
||||||
<div class="text-secondary mt-1"><?php echo $network_subnet; ?></div>
|
<td><?= $network_gateway ?></td>
|
||||||
</td>
|
<td><?= $network_dhcp_range_display ?></td>
|
||||||
<td><?php echo $network_gateway; ?></td>
|
<td><?= $network_dns_display ?></td>
|
||||||
<td><?php echo $network_dns_display; ?></td>
|
|
||||||
<td><?php echo $network_dhcp_range_display; ?></td>
|
|
||||||
<td><?php echo $location_name_display; ?></td>
|
|
||||||
<?php if (!$client_url) { ?>
|
|
||||||
<td><a href="networks.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
|
||||||
<?php } ?>
|
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown dropleft text-center">
|
<div class="dropdown dropleft text-center">
|
||||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||||
<i class="fas fa-ellipsis-h"></i>
|
<i class="fas fa-ellipsis-h"></i>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item ajax-modal" href="#" data-modal-url="modals/network/network_edit.php?id=<?=$network_id ?>">
|
<a class="dropdown-item ajax-modal" href="#" data-modal-url="modals/network/network_edit.php?id=<?= $network_id ?>">
|
||||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||||
</a>
|
</a>
|
||||||
<?php if ($session_user_role == 3) { ?>
|
<?php if ($session_user_role == 3) { ?>
|
||||||
<?php if ($network_archived_at) { ?>
|
<?php if ($network_archived_at) { ?>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-info confirm-link" href="post.php?unarchive_network=<?php echo $network_id; ?>">
|
<a class="dropdown-item text-info confirm-link" href="post.php?unarchive_network=<?= $network_id ?>">
|
||||||
<i class="fas fa-fw fa-redo mr-2"></i>Restore
|
<i class="fas fa-fw fa-redo mr-2"></i>Restore
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_network=<?php echo $network_id; ?>">
|
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_network=<?= $network_id ?>">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</a>
|
</a>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_network=<?php echo $network_id; ?>">
|
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_network=<?= $network_id ?>">
|
||||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if (isset($_POST['add_network'])) {
|
|||||||
|
|
||||||
require_once 'network_model.php';
|
require_once 'network_model.php';
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO networks SET network_name = '$name', network_description = '$description', network_vlan = $vlan, network = '$network', network_subnet = '$subnet', network_gateway = '$gateway', network_primary_dns = '$primary_dns', network_secondary_dns = '$secondary_dns', network_dhcp_range = '$dhcp_range', network_notes = '$notes', network_location_id = $location_id, network_client_id = $client_id");
|
mysqli_query($mysqli,"INSERT INTO networks SET network_name = '$name', network_description = '$description', network_vlan = $vlan, network = '$network', network_subnet = '$subnet', network_gateway = '$gateway', network_primary_dns = '$primary_dns', network_secondary_dns = '$secondary_dns', network_notes = '$notes', network_location_id = $location_id, network_client_id = $client_id");
|
||||||
|
|
||||||
$network_id = mysqli_insert_id($mysqli);
|
$network_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ if (isset($_POST['edit_network'])) {
|
|||||||
$network_id = intval($_POST['network_id']);
|
$network_id = intval($_POST['network_id']);
|
||||||
require_once 'network_model.php';
|
require_once 'network_model.php';
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network_description = '$description', network_vlan = $vlan, network = '$network', network_subnet = '$subnet', network_gateway = '$gateway', network_primary_dns = '$primary_dns', network_secondary_dns = '$secondary_dns', network_dhcp_range = '$dhcp_range', network_notes = '$notes', network_location_id = $location_id WHERE network_id = $network_id");
|
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network_description = '$description', network_vlan = $vlan, network = '$network', network_gateway = '$gateway', network_primary_dns = '$primary_dns', network_secondary_dns = '$secondary_dns', network_dhcp_range = '$dhcp_range', network_notes = '$notes', network_location_id = $location_id WHERE network_id = $network_id");
|
||||||
|
|
||||||
logAction("Network", "Edit", "$session_name edited network $name", $client_id, $network_id);
|
logAction("Network", "Edit", "$session_name edited network $name", $client_id, $network_id);
|
||||||
|
|
||||||
@@ -174,12 +174,12 @@ if (isset($_POST['export_networks_csv'])) {
|
|||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
|
|
||||||
//set column headers
|
//set column headers
|
||||||
$fields = array('Name', 'Description', 'vLAN', 'IP/Network', 'Subnet Mask', 'Gateway', 'Primary DNS', 'Secondary DNS', 'DHCP Range');
|
$fields = array('Name', 'Description', 'VLAN', 'Network (CIDR)', 'Gateway', 'IP Range', 'Primary DNS', 'Secondary DNS');
|
||||||
fputcsv($f, $fields, $delimiter, $enclosure, $escape);
|
fputcsv($f, $fields, $delimiter, $enclosure, $escape);
|
||||||
|
|
||||||
//output each row of the data, format line as csv and write to file pointer
|
//output each row of the data, format line as csv and write to file pointer
|
||||||
while ($row = $sql->fetch_assoc()) {
|
while ($row = $sql->fetch_assoc()) {
|
||||||
$lineData = array($row['network_name'], $row['network_description'], $row['network_vlan'], $row['network'], $row['network_subnet'], $row['network_gateway'], $row['network_primary_dns'], $row['network_secondary_dns'], $row['network_dhcp_range']);
|
$lineData = array($row['network_name'], $row['network_description'], $row['network_vlan'], $row['network'], $row['network_gateway'], $row['network_dhcp_range'], $row['network_primary_dns'], $row['network_secondary_dns']);
|
||||||
fputcsv($f, $lineData, $delimiter, $enclosure, $escape);
|
fputcsv($f, $lineData, $delimiter, $enclosure, $escape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ $name = sanitizeInput($_POST['name']);
|
|||||||
$description = sanitizeInput($_POST['description']);
|
$description = sanitizeInput($_POST['description']);
|
||||||
$vlan = intval($_POST['vlan']);
|
$vlan = intval($_POST['vlan']);
|
||||||
$network = sanitizeInput($_POST['network']);
|
$network = sanitizeInput($_POST['network']);
|
||||||
$subnet = sanitizeInput($_POST['subnet']);
|
|
||||||
$gateway = sanitizeInput($_POST['gateway']);
|
$gateway = sanitizeInput($_POST['gateway']);
|
||||||
$primary_dns = sanitizeInput($_POST['primary_dns']);
|
$primary_dns = sanitizeInput($_POST['primary_dns']);
|
||||||
$secondary_dns = sanitizeInput($_POST['secondary_dns']);
|
$secondary_dns = sanitizeInput($_POST['secondary_dns']);
|
||||||
|
|||||||
Reference in New Issue
Block a user