2015-08-13 07:09:07 +02:00
|
|
|
<?php
|
2018-06-04 02:01:10 +02:00
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
2020-07-23 21:31:43 +02:00
|
|
|
|
2018-06-04 02:01:10 +02:00
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
2020-07-23 21:31:43 +02:00
|
|
|
|
2018-06-04 02:01:10 +02:00
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
2020-07-23 21:31:43 +02:00
|
|
|
|
2018-06-04 02:01:10 +02:00
|
|
|
The Original Code is FusionPBX
|
2020-07-23 21:31:43 +02:00
|
|
|
|
2018-06-04 02:01:10 +02:00
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2020-07-23 21:31:43 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2018 - 2020
|
2018-06-04 02:01:10 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
*/
|
2016-06-22 02:00:38 +02:00
|
|
|
|
|
|
|
|
//includes
|
|
|
|
|
require_once "root.php";
|
|
|
|
|
require_once "resources/require.php";
|
2019-07-02 01:30:03 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2016-06-22 02:00:38 +02:00
|
|
|
|
|
|
|
|
//check permissions
|
2020-07-23 21:31:43 +02:00
|
|
|
if (permission_exists('access_control_add') || permission_exists('access_control_edit')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
2016-06-22 02:00:38 +02:00
|
|
|
}
|
2015-08-13 07:09:07 +02:00
|
|
|
|
|
|
|
|
//add multi-lingual support
|
2015-12-21 08:52:40 +01:00
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
2015-08-13 07:09:07 +02:00
|
|
|
|
|
|
|
|
//action add or update
|
2019-07-02 01:30:03 +02:00
|
|
|
if (is_uuid($_REQUEST["id"])) {
|
2015-08-13 07:09:07 +02:00
|
|
|
$action = "update";
|
2019-07-02 01:30:03 +02:00
|
|
|
$access_control_uuid = $_REQUEST["id"];
|
2020-07-23 21:31:43 +02:00
|
|
|
$id = $_REQUEST["id"];
|
2015-08-13 07:09:07 +02:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$action = "add";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get http post variables and set them to php variables
|
2020-07-23 21:31:43 +02:00
|
|
|
if (is_array($_POST) && is_uuid($access_control_uuid)) {
|
2019-07-03 00:57:04 +02:00
|
|
|
$access_control_name = $_POST["access_control_name"];
|
|
|
|
|
$access_control_default = $_POST["access_control_default"];
|
2020-07-23 21:31:43 +02:00
|
|
|
$access_control_nodes = $_POST["access_control_nodes"];
|
2019-07-03 00:57:04 +02:00
|
|
|
$access_control_description = $_POST["access_control_description"];
|
2015-08-13 07:09:07 +02:00
|
|
|
}
|
|
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//process the user data and save it to the database
|
|
|
|
|
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
2015-08-13 07:09:07 +02:00
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//validate the token
|
|
|
|
|
$token = new token;
|
|
|
|
|
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
|
|
|
|
message::add($text['message-invalid_token'],'negative');
|
|
|
|
|
header('Location: access_controls.php');
|
|
|
|
|
exit;
|
2019-10-22 01:03:59 +02:00
|
|
|
}
|
2019-09-18 05:32:33 +02:00
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//process the http post data by submitted action
|
|
|
|
|
if ($_POST['action'] != '' && strlen($_POST['action']) > 0) {
|
|
|
|
|
|
|
|
|
|
//prepare the array(s)
|
|
|
|
|
$x = 0;
|
|
|
|
|
foreach ($_POST['access_control_nodes'] as $row) {
|
|
|
|
|
if (is_uuid($row['access_control_uuid']) && $row['checked'] === 'true') {
|
|
|
|
|
$array['access_controls'][$x]['checked'] = $row['checked'];
|
|
|
|
|
$array['access_controls'][$x]['access_control_nodes'][]['access_control_node_uuid'] = $row['access_control_node_uuid'];
|
|
|
|
|
$x++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//send the array to the database class
|
|
|
|
|
switch ($_POST['action']) {
|
|
|
|
|
case 'copy':
|
|
|
|
|
if (permission_exists('access_control_add')) {
|
|
|
|
|
$obj = new database;
|
|
|
|
|
$obj->copy($array);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'delete':
|
|
|
|
|
if (permission_exists('access_control_delete')) {
|
|
|
|
|
$obj = new database;
|
|
|
|
|
$obj->delete($array);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'toggle':
|
|
|
|
|
if (permission_exists('access_control_update')) {
|
|
|
|
|
$obj = new database;
|
|
|
|
|
$obj->toggle($array);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//redirect the user
|
|
|
|
|
if (in_array($_POST['action'], array('copy', 'delete', 'toggle'))) {
|
|
|
|
|
header('Location: access_control_edit.php?id='.$id);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-08-13 07:09:07 +02:00
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//check for all required data
|
|
|
|
|
$msg = '';
|
|
|
|
|
if (strlen($access_control_name) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_name']."<br>\n"; }
|
|
|
|
|
if (strlen($access_control_default) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_default']."<br>\n"; }
|
|
|
|
|
//if (strlen($access_control_nodes) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_nodes']."<br>\n"; }
|
|
|
|
|
//if (strlen($access_control_description) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_description']."<br>\n"; }
|
|
|
|
|
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
require_once "resources/header.php";
|
|
|
|
|
require_once "resources/persist_form_var.php";
|
|
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table><tr><td>\n";
|
|
|
|
|
echo $msg."<br />";
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
|
persistformvar($_POST);
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
require_once "resources/footer.php";
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-08-13 07:09:07 +02:00
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//add the access_control_uuid
|
|
|
|
|
if (!is_uuid($_POST["access_control_uuid"])) {
|
2019-07-02 01:30:03 +02:00
|
|
|
$access_control_uuid = uuid();
|
|
|
|
|
}
|
2015-08-13 07:09:07 +02:00
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//prepare the array
|
|
|
|
|
$array['access_controls'][0]['access_control_uuid'] = $access_control_uuid;
|
|
|
|
|
$array['access_controls'][0]['access_control_name'] = $access_control_name;
|
|
|
|
|
$array['access_controls'][0]['access_control_default'] = $access_control_default;
|
|
|
|
|
$array['access_controls'][0]['access_control_description'] = $access_control_description;
|
|
|
|
|
$y = 0;
|
|
|
|
|
if (is_array($access_control_nodes)) {
|
|
|
|
|
foreach ($access_control_nodes as $row) {
|
|
|
|
|
if (strlen($row['node_type']) > 0) {
|
|
|
|
|
$array['access_controls'][0]['access_control_nodes'][$y]['access_control_node_uuid'] = $row["access_control_node_uuid"];
|
|
|
|
|
$array['access_controls'][0]['access_control_nodes'][$y]['node_type'] = $row["node_type"];
|
|
|
|
|
$array['access_controls'][0]['access_control_nodes'][$y]['node_cidr'] = $row["node_cidr"];
|
|
|
|
|
$array['access_controls'][0]['access_control_nodes'][$y]['node_domain'] = $row["node_domain"];
|
|
|
|
|
$array['access_controls'][0]['access_control_nodes'][$y]['node_description'] = $row["node_description"];
|
|
|
|
|
if (isset($row["checked"])) {
|
|
|
|
|
$array['access_controls'][0]['access_control_nodes'][$y]['checked'] = $row["checked"];
|
|
|
|
|
}
|
|
|
|
|
$y++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-07-02 01:30:03 +02:00
|
|
|
}
|
|
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//save the data
|
|
|
|
|
$database = new database;
|
|
|
|
|
$database->app_name = 'access controls';
|
|
|
|
|
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
|
|
|
|
|
$database->save($array);
|
|
|
|
|
|
|
|
|
|
//redirect the user
|
|
|
|
|
if (isset($action)) {
|
|
|
|
|
if ($action == "add") {
|
|
|
|
|
$_SESSION["message"] = $text['message-add'];
|
|
|
|
|
}
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
$_SESSION["message"] = $text['message-update'];
|
|
|
|
|
}
|
|
|
|
|
//header('Location: access_controls.php');
|
|
|
|
|
header('Location: access_control_edit.php?id='.urlencode($access_control_uuid));
|
|
|
|
|
return;
|
2019-07-02 01:30:03 +02:00
|
|
|
}
|
2020-07-23 21:31:43 +02:00
|
|
|
}
|
2015-08-13 07:09:07 +02:00
|
|
|
|
|
|
|
|
//pre-populate the form
|
2020-07-23 21:31:43 +02:00
|
|
|
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
|
2015-08-13 07:09:07 +02:00
|
|
|
$sql = "select * from v_access_controls ";
|
2019-07-02 01:30:03 +02:00
|
|
|
$sql .= "where access_control_uuid = :access_control_uuid ";
|
|
|
|
|
$parameters['access_control_uuid'] = $access_control_uuid;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
2020-07-23 21:31:43 +02:00
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
2015-08-13 07:09:07 +02:00
|
|
|
$access_control_name = $row["access_control_name"];
|
|
|
|
|
$access_control_default = $row["access_control_default"];
|
2020-07-23 21:31:43 +02:00
|
|
|
$access_control_nodes = $row["access_control_nodes"];
|
2015-08-13 07:09:07 +02:00
|
|
|
$access_control_description = $row["access_control_description"];
|
|
|
|
|
}
|
2020-07-23 21:31:43 +02:00
|
|
|
unset($sql, $parameters, $row);
|
2015-08-13 07:09:07 +02:00
|
|
|
}
|
|
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
//get the child data
|
|
|
|
|
if (is_uuid($access_control_uuid)) {
|
|
|
|
|
$sql = "select * from v_access_control_nodes ";
|
|
|
|
|
$sql .= "where access_control_uuid = :access_control_uuid ";
|
|
|
|
|
$sql .= "order by node_cidr asc";
|
|
|
|
|
$parameters['access_control_uuid'] = $access_control_uuid;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$access_control_nodes = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset ($sql, $parameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add the $access_control_node_uuid
|
|
|
|
|
if (!is_uuid($access_control_node_uuid)) {
|
|
|
|
|
$access_control_node_uuid = uuid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add an empty row
|
|
|
|
|
$x = is_array($access_control_nodes) ? count($access_control_nodes) : 0;
|
|
|
|
|
$access_control_nodes[$x]['access_control_uuid'] = $access_control_uuid;
|
|
|
|
|
$access_control_nodes[$x]['access_control_node_uuid'] = uuid();
|
|
|
|
|
$access_control_nodes[$x]['node_type'] = '';
|
|
|
|
|
$access_control_nodes[$x]['node_cidr'] = '';
|
|
|
|
|
$access_control_nodes[$x]['node_domain'] = '';
|
|
|
|
|
$access_control_nodes[$x]['node_description'] = '';
|
|
|
|
|
|
2019-09-18 05:32:33 +02:00
|
|
|
//create token
|
|
|
|
|
$object = new token;
|
|
|
|
|
$token = $object->create($_SERVER['PHP_SELF']);
|
|
|
|
|
|
2015-08-13 07:09:07 +02:00
|
|
|
//show the header
|
2020-01-06 20:11:08 +01:00
|
|
|
$document['title'] = $text['title-access_control'];
|
2015-08-13 07:09:07 +02:00
|
|
|
require_once "resources/header.php";
|
|
|
|
|
|
|
|
|
|
//show the content
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<form name='frm' id='frm' method='post' action=''>\n";
|
|
|
|
|
echo "<input class='formfld' type='hidden' name='access_control_uuid' value='".escape($access_control_uuid)."'>\n";
|
2020-02-07 19:13:34 +01:00
|
|
|
|
|
|
|
|
echo "<div class='action_bar' id='action_bar'>\n";
|
|
|
|
|
echo " <div class='heading'><b>".$text['title-access_control']."</b></div>\n";
|
|
|
|
|
echo " <div class='actions'>\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo " <button type='button' id='btn_back' alt='".$text['button-back']."' title='Back' class='btn btn-default' onclick=\"location.href='access_controls.php'\">\n";
|
|
|
|
|
echo " <span class='".$_SESSION['theme']['button_icon_back']['text']." $button_icon_class' style='$button_icon_style'></span>\n";
|
|
|
|
|
echo " <span class='$button_label_class' style='$button_label_style'>".$text['button-back']."</span>\n";
|
|
|
|
|
echo " </button>\n";
|
|
|
|
|
if ($action == 'update') {
|
|
|
|
|
if (permission_exists('access_control_node_add')) {
|
|
|
|
|
echo " <button type='submit' id='btn_copy' alt='".$text['button-copy']."' title='Copy' name='action' value='copy' style='display: none;' onclick=\"modal_open('modal-copy','btn_copy'); return false;\" class='btn btn-default'>\n";
|
|
|
|
|
echo " <span class='".$_SESSION['theme']['button_icon_copy']['text']." $button_icon_class' style='$button_icon_style'></span>\n";
|
|
|
|
|
echo " <span class='$button_label_class' style='$button_label_style'>".$text['button-copy']."</span>\n";
|
|
|
|
|
echo " </button>\n";
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('access_control_node_delete')) {
|
|
|
|
|
echo " <button type='submit' id='btn_delete' alt='".$text['button-delete']."' title='Delete' name='action' value='delete' style='display: none;' onclick=\"modal_open('modal-delete','btn_delete'); return false;\" class='btn btn-default'>\n";
|
|
|
|
|
echo " <span class='".$_SESSION['theme']['button_icon_delete']['text']." $button_icon_class' style='$button_icon_style'></span>\n";
|
|
|
|
|
echo " <span class='$button_label_class' style='$button_label_style'>".$text['button-delete']."</span>\n";
|
|
|
|
|
echo " </button>\n";
|
|
|
|
|
}
|
2019-10-22 01:03:59 +02:00
|
|
|
}
|
2020-07-23 21:31:43 +02:00
|
|
|
echo " <button type='submit' id='btn_save' alt='".$text['button-save']."' title='Save' name='action' value='save' onclick='' class='btn btn-default'>\n";
|
|
|
|
|
echo " <span class='".$_SESSION['theme']['button_icon_save']['text']." $button_icon_class' style='$button_icon_style'></span>\n";
|
|
|
|
|
echo " <span class='$button_label_class' style='$button_label_style'>".$text['button-save']."</span>\n";
|
|
|
|
|
echo " </button>\n";
|
|
|
|
|
echo " <div style='clear: both;'><br /></div>\n";
|
2020-02-07 19:13:34 +01:00
|
|
|
echo " </div>\n";
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
echo " <div style='clear: both;'>".$text['description-access_controls']."</div>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
|
|
|
|
|
if ($action == 'update') {
|
|
|
|
|
if (permission_exists('access_control_add')) {
|
|
|
|
|
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('access_control_delete')) {
|
|
|
|
|
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
|
|
|
|
|
}
|
2020-03-26 02:26:34 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo " ".$text['label-access_control_name']."\n";
|
|
|
|
|
echo "</td>\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='access_control_name' maxlength='255' value='".escape($access_control_name)."'>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-access_control_name']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo " ".$text['label-access_control_default']."\n";
|
|
|
|
|
echo "</td>\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='access_control_default'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($access_control_default == "allow") {
|
|
|
|
|
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='allow'>".$text['label-allow']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($access_control_default == "deny") {
|
|
|
|
|
echo " <option value='deny' selected='selected'>".$text['label-deny']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='deny'>".$text['label-deny']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-access_control_default']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-access_control_nodes']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <table>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <th class='vtablereq'>".$text['label-node_type']."</th>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-node_cidr']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-node_domain']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-node_description']."</td>\n";
|
|
|
|
|
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) > 1 && permission_exists('access_control_node_delete')) {
|
|
|
|
|
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_details', 'delete_toggle_details');\" onmouseout=\"swap_display('delete_label_details', 'delete_toggle_details');\">\n";
|
|
|
|
|
echo " <span id='delete_label_details'>".$text['label-action']."</span>\n";
|
|
|
|
|
echo " <span id='delete_toggle_details'><input type='checkbox' id='checkbox_all_details' name='checkbox_all' onclick=\"edit_all_toggle('details'); checkbox_on_change(this);\"></span>\n";
|
|
|
|
|
echo " </td>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
}
|
2020-07-23 21:31:43 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
$x = 0;
|
|
|
|
|
foreach($access_control_nodes as $row) {
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <input type='hidden' name='access_control_nodes[$x][access_control_uuid]' value=\"".escape($row["access_control_uuid"])."\">\n";
|
|
|
|
|
echo " <input type='hidden' name='access_control_nodes[$x][access_control_node_uuid]' value=\"".escape($row["access_control_node_uuid"])."\">\n";
|
|
|
|
|
echo " <td class='formfld'>\n";
|
|
|
|
|
echo " <select class='formfld' name='access_control_nodes[$x][node_type]'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($row['node_type'] == "allow") {
|
|
|
|
|
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='allow'>".$text['label-allow']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($row['node_type'] == "deny") {
|
|
|
|
|
echo " <option value='deny' selected='selected'>".$text['label-deny']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='deny'>".$text['label-deny']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='formfld'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_cidr]' maxlength='255' value=\"".escape($row["node_cidr"])."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='formfld'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_domain]' maxlength='255' value=\"".escape($row["node_domain"])."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='formfld'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_description]' maxlength='255' value=\"".escape($row["node_description"])."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) > 1 && permission_exists('access_control_node_delete')) {
|
|
|
|
|
if (is_uuid($row['access_control_node_uuid'])) {
|
|
|
|
|
echo " <td class='vtable' style='text-align: center; padding-bottom: 3px;'>\n";
|
|
|
|
|
echo " <input type='checkbox' name='access_control_nodes[".$x."][checked]' value='true' class='chk_delete checkbox_details' onclick=\"checkbox_on_change(this);\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <td></td>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
$x++;
|
2015-08-13 07:09:07 +02:00
|
|
|
}
|
2020-07-23 21:31:43 +02:00
|
|
|
echo " </table>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo "<br />\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo $text['description-node_description']."\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2015-08-14 02:50:00 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo " ".$text['label-access_control_description']."\n";
|
|
|
|
|
echo "</td>\n";
|
2020-07-23 21:31:43 +02:00
|
|
|
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='access_control_description' maxlength='255' value='".escape($access_control_description)."'>\n";
|
2015-08-13 07:09:07 +02:00
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-access_control_description']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2020-02-07 19:13:34 +01:00
|
|
|
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />";
|
|
|
|
|
|
|
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
|
|
|
|
2015-08-13 07:09:07 +02:00
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
//include the footer
|
|
|
|
|
require_once "resources/footer.php";
|
2018-06-30 02:28:09 +02:00
|
|
|
|
2019-10-22 01:03:59 +02:00
|
|
|
?>
|