Beispiel #1
0
# initialize user object
$Database = new Database_PDO();
$User = new User($Database);
$Admin = new Admin($Database);
$Subnets = new Subnets($Database);
$Result = new Result();
$Zones = new FirewallZones($Database);
$Tools = new Tools($Database);
# verify that user is logged in
$User->check_user_session();
# generate a dropdown list for all subnets within a section
if ($_POST['operation'] == 'fetchSectionSubnets') {
    if ($_POST['sectionId']) {
        if (preg_match('/^[0-9]+$/i', $_POST['sectionId'])) {
            $sectionId = $_POST['sectionId'];
            print $Subnets->print_mastersubnet_dropdown_menu($sectionId);
        } else {
            $Result->show('danger', _('Invalid ID.'), true);
        }
    }
}
# deliver zone details
if ($_POST['operation'] == 'deliverZoneDetail') {
    if ($_POST['zoneId']) {
        if (preg_match('/^[0-9]+$/i', $_POST['zoneId'])) {
            # return the zone details
            $Zones->get_zone_detail($_POST['zoneId']);
        } else {
            $Result->show('danger', _('Invalid zone ID.'), true);
        }
    }
Beispiel #2
0
    ?>
</td>
    </tr>
    <?php 
}
?>

    <!-- Master subnet -->
    <tr>
        <td><?php 
print _('Master Folder');
?>
</td>
        <td>
        	<?php 
$Subnets->print_mastersubnet_dropdown_menu($_POST['sectionId'], @$folder_old_details['masterSubnetId'], true);
?>
        </td>
        <td class="info2"><?php 
print _('Enter master folder if you want to nest it under existing folder, or select root to create root folder');
?>
!</td>
    </tr>

    <!-- hidden values -->
    <input type="hidden" name="sectionId"       value="<?php 
print $_POST['sectionId'];
?>
">
    <input type="hidden" name="subnetId"        value="<?php 
print $_POST['subnetId'];
    ?>
			</select>
		</td>
	</tr>
	<tr>
		<!-- subnet -->
		<td>
			<?php 
    print _('Subnet');
    ?>
		</td>
			<?php 
    # display the subnet if already configured
    if ($firewallZone->sectionId) {
        print '<td><div class="sectionSubnets">';
        print $Subnets->print_mastersubnet_dropdown_menu($firewallZone->sectionId, $firewallZone->subnetId);
        print '</div></td>';
    } else {
        # if there is only one section, fetch the subnets of that section
        if (sizeof($sections) <= 1) {
            print '<td>';
            print $Subnets->print_mastersubnet_dropdown_menu($sections[0]->id, $firewallZone->subnetId);
            print '</td>';
        } else {
            # if there are more than one section, use ajax to fetch the subnets of the selected section
            print '<td><div class="sectionSubnets"></div></td>';
        }
    }
    ?>
	</tr>