Browse Source

Move the acl to the optional Apps directory as it isn't completed yet.

Mark Crane 10 years ago
parent
commit
28b062e672
11 changed files with 1386 additions and 0 deletions
  1. 70 0
      acl/acl_delete.php
  2. 223 0
      acl/acl_edit.php
  3. 64 0
      acl/acl_node_delete.php
  4. 223 0
      acl/acl_node_edit.php
  5. 160 0
      acl/acl_nodes.php
  6. 166 0
      acl/acls.php
  7. 114 0
      acl/app_acl_languages.php
  8. 111 0
      acl/app_config.php
  9. 195 0
      acl/app_languages.php
  10. 10 0
      acl/app_menu.php
  11. 50 0
      acl/root.php

+ 70 - 0
acl/acl_delete.php

@@ -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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+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');
+
+?>

+ 223 - 0
acl/acl_edit.php

@@ -0,0 +1,223 @@
+<?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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+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 "<form method='post' name='frm' action=''>\n";
+	echo "<table width='100%' border='0' cellpadding='0' 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 "			<br>";
+	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
+	echo "		</td>\n";
+	echo "	</tr>";
+	echo "</table>";
+	echo "<br><br>";
+	echo "</form>";
+
+//include the footer
+	require_once "resources/footer.php";
+?>

+ 64 - 0
acl/acl_node_delete.php

@@ -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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+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');
+
+
+?>

+ 223 - 0
acl/acl_node_edit.php

@@ -0,0 +1,223 @@
+<?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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+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 "<form method='post' name='frm' action=''>\n";
+	echo "<table width='100%' border='0' cellpadding='0' 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 "			<br>";
+	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
+	echo "		</td>\n";
+	echo "	</tr>";
+	echo "</table>";
+	echo "<br><br>";
+	echo "</form>";
+
+//include the footer
+	require_once "resources/footer.php";
+?>

+ 160 - 0
acl/acl_nodes.php

@@ -0,0 +1,160 @@
+<?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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+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 "<table width='100%' cellpadding='0' cellspacing='0' 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 "<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 "<br /><br />";
+
+//include the footer
+	require_once "resources/footer.php";
+?>

+ 166 - 0
acl/acls.php

@@ -0,0 +1,166 @@
+<?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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	James Rose <[email protected]>
+*/
+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";
+	$documentu['title'] = $text['title-acl'];
+	require_once "resources/paging.php";
+
+//show the content
+	echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td width='50%' align='left' nowrap='nowrap'><b>".$text['header-access_control_list']."</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 "<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 "<br /><br />";
+
+//include the footer
+	require_once "resources/footer.php";
+?>

+ 114 - 0
acl/app_acl_languages.php

@@ -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'] = '';
+
+?>

+ 111 - 0
acl/app_config.php

@@ -0,0 +1,111 @@
+<?php
+	//application details
+		$apps[$x]['name'] = 'Access Control';
+		$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'] = '';
+
+	//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++;
+?>

+ 195 - 0
acl/app_languages.php

@@ -0,0 +1,195 @@
+<?php
+
+	//Access Control List
+		$text['title-access_control_list']['en-us'] = 'Access Control List';
+		$text['title-access_control_list']['es-cl'] = '';
+		$text['title-access_control_list']['pt-pt'] = '';
+		$text['title-access_control_list']['fr-fr'] = '';
+
+		$text['title-acl']['en-us'] = 'ACL';
+		$text['title-acl']['es-cl'] = '';
+		$text['title-acl']['pt-pt'] = '';
+		$text['title-acl']['fr-fr'] = '';
+
+		$text['header-access_control_list']['en-us'] = 'Access Control List';
+		$text['header-access_control_list']['es-cl'] = '';
+		$text['header-access_control_list']['pt-pt'] = '';
+		$text['header-access_control_list']['fr-fr'] = '';
+
+		$text['header-acl']['en-us'] = 'ACL';
+		$text['header-acl']['es-cl'] = '';
+		$text['header-acl']['pt-pt'] = '';
+		$text['header-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'] = '';
+
+?>

+ 10 - 0
acl/app_menu.php

@@ -0,0 +1,10 @@
+<?php
+
+	$apps[$x]['menu'][0]['title']['en-us'] = 'Access Control';
+	$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/acls.php';
+	$apps[$x]['menu'][0]['groups'][] = 'superadmin';
+
+?>

+ 50 - 0
acl/root.php

@@ -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 <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2014
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+// 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'] );
+	}
+
+?>