Add a the beginning of a gui for ACL.

This commit is contained in:
Mark Crane
2015-01-22 11:51:26 +00:00
parent 393fcc3b02
commit d92a661fa1
10 changed files with 1423 additions and 0 deletions

70
app/acl/acl_delete.php Normal file
View File

@@ -0,0 +1,70 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('acl_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get the id
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
}
//delete the record
if (strlen($id) > 0) {
//delete the node
$sql = "delete from v_acl_nodes ";
$sql .= "where acl_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
//delete acl
$sql = "delete from v_acl ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and acl_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
//redirect the user
$_SESSION['message'] = $text['message-delete'];
header('Location: acls.php');
?>

233
app/acl/acl_edit.php Normal file
View File

@@ -0,0 +1,233 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('acl_add') || permission_exists('acl_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$acl_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
$acl_name = check_str($_POST["acl_name"]);
$acl_type = check_str($_POST["acl_type"]);
$acl_description = check_str($_POST["acl_description"]);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
$acl_uuid = check_str($_POST["acl_uuid"]);
}
//check for all required data
$msg = '';
if (strlen($acl_name) == 0) { $msg .= $text['message-required']." ".$text['label-acl_name']."<br>\n"; }
if (strlen($acl_type) == 0) { $msg .= $text['message-required']." ".$text['label-acl_type']."<br>\n"; }
if (strlen($acl_description) == 0) { $msg .= $text['message-required']." ".$text['label-acl_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;
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add" && permission_exists('acl_add')) {
$sql = "insert into v_acl ";
$sql .= "(";
$sql .= "domain_uuid, ";
$sql .= "acl_uuid, ";
$sql .= "acl_name, ";
$sql .= "acl_type, ";
$sql .= "acl_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'".uuid()."', ";
$sql .= "'$acl_name', ";
$sql .= "'$acl_type', ";
$sql .= "'$acl_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION['message'] = $text['message-add'];
header('Location: acls.php');
return;
} //if ($action == "add")
if ($action == "update" && permission_exists('acl_edit')) {
$sql = "update v_acl set ";
$sql .= "acl_name = '$acl_name', ";
$sql .= "acl_type = '$acl_type', ";
$sql .= "acl_description = '$acl_description' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and acl_uuid = '$acl_uuid'";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION['message'] = $text['message-update'];
header('Location: acls.php');
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
$acl_uuid = check_str($_GET["id"]);
$sql = "select * from v_acl ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and acl_uuid = '$acl_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$acl_name = $row["acl_name"];
$acl_type = $row["acl_type"];
$acl_description = $row["acl_description"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//show the header
require_once "resources/header.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['title-acl']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='acls.php'\" value='".$text['button-back']."'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-acl_name']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='acl_name' maxlength='255' value=\"$acl_name\">\n";
echo "<br />\n";
echo $text['description-acl_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-acl_type']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='acl_type'>\n";
echo " <option value=''></option>\n";
if ($acl_type == "allow") {
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
}
else {
echo " <option value='allow'>".$text['label-allow']."</option>\n";
}
if ($acl_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 "<br />\n";
echo $text['description-acl_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-acl_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='acl_description' maxlength='255' value=\"$acl_description\">\n";
echo "<br />\n";
echo $text['description-acl_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='acl_uuid' value='$acl_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//include the footer
require_once "resources/footer.php";
?>

View File

@@ -0,0 +1,64 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('acl_node_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get the id
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
}
//delete the record
if (strlen($id) > 0) {
$sql = "delete from v_acl_nodes ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and acl_node_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
//redirect the user
$_SESSION['message'] = $text['message-delete'];
header('Location: acl_nodes.php');
?>

233
app/acl/acl_node_edit.php Normal file
View File

@@ -0,0 +1,233 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('acl_node_add') || permission_exists('acl_node_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$acl_node_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST)>0) {
$node_type = check_str($_POST["node_type"]);
$nod_cidr = check_str($_POST["nod_cidr"]);
$nod_description = check_str($_POST["nod_description"]);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") {
$acl_node_uuid = check_str($_POST["acl_node_uuid"]);
}
//check for all required data
if (strlen($node_type) == 0) { $msg .= $text['message-required']." ".$text['label-node_type']."<br>\n"; }
if (strlen($nod_cidr) == 0) { $msg .= $text['message-required']." ".$text['label-nod_cidr']."<br>\n"; }
//if (strlen($nod_description) == 0) { $msg .= $text['message-required']." ".$text['label-nod_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;
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add" && permission_exists('acl_node_add')) {
$sql = "insert into v_acl_nodes ";
$sql .= "(";
$sql .= "domain_uuid, ";
$sql .= "acl_node_uuid, ";
$sql .= "node_type, ";
$sql .= "nod_cidr, ";
$sql .= "nod_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'".uuid()."', ";
$sql .= "'$node_type', ";
$sql .= "'$nod_cidr', ";
$sql .= "'$nod_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION['message'] = $text['message-add'];
header('Location: acl_nodes.php');
return;
} //if ($action == "add")
if ($action == "update" && permission_exists('acl_node_edit')) {
$sql = "update v_acl_nodes set ";
$sql .= "node_type = '$node_type', ";
$sql .= "nod_cidr = '$nod_cidr', ";
$sql .= "nod_description = '$nod_description' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and acl_node_uuid = '$acl_node_uuid'";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION['message'] = $text['message-update'];
header('Location: acl_nodes.php');
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$acl_node_uuid = check_str($_GET["id"]);
$sql = "select * from v_acl_nodes ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and acl_node_uuid = '$acl_node_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$node_type = $row["node_type"];
$nod_cidr = $row["nod_cidr"];
$nod_description = $row["nod_description"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//show the header
require_once "resources/header.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['title-acl_node']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='acl_nodes.php'\" value='".$text['button-back']."'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-node_type']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='node_type'>\n";
echo " <option value=''></option>\n";
if ($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 ($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 "<br />\n";
echo $text['description-node_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-nod_cidr']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='nod_cidr' maxlength='255' value=\"$nod_cidr\">\n";
echo "<br />\n";
echo $text['description-nod_cidr']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-nod_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='nod_description' maxlength='255' value=\"$nod_description\">\n";
echo "<br />\n";
echo $text['description-nod_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='acl_node_uuid' value='$acl_node_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//include the footer
require_once "resources/footer.php";
?>

174
app/acl/acl_nodes.php Normal file
View File

@@ -0,0 +1,174 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('acl_node_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//additional includes
require_once "resources/header.php";
require_once "resources/paging.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br />";
echo "<table width='100%' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-acl_nodes']."</b></td>\n";
echo " <td width='50%' align='right'>&nbsp;</td>\n";
echo " </tr>\n";
echo "</table>\n";
//prepare to page the results
$sql = "select count(*) as num_rows from v_acl_nodes ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] > 0) {
$num_rows = $row['num_rows'];
}
else {
$num_rows = '0';
}
}
//prepare to page the results
$rows_per_page = 10;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_acl_nodes ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$sql .= "limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('node_type', $text['label-node_type'], $order_by, $order);
echo th_order_by('nod_cidr', $text['label-nod_cidr'], $order_by, $order);
echo th_order_by('nod_description', $text['label-nod_description'], $order_by, $order);
echo "<td class='list_control_icons'>";
if (permission_exists('acl_node_add')) {
echo "<a href='acl_node_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
else {
echo "&nbsp;\n";
}
echo "</td>\n";
echo "<tr>\n";
if ($result_count > 0) {
foreach($result as $row) {
if (permission_exists('acl_node_edit')) {
$tr_link = "href='acl_node_edit.php?id=".$row['acl_node_uuid']."'";
}
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['node_type']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['nod_cidr']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['nod_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('acl_node_edit')) {
echo "<a href='acl_node_edit.php?id=".$row['acl_node_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (permission_exists('acl_node_delete')) {
echo "<a href='acl_node_delete.php?id=".$row['acl_node_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='4' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('acl_node_add')) {
echo "<a href='acl_node_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
else {
echo "&nbsp;";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br /><br />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br /><br />";
//include the footer
require_once "resources/footer.php";
?>

179
app/acl/acls.php Normal file
View File

@@ -0,0 +1,179 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('acl_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//additional includes
require_once "resources/header.php";
require_once "resources/paging.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br />";
echo "<table width='100%' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-acls']."</b></td>\n";
echo " <td width='50%' align='right'>&nbsp;</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " ".$text['description-acl']."<br /><br />\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
//prepare to page the results
$sql = "select count(*) as num_rows from v_acl ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] > 0) {
$num_rows = $row['num_rows'];
}
else {
$num_rows = '0';
}
}
//prepare to page the results
$rows_per_page = 10;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_acl ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$sql .= "limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('acl_name', $text['label-acl_name'], $order_by, $order);
echo th_order_by('acl_type', $text['label-acl_type'], $order_by, $order);
echo th_order_by('acl_description', $text['label-acl_description'], $order_by, $order);
echo "<td class='list_control_icons'>";
if (permission_exists('acl_add')) {
echo "<a href='acl_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
else {
echo "&nbsp;\n";
}
echo "</td>\n";
echo "<tr>\n";
if ($result_count > 0) {
foreach($result as $row) {
if (permission_exists('acl_edit')) {
$tr_link = "href='acl_edit.php?id=".$row['acl_uuid']."'";
}
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['acl_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['acl_type']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['acl_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('acl_edit')) {
echo "<a href='acl_edit.php?id=".$row['acl_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (permission_exists('acl_delete')) {
echo "<a href='acl_delete.php?id=".$row['acl_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='4' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('acl_add')) {
echo "<a href='acl_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
else {
echo "&nbsp;";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br /><br />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br /><br />";
//include the footer
require_once "resources/footer.php";
?>

View File

@@ -0,0 +1,114 @@
<?php
//Access Control List
$text['title-acl']['en-us'] = 'Access Control List';
$text['title-acl']['es-cl'] = '';
$text['title-acl']['pt-pt'] = '';
$text['title-acl']['fr-fr'] = '';
$text['title-acl']['en-us'] = 'Acl';
$text['title-acl']['es-cl'] = '';
$text['title-acl']['pt-pt'] = '';
$text['title-acl']['fr-fr'] = '';
$text['description-acl']['en-us'] = 'Access control list can allow or deny ranges of IP addresses.';
$text['description-acl']['es-cl'] = '';
$text['description-acl']['pt-pt'] = '';
$text['description-acl']['fr-fr'] = '';
$text['label-acl_name']['en-us'] = 'Name';
$text['label-acl_name']['es-cl'] = '';
$text['label-acl_name']['pt-pt'] = '';
$text['label-acl_name']['fr-fr'] = '';
$text['description-acl_name']['en-us'] = 'Enter the name.';
$text['description-acl_name']['es-cl'] = '';
$text['description-acl_name']['pt-pt'] = '';
$text['description-acl_name']['fr-fr'] = '';
$text['label-acl_type']['en-us'] = 'Type';
$text['label-acl_type']['es-cl'] = '';
$text['label-acl_type']['pt-pt'] = '';
$text['label-acl_type']['fr-fr'] = '';
$text['description-acl_type']['en-us'] = 'Select the type.';
$text['description-acl_type']['es-cl'] = '';
$text['description-acl_type']['pt-pt'] = '';
$text['description-acl_type']['fr-fr'] = '';
$text['label-acl_description']['en-us'] = 'Description';
$text['label-acl_description']['es-cl'] = '';
$text['label-acl_description']['pt-pt'] = '';
$text['label-acl_description']['fr-fr'] = '';
$text['description-acl_description']['en-us'] = 'Enter the description';
$text['description-acl_description']['es-cl'] = '';
$text['description-acl_description']['pt-pt'] = '';
$text['description-acl_description']['fr-fr'] = '';
$text['label-true']['en-us'] = 'true';
$text['label-true']['es-cl'] = '';
$text['label-true']['pt-pt'] = '';
$text['label-true']['fr-fr'] = '';
$text['label-false']['en-us'] = 'false';
$text['label-false']['es-cl'] = 'falso';
$text['label-false']['pt-pt'] = 'falso';
$text['label-false']['fr-fr'] = 'falso';
$text['button-add']['en-us'] = 'Add';
$text['button-add']['es-cl'] = '';
$text['button-add']['pt-pt'] = '';
$text['button-add']['fr-fr'] = '';
$text['button-edit']['en-us'] = 'Edit';
$text['button-edit']['es-cl'] = '';
$text['button-edit']['pt-pt'] = '';
$text['button-edit']['fr-fr'] = '';
$text['button-delete']['en-us'] = 'Delete';
$text['button-delete']['es-cl'] = '';
$text['button-delete']['pt-pt'] = '';
$text['button-delete']['fr-fr'] = '';
$text['button-save']['en-us'] = 'Save';
$text['button-save']['es-cl'] = '';
$text['button-save']['pt-pt'] = 'Guardar';
$text['button-save']['fr-fr'] = '';
$text['button-view']['en-us'] = 'View';
$text['button-view']['es-cl'] = '';
$text['button-view']['pt-pt'] = '';
$text['button-view']['fr-fr'] = '';
$text['button-back']['en-us'] = 'Back';
$text['button-back']['es-cl'] = '';
$text['button-back']['pt-pt'] = 'Voltar';
$text['button-back']['fr-fr'] = '';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['confirm-delete']['es-cl'] = '';
$text['confirm-delete']['pt-pt'] = '';
$text['confirm-delete']['fr-fr'] = '';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-add']['es-cl'] = '';
$text['message-add']['pt-pt'] = '';
$text['message-add']['fr-fr'] = '';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-update']['es-cl'] = '';
$text['message-update']['pt-pt'] = '';
$text['message-update']['fr-fr'] = '';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-delete']['es-cl'] = '';
$text['message-delete']['pt-pt'] = '';
$text['message-delete']['fr-fr'] = '';
$text['message-required']['en-us'] = 'Please provide: ';
$text['message-required']['es-cl'] = '';
$text['message-required']['pt-pt'] = '';
$text['message-required']['fr-fr'] = '';
?>

121
app/acl/app_config.php Normal file
View File

@@ -0,0 +1,121 @@
<?php
//application details
$apps[$x]['name'] = 'Access Control List';
$apps[$x]['uuid'] = 'd8b0a50b-abf3-49db-b396-b1af8a700c88';
$apps[$x]['category'] = '';
$apps[$x]['subcategory'] = '';
$apps[$x]['version'] = '';
$apps[$x]['license'] = 'Mozilla Public License 1.1';
$apps[$x]['url'] = 'http://www.fusionpbx.com';
$apps[$x]['description']['en-us'] = '';
//menu details
$apps[$x]['menu'][0]['title']['en-us'] = 'Access Control List';
$apps[$x]['menu'][0]['uuid'] = '0044c532-07ca-477f-aa2d-920ee58e100b';
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
$apps[$x]['menu'][0]['category'] = 'internal';
$apps[$x]['menu'][0]['path'] = '/app/acl/acl.php';
//$apps[$x]['menu'][0]['groups'][] = 'user';
//$apps[$x]['menu'][0]['groups'][] = 'admin';
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//permission details
$y = 0;
$apps[$x]['permissions'][$y]['name'] = 'acl_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_node_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_node_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_node_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'acl_node_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
//schema details
$y = 0; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_acl';
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'acl_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'acl_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the name.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'acl_type';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the type.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'acl_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description';
$z++;
$y = 1; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_acl_nodes';
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'acl_node_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'node_type';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the type.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'nod_cidr';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the ip range.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'nod_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
$z++;
?>

185
app/acl/app_languages.php Normal file
View File

@@ -0,0 +1,185 @@
<?php
//Access Control List
$text['title-acl']['en-us'] = 'Access Control List';
$text['title-acl']['es-cl'] = '';
$text['title-acl']['pt-pt'] = '';
$text['title-acl']['fr-fr'] = '';
$text['title-acl']['en-us'] = 'Acl';
$text['title-acl']['es-cl'] = '';
$text['title-acl']['pt-pt'] = '';
$text['title-acl']['fr-fr'] = '';
$text['description-acl']['en-us'] = 'Access control list can allow or deny ranges of IP addresses.';
$text['description-acl']['es-cl'] = '';
$text['description-acl']['pt-pt'] = '';
$text['description-acl']['fr-fr'] = '';
$text['label-acl_name']['en-us'] = 'Name';
$text['label-acl_name']['es-cl'] = '';
$text['label-acl_name']['pt-pt'] = '';
$text['label-acl_name']['fr-fr'] = '';
$text['description-acl_name']['en-us'] = 'Enter the name.';
$text['description-acl_name']['es-cl'] = '';
$text['description-acl_name']['pt-pt'] = '';
$text['description-acl_name']['fr-fr'] = '';
$text['label-acl_type']['en-us'] = 'Type';
$text['label-acl_type']['es-cl'] = '';
$text['label-acl_type']['pt-pt'] = '';
$text['label-acl_type']['fr-fr'] = '';
$text['description-acl_type']['en-us'] = 'Select the type.';
$text['description-acl_type']['es-cl'] = '';
$text['description-acl_type']['pt-pt'] = '';
$text['description-acl_type']['fr-fr'] = '';
$text['label-acl_description']['en-us'] = 'Description';
$text['label-acl_description']['es-cl'] = '';
$text['label-acl_description']['pt-pt'] = '';
$text['label-acl_description']['fr-fr'] = '';
$text['description-acl_description']['en-us'] = 'Enter the description';
$text['description-acl_description']['es-cl'] = '';
$text['description-acl_description']['pt-pt'] = '';
$text['description-acl_description']['fr-fr'] = '';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['confirm-delete']['es-cl'] = '';
$text['confirm-delete']['pt-pt'] = '';
$text['confirm-delete']['fr-fr'] = '';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-add']['es-cl'] = '';
$text['message-add']['pt-pt'] = '';
$text['message-add']['fr-fr'] = '';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-update']['es-cl'] = '';
$text['message-update']['pt-pt'] = '';
$text['message-update']['fr-fr'] = '';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-delete']['es-cl'] = '';
$text['message-delete']['pt-pt'] = '';
$text['message-delete']['fr-fr'] = '';
$text['message-required']['en-us'] = 'Please provide: ';
$text['message-required']['es-cl'] = '';
$text['message-required']['pt-pt'] = '';
$text['message-required']['fr-fr'] = '';
//Nodes
$text['title-acl_nodes']['en-us'] = 'Nodes';
$text['title-acl_nodes']['es-cl'] = '';
$text['title-acl_nodes']['pt-pt'] = '';
$text['title-acl_nodes']['fr-fr'] = '';
$text['title-acl_node']['en-us'] = 'Node';
$text['title-acl_node']['es-cl'] = '';
$text['title-acl_node']['pt-pt'] = '';
$text['title-acl_node']['fr-fr'] = '';
$text['description-acl_node']['en-us'] = '';
$text['description-acl_node']['es-cl'] = '';
$text['description-acl_node']['pt-pt'] = '';
$text['description-acl_node']['fr-fr'] = '';
$text['label-node_type']['en-us'] = 'Type';
$text['label-node_type']['es-cl'] = '';
$text['label-node_type']['pt-pt'] = '';
$text['label-node_type']['fr-fr'] = '';
$text['description-node_type']['en-us'] = 'Select the type.';
$text['description-node_type']['es-cl'] = '';
$text['description-node_type']['pt-pt'] = '';
$text['description-node_type']['fr-fr'] = '';
$text['label-nod_cidr']['en-us'] = 'CIDR';
$text['label-nod_cidr']['es-cl'] = '';
$text['label-nod_cidr']['pt-pt'] = '';
$text['label-nod_cidr']['fr-fr'] = '';
$text['description-nod_cidr']['en-us'] = 'Enter the ip range.';
$text['description-nod_cidr']['es-cl'] = '';
$text['description-nod_cidr']['pt-pt'] = '';
$text['description-nod_cidr']['fr-fr'] = '';
$text['label-nod_description']['en-us'] = 'Description';
$text['label-nod_description']['es-cl'] = '';
$text['label-nod_description']['pt-pt'] = '';
$text['label-nod_description']['fr-fr'] = '';
$text['description-nod_description']['en-us'] = 'Enter the description.';
$text['description-nod_description']['es-cl'] = '';
$text['description-nod_description']['pt-pt'] = '';
$text['description-nod_description']['fr-fr'] = '';
$text['label-true']['en-us'] = 'true';
$text['label-true']['es-cl'] = '';
$text['label-true']['pt-pt'] = '';
$text['label-true']['fr-fr'] = '';
$text['label-false']['en-us'] = 'false';
$text['label-false']['es-cl'] = 'falso';
$text['label-false']['pt-pt'] = 'falso';
$text['label-false']['fr-fr'] = 'falso';
$text['button-add']['en-us'] = 'Add';
$text['button-add']['es-cl'] = '';
$text['button-add']['pt-pt'] = '';
$text['button-add']['fr-fr'] = '';
$text['button-edit']['en-us'] = 'Edit';
$text['button-edit']['es-cl'] = '';
$text['button-edit']['pt-pt'] = '';
$text['button-edit']['fr-fr'] = '';
$text['button-delete']['en-us'] = 'Delete';
$text['button-delete']['es-cl'] = '';
$text['button-delete']['pt-pt'] = '';
$text['button-delete']['fr-fr'] = '';
$text['button-save']['en-us'] = 'Save';
$text['button-save']['es-cl'] = '';
$text['button-save']['pt-pt'] = 'Guardar';
$text['button-save']['fr-fr'] = '';
$text['button-view']['en-us'] = 'View';
$text['button-view']['es-cl'] = '';
$text['button-view']['pt-pt'] = '';
$text['button-view']['fr-fr'] = '';
$text['button-back']['en-us'] = 'Back';
$text['button-back']['es-cl'] = '';
$text['button-back']['pt-pt'] = 'Voltar';
$text['button-back']['fr-fr'] = '';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['confirm-delete']['es-cl'] = '';
$text['confirm-delete']['pt-pt'] = '';
$text['confirm-delete']['fr-fr'] = '';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-add']['es-cl'] = '';
$text['message-add']['pt-pt'] = '';
$text['message-add']['fr-fr'] = '';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-update']['es-cl'] = '';
$text['message-update']['pt-pt'] = '';
$text['message-update']['fr-fr'] = '';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-delete']['es-cl'] = '';
$text['message-delete']['pt-pt'] = '';
$text['message-delete']['fr-fr'] = '';
$text['message-required']['en-us'] = 'Please provide: ';
$text['message-required']['es-cl'] = '';
$text['message-required']['pt-pt'] = '';
$text['message-required']['fr-fr'] = '';
?>

50
app/acl/root.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
/*
FusionPBX
Version: MPL 1.1
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/
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.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2014
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
if (!defined("PATH_SEPARATOR")) {
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
}
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
// if the project directory exists then add it to the include path otherwise add the document root to the include path
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
}
else {
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
}
?>