initial clone

This commit is contained in:
i am da real crt yes 2022-09-05 10:18:30 +02:00
commit 5da3596a48
5066 changed files with 1421814 additions and 0 deletions

49
.htaccess Normal file
View File

@ -0,0 +1,49 @@
RewriteEngine On
#REST api
RewriteRule ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 [QSA]
# $mac or $mac.cfg/xml
RewriteRule ^.*([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
# $m:a:c or $m:a:c.cfg/xml
RewriteRule ^.*((?:[A-Fa-f0-9]{2}[:-]){5}[A-Fa-f0-9]{2})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
# kt*-$mac.xml
RewriteRule ^kt.*?-([A-Fa-f0-9]{12})\.xml$ app/provision/index.php?mac=$1 [QSA]
# cfg-$mac.xml
RewriteRule ^.*cfg([A-Fa-f0-9]{12})\.xml$ app/provision/index.php?mac=$1 [QSA]
#Snom m3
RewriteRule ^m3/settings/([A-Fa-f0-9]{12})(?:\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
#Grandstream
RewriteRule ^.*/cfg([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/?mac=$1 [QSA]
#Yealink and Polycom
RewriteRule ^.*/([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
#Polycom
RewriteRule ^provision/000000000000.cfg$ app/provision/?mac=$1&file={$mac}.cfg [QSA]
RewriteRule ^provision/features.cfg$ app/provision/?mac=$1&file=features.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-sip.cfg$ app/provision/?mac=$1&file=sip.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-phone.cfg$ app/provision/?mac=$1 [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-registration.cfg$ app/provision/?mac=$1&file={$mac}-registration.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-site.cfg$ app/provision/?mac=$1&file=site.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-web.cfg$ app/provision/?mac=$1&file=web.cfg [QSA]
RewriteRule ^provision/([A-Fa-f0-9]{12})-directory.xml$ app/provision/?mac=$1&file=directory.xml [QSA]
#Escene
RewriteRule ^.*/([0-9]{1,11})_Extern.xml$ app/provision/?ext=$1&file={$mac}_extern.xml [QSA]
RewriteRule ^.*/([0-9]{1,11})_Phonebook.xml$ app/provision/?ext=$1&file={$mac}_phonebook.xml [QSA]
#Aastra
RewriteRule ^provision/aastra.cfg$ app/provision/index.php?file=aastra.cfg [QSA]
Options -Indexes
#PHP settings
php_value upload_max_filesize 25M
php_value post_max_size 35M
php_value memory_limit 512M

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fusionbpx</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

91
app/aastra/app_config.php Normal file
View File

@ -0,0 +1,91 @@
<?php
//application details
$apps[$x]['name'] = "Aastra";
$apps[$x]['uuid'] = "c3b13bbc-3015-4c09-87e8-416749b29f66";
$apps[$x]['category'] = "Vendor";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "";
$apps[$x]['description']['en-gb'] = "";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c471163a-12fa-11e8-b642-0ed5f89f718b";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_gmt_offset";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Aastra timezone offset in minutes (e.g. 300 = GMT-5 = Eastern Standard Time)";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c47117a2-12fa-11e8-b642-0ed5f89f718b";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_time_format";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Aastra clock format";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c47119aa-12fa-11e8-b642-0ed5f89f718b";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_date_format";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Aastra date format";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b31b1423-a04c-4b4a-9c55-a0b3791642c3";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_ptime";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "20";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set Aastra ptime";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8b676397-2cf7-45de-a7ec-f3ceb7d529e3";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_silence_suppression";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable Aastra codec silence suppression (on / off)";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1455b1b0-68ec-400d-be84-1d1132aea72f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_zone_minutes";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Offset in minutes from GMT, 300 = GMT-5 = Eastern Standard Time, -120 = GMT+2 = Eastern European Time";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c90e804a-d2bb-431a-ace8-5c69e140c539";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "aastra_sip_silence_suppression";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Aastra SIP silence suppression - silence suppression: deactivated (0), activated (1); enabled on G.711 with CN(RFC3389) or G.729AB";
$y++;
?>

View File

@ -0,0 +1,458 @@
<?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) 2018 - 2022
the Initial Developer. All Rights Reserved.
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('access_control_add') || permission_exists('access_control_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$access_control_uuid = $_REQUEST["id"];
$id = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (is_array($_POST) && @sizeof($_POST) != 0) {
$access_control_name = $_POST["access_control_name"];
$access_control_default = $_POST["access_control_default"];
$access_control_nodes = $_POST["access_control_nodes"];
$access_control_description = $_POST["access_control_description"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//enforce valid data
if ($access_control_name == 'providers' || $access_control_name == 'domains') {
$access_control_default = 'deny';
}
if ($access_control_default != 'allow' && $access_control_default != 'deny') {
$access_control_default = 'deny';
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: access_controls.php');
exit;
}
//process the http post data by submitted action
if ($_POST['action'] != '' && strlen($_POST['action']) > 0) {
//prepare the array(s)
$x = 0;
foreach ($_POST['access_control_nodes'] as $row) {
if (is_uuid($row['access_control_uuid']) && $row['checked'] === 'true') {
$array['access_controls'][$x]['checked'] = $row['checked'];
$array['access_controls'][$x]['access_control_nodes'][]['access_control_node_uuid'] = $row['access_control_node_uuid'];
$x++;
}
}
//send the array to the database class
switch ($_POST['action']) {
case 'copy':
if (permission_exists('access_control_add')) {
$obj = new database;
$obj->copy($array);
}
break;
case 'delete':
if (permission_exists('access_control_delete')) {
$obj = new database;
$obj->delete($array);
}
break;
case 'toggle':
if (permission_exists('access_control_update')) {
$obj = new database;
$obj->toggle($array);
}
break;
}
//clear the cache, reloadacl and redirect the user
if (in_array($_POST['action'], array('copy', 'delete', 'toggle'))) {
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//redirect the user
header('Location: access_control_edit.php?id='.$id);
exit;
}
}
//check for all required data
$msg = '';
if (strlen($access_control_name) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_name']."<br>\n"; }
if (strlen($access_control_default) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_default']."<br>\n"; }
//if (strlen($access_control_nodes) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_nodes']."<br>\n"; }
//if (strlen($access_control_description) == 0) { $msg .= $text['message-required']." ".$text['label-access_control_description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add the access_control_uuid
if (!is_uuid($_POST["access_control_uuid"])) {
$access_control_uuid = uuid();
}
//prepare the array
$array['access_controls'][0]['access_control_uuid'] = $access_control_uuid;
$array['access_controls'][0]['access_control_name'] = $access_control_name;
$array['access_controls'][0]['access_control_default'] = $access_control_default;
$array['access_controls'][0]['access_control_description'] = $access_control_description;
$y = 0;
if (is_array($access_control_nodes)) {
foreach ($access_control_nodes as $row) {
//validate the data
if (!is_uuid($row["access_control_node_uuid"])) { continue; }
if ($row["node_type"] != 'allow' && $row["node_type"] != 'deny') { continue; }
if (isset($row["node_cidr"]) && $row["node_cidr"] != '') {
$cidr_array = explode("/", str_replace("\\", "/", $row["node_cidr"]));
if (filter_var($cidr_array[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
if (isset($cidr_array[1]) && is_numeric($cidr_array[1])) {
//valid IPv4 address and cidr notation
$node_cidr = $row["node_cidr"];
}
else {
//valid IPv4 address add the missing cidr notation
$node_cidr = $row["node_cidr"].'/32';
}
}
elseif(filter_var($cidr_array[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
//valid IPv6 address
$node_cidr = $row["node_cidr"];
}
//if the cidr is provided ignore the domain.
$row["node_domain"] = '';
}
//build the sub array
$array['access_controls'][0]['access_control_nodes'][$y]['access_control_node_uuid'] = $row["access_control_node_uuid"];
$array['access_controls'][0]['access_control_nodes'][$y]['node_type'] = $row["node_type"];
$array['access_controls'][0]['access_control_nodes'][$y]['node_cidr'] = $node_cidr;
$array['access_controls'][0]['access_control_nodes'][$y]['node_domain'] = $row["node_domain"];
$array['access_controls'][0]['access_control_nodes'][$y]['node_description'] = $row["node_description"];
$y++;
//unset values
unset($cidr_array, $node_cidr);
}
}
//save the data
if (is_array($array)) {
$database = new database;
$database->app_name = 'access controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$database->save($array);
}
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
}
//header('Location: access_controls.php');
header('Location: access_control_edit.php?id='.urlencode($access_control_uuid));
return;
}
}
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
$sql = "select * from v_access_controls ";
$sql .= "where access_control_uuid = :access_control_uuid ";
$parameters['access_control_uuid'] = $access_control_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) {
$access_control_name = $row["access_control_name"];
$access_control_default = $row["access_control_default"];
$access_control_description = $row["access_control_description"];
}
unset($sql, $parameters, $row);
}
//get the child data
if (is_uuid($access_control_uuid)) {
$sql = "select * from v_access_control_nodes ";
$sql .= "where access_control_uuid = :access_control_uuid ";
$sql .= "order by node_cidr asc";
$parameters['access_control_uuid'] = $access_control_uuid;
$database = new database;
$access_control_nodes = $database->select($sql, $parameters, 'all');
unset ($sql, $parameters);
}
//add the $access_control_node_uuid
if (!is_uuid($access_control_node_uuid)) {
$access_control_node_uuid = uuid();
}
//add an empty row
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) != 0) {
$x = count($access_control_nodes);
}
else {
$access_control_nodes = array();
$x = 0;
}
$access_control_nodes[$x]['access_control_uuid'] = $access_control_uuid;
$access_control_nodes[$x]['access_control_node_uuid'] = uuid();
$access_control_nodes[$x]['node_type'] = '';
$access_control_nodes[$x]['node_cidr'] = '';
$access_control_nodes[$x]['node_domain'] = '';
$access_control_nodes[$x]['node_description'] = '';
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
$document['title'] = $text['title-access_control'];
require_once "resources/header.php";
//show the content
echo "<form name='frm' id='frm' method='post'>\n";
echo "<input class='formfld' type='hidden' name='access_control_uuid' value='".escape($access_control_uuid)."'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-access_control']."</b></div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'access_controls.php']);
if ($action == 'update') {
if (permission_exists('access_control_node_add')) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('access_control_node_delete')) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['title_description-access_controls']."\n";
echo "<br /><br />\n";
if ($action == 'update') {
if (permission_exists('access_control_add')) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
}
if (permission_exists('access_control_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
}
if ($action == 'update') {
if (permission_exists('access_control_add')) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
}
if (permission_exists('access_control_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
}
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_name']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='access_control_name' maxlength='255' value='".escape($access_control_name)."'>\n";
echo "<br />\n";
echo $text['description-access_control_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-access_control_default']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select class='formfld' name='access_control_default'>\n";
echo " <option value=''></option>\n";
if ($access_control_default == "allow") {
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
}
else {
echo " <option value='allow'>".$text['label-allow']."</option>\n";
}
if ($access_control_default == "deny") {
echo " <option value='deny' selected='selected'>".$text['label-deny']."</option>\n";
}
else {
echo " <option value='deny'>".$text['label-deny']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-access_control_default']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_nodes']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <table>\n";
echo " <tr>\n";
echo " <th class='vtablereq'>".$text['label-node_type']."</th>\n";
echo " <td class='vtable'>".$text['label-node_cidr']."</td>\n";
echo " <td class='vtable'>".$text['label-node_domain']."</td>\n";
echo " <td class='vtable'>".$text['label-node_description']."</td>\n";
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) > 1 && permission_exists('access_control_node_delete')) {
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_details', 'delete_toggle_details');\" onmouseout=\"swap_display('delete_label_details', 'delete_toggle_details');\">\n";
echo " <span id='delete_label_details'>".$text['label-action']."</span>\n";
echo " <span id='delete_toggle_details'><input type='checkbox' id='checkbox_all_details' name='checkbox_all' onclick=\"edit_all_toggle('details'); checkbox_on_change(this);\"></span>\n";
echo " </td>\n";
}
echo " </tr>\n";
$x = 0;
foreach($access_control_nodes as $row) {
echo " <tr>\n";
echo " <input type='hidden' name='access_control_nodes[$x][access_control_uuid]' value=\"".escape($row["access_control_uuid"])."\">\n";
echo " <input type='hidden' name='access_control_nodes[$x][access_control_node_uuid]' value=\"".escape($row["access_control_node_uuid"])."\">\n";
echo " <td class='formfld'>\n";
echo " <select class='formfld' name='access_control_nodes[$x][node_type]'>\n";
echo " <option value=''></option>\n";
if ($row['node_type'] == "allow") {
echo " <option value='allow' selected='selected'>".$text['label-allow']."</option>\n";
}
else {
echo " <option value='allow'>".$text['label-allow']."</option>\n";
}
if ($row['node_type'] == "deny") {
echo " <option value='deny' selected='selected'>".$text['label-deny']."</option>\n";
}
else {
echo " <option value='deny'>".$text['label-deny']."</option>\n";
}
echo " </select>\n";
echo " </td>\n";
echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_cidr]' maxlength='255' value=\"".escape($row["node_cidr"])."\">\n";
echo " </td>\n";
echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_domain]' maxlength='255' value=\"".escape($row["node_domain"])."\">\n";
echo " </td>\n";
echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='access_control_nodes[$x][node_description]' maxlength='255' value=\"".escape($row["node_description"])."\">\n";
echo " </td>\n";
if (is_array($access_control_nodes) && @sizeof($access_control_nodes) > 1 && permission_exists('access_control_node_delete')) {
if (is_uuid($row['access_control_node_uuid'])) {
echo " <td class='vtable' style='text-align: center; padding-bottom: 3px;'>\n";
echo " <input type='checkbox' name='access_control_nodes[".$x."][checked]' value='true' class='chk_delete checkbox_details' onclick=\"checkbox_on_change(this);\">\n";
echo " </td>\n";
}
else {
echo " <td></td>\n";
}
}
echo " </tr>\n";
$x++;
}
echo " </table>\n";
echo "<br />\n";
echo $text['description-node_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-access_control_description']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='access_control_description' maxlength='255' value='".escape($access_control_description)."'>\n";
echo "<br />\n";
echo $text['description-access_control_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,249 @@
<?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) 2018 - 2020
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('access_control_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the http post data
if (is_array($_POST['access_controls'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$access_controls = $_POST['access_controls'];
}
//process the http post data by action
if ($action != '' && is_array($access_controls) && @sizeof($access_controls) != 0) {
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: access_controls.php');
exit;
}
//prepare the array
foreach($access_controls as $row) {
$array['access_controls'][$x]['checked'] = $row['checked'];
$array['access_controls'][$x]['access_control_uuid'] = $row['access_control_uuid'];
$x++;
}
//prepare the database object
$database = new database;
$database->app_name = 'access_controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
//send the array to the database class
switch ($action) {
case 'copy':
if (permission_exists('access_control_add')) {
$database->copy($array);
}
break;
case 'toggle':
if (permission_exists('access_control_edit')) {
$database->toggle($array);
}
break;
case 'delete':
if (permission_exists('access_control_delete')) {
$database->delete($array);
}
break;
}
//redirect the user
header('Location: access_controls.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get order and order by
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search
if (isset($_GET["search"])) {
$search = strtolower($_GET["search"]);
$parameters['search'] = '%'.$search.'%';
}
//get the count
$sql = "select count(access_control_uuid) ";
$sql .= "from v_access_controls ";
if (isset($_GET["search"])) {
$sql .= "where (";
$sql .= " lower(access_control_name) like :search ";
$sql .= " or lower(access_control_default) like :search ";
$sql .= " or lower(access_control_description) like :search ";
$sql .= ") ";
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//get the list
$sql = "select ";
$sql .= "access_control_uuid, ";
$sql .= "access_control_name, ";
$sql .= "access_control_default, ";
$sql .= "access_control_description ";
$sql .= "from v_access_controls ";
if (isset($_GET["search"])) {
$sql .= "where (";
$sql .= " lower(access_control_name) like :search ";
$sql .= " or lower(access_control_default) like :search ";
$sql .= " or lower(access_control_description) like :search ";
$sql .= ") ";
}
$sql .= order_by($order_by, $order, 'access_control_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$access_controls = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//additional includes
$document['title'] = $text['title-access_controls'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-access_controls']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('access_control_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','name'=>'btn_add','link'=>'access_control_edit.php']);
}
if (permission_exists('access_control_add') && $access_controls) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display:none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('access_control_delete') && $access_controls) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'access_controls.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('access_control_add') && $access_controls) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('access_control_delete') && $access_controls) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
}
echo $text['title_description-access_controls']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('access_control_add') || permission_exists('access_control_edit') || permission_exists('access_control_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($access_controls ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
echo th_order_by('access_control_name', $text['label-access_control_name'], $order_by, $order);
echo th_order_by('access_control_default', $text['label-access_control_default'], $order_by, $order);
echo " <th class='hide-sm-dn'>".$text['label-access_control_description']."</th>\n";
if (permission_exists('access_control_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($access_controls) && @sizeof($access_controls) != 0) {
$x = 0;
foreach ($access_controls as $row) {
if (permission_exists('access_control_edit')) {
$list_row_url = "access_control_edit.php?id=".urlencode($row['access_control_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('access_control_add') || permission_exists('access_control_edit') || permission_exists('access_control_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='access_controls[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"checkbox_on_change(this); if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
echo " <input type='hidden' name='access_controls[$x][access_control_uuid]' value='".escape($row['access_control_uuid'])."' />\n";
echo " </td>\n";
}
echo " <td>\n";
if (permission_exists('access_control_edit')) {
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['access_control_name'])."</a>\n";
}
else {
echo " ".escape($row['access_control_name']);
}
echo " </td>\n";
echo " <td>".escape($row['access_control_default'])."</td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['access_control_description'])."</td>\n";
if (permission_exists('access_control_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($access_controls);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,122 @@
<?php
//application details
$apps[$x]['name'] = "Access Controls";
$apps[$x]['uuid'] = "1416a250-f6e1-4edc-91a6-5c9b883638fd";
$apps[$x]['category'] = "";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Manage access control lists";
$apps[$x]['description']['en-gb'] = "Manage access control lists";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Zugriffssteuerungslisten verwalten";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Zugriffssteuerungslisten verwalten";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Gérer les listes de contrôle d'accès";
$apps[$x]['description']['fr-fr'] = "Gérer les listes de contrôle d'accès";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Beheer toegangs controle lijsten";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "access_control_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "access_control_node_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
//cache details
$apps[$x]['cache']['key'] = "configuration.acl.conf";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_access_controls";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_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'] = "access_control_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_default";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the default type.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description";
$y++;
$apps[$x]['db'][$y]['table']['name'] = "v_access_control_nodes";
$apps[$x]['db'][$y]['table']['parent'] = "v_access_controls";
$z=0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "access_control_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'] = "access_control_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_access_controls";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "access_control_uuid";
$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'] = "node_cidr";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the IP CIDR range.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "node_domain";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the domain.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "node_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
?>

View File

@ -0,0 +1,144 @@
<?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) 2016 - 2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//if the number of rows is 0 then read the acl xml into the database
if ($domains_processed == 1) {
//add the access control list to the database
$sql = "select count(*) from v_access_controls ";
$database = new database;
$num_rows = $database->select($sql, null, 'column');
if ($num_rows == 0) {
//set the directory
$xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs';
$xml_file = $xml_dir."/acl.conf.xml";
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/acl.conf';
//load the xml and save it into an array
if (file_exists($xml_file)) {
$xml_string = file_get_contents($xml_file);
}
elseif (file_exists($xml_file_alt)) {
$xml_string = file_get_contents(xml_file_alt);
}
else {
$xml_string = "<configuration name=\"acl.conf\" description=\"Network Lists\">\n";
$xml_string .= " <network-lists>\n";
$xml_string .= " <list name=\"rfc1918\" default=\"deny\">\n";
$xml_string .= " <node type=\"allow\" cidr=\"10.0.0.0/8\"/>\n";
$xml_string .= " <node type=\"allow\" cidr=\"172.16.0.0/12\"/>\n";
$xml_string .= " <node type=\"allow\" cidr=\"192.168.0.0/16\"/>\n";
$xml_string .= " </list>\n";
$xml_string .= " <list name=\"providers\" default=\"deny\">\n";
//$xml_string .= " <node type=\"allow\" domain=\"".$_SESSION['domain_name']."\"/>\n";
$xml_string .= " </list>\n";
$xml_string .= " </network-lists>\n";
$xml_string .= "</configuration>\n";
}
$xml_object = simplexml_load_string($xml_string);
$json = json_encode($xml_object);
$conf_array = json_decode($json, true);
//process the array
foreach($conf_array['network-lists']['list'] as $list) {
//get the attributes
$access_control_name = $list['@attributes']['name'];
$access_control_default = $list['@attributes']['default'];
//insert the name, description
$access_control_uuid = uuid();
$array['access_controls'][0]['access_control_uuid'] = $access_control_uuid;
$array['access_controls'][0]['access_control_name'] = $access_control_name;
$array['access_controls'][0]['access_control_default'] = $access_control_default;
$p = new permissions;
$p->add('access_control_add', 'temp');
$database = new database;
$database->app_name = 'access_controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$database->save($array, false);
unset($array);
$p->delete('access_control_add', 'temp');
//normalize the array - needed because the array is inconsistent when there is only one row vs multiple
if (strlen($list['node']['@attributes']['type']) > 0) {
$list['node'][]['@attributes'] = $list['node']['@attributes'];
unset($list['node']['@attributes']);
}
//add the nodes
foreach ($list['node'] as $row) {
//get the name and value pair
$node_type = $row['@attributes']['type'];
$node_cidr = $row['@attributes']['cidr'];
$node_domain = $row['@attributes']['domain'];
$node_description = $row['@attributes']['description'];
//replace $${domain}
if (strlen($node_domain) > 0) {
$node_domain = str_replace("\$\${domain}", $domain_name, $node_domain);
}
//add the profile settings into the database
$access_control_node_uuid = uuid();
$array['access_control_nodes'][0]['access_control_node_uuid'] = $access_control_node_uuid;
$array['access_control_nodes'][0]['access_control_uuid'] = $access_control_uuid;
$array['access_control_nodes'][0]['node_type'] = $node_type;
$array['access_control_nodes'][0]['node_cidr'] = $node_cidr;
$array['access_control_nodes'][0]['node_domain'] = $node_domain;
$array['access_control_nodes'][0]['node_description'] = $node_description;
$p = new permissions;
$p->add('access_control_node_add', 'temp');
$database = new database;
$database->app_name = 'access_controls';
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$database->save($array, false);
unset($array);
$p->delete('access_control_node_add', 'temp');
}
}
//rename the file
if (file_exists($xml_dir.'/acl.conf.xml')) {
rename($xml_dir.'/acl.conf.xml', $xml_dir.'/acl.conf');
}
}
unset($sql, $num_rows);
//remove orphaned access control nodes
$sql = "delete from v_access_control_nodes ";
$sql .= "where access_control_uuid not in ( ";
$sql .= " select access_control_uuid from v_access_controls ";
$sql .= ")";
$database = new database;
$database->execute($sql, null);
unset($sql);
}
?>

View File

@ -0,0 +1,466 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-access_controls']['en-us'] = "Access Controls";
$text['title-access_controls']['en-gb'] = "Access Controls";
$text['title-access_controls']['ar-eg'] = "عناصر التحكم في الوصول";
$text['title-access_controls']['de-at'] = " Zugriffskontrolle"; //copied from de-de
$text['title-access_controls']['de-ch'] = " Zugriffskontrolle"; //copied from de-de
$text['title-access_controls']['de-de'] = " Zugriffskontrolle";
$text['title-access_controls']['es-cl'] = "Controles de acceso";
$text['title-access_controls']['es-mx'] = "Controles de acceso"; //copied from es-cl
$text['title-access_controls']['fr-ca'] = "Contrôle d'accès"; //copied from fr-fr
$text['title-access_controls']['fr-fr'] = "Contrôle d'accès";
$text['title-access_controls']['he-il'] = "בקרת גישה";
$text['title-access_controls']['it-it'] = "Controllo Accessi";
$text['title-access_controls']['nl-nl'] = "Toegangs Controle";
$text['title-access_controls']['pl-pl'] = "Kontrola dostępu";
$text['title-access_controls']['pt-br'] = "Controles de Acesso"; //copied from pt-pt
$text['title-access_controls']['pt-pt'] = "Controles de Acesso";
$text['title-access_controls']['ro-ro'] = "Controale de acces";
$text['title-access_controls']['ru-ru'] = "Контроль доступа";
$text['title-access_controls']['sv-se'] = "Åtkomstkontroll";
$text['title-access_controls']['uk-ua'] = "контроль доступу";
$text['title-access_control_nodes']['en-us'] = "Nodes";
$text['title-access_control_nodes']['en-gb'] = "Nodes";
$text['title-access_control_nodes']['ar-eg'] = "العقد";
$text['title-access_control_nodes']['de-at'] = "Knoten"; //copied from de-de
$text['title-access_control_nodes']['de-ch'] = "Knoten"; //copied from de-de
$text['title-access_control_nodes']['de-de'] = "Knoten";
$text['title-access_control_nodes']['es-cl'] = "Nodos";
$text['title-access_control_nodes']['es-mx'] = "Nodos"; //copied from es-cl
$text['title-access_control_nodes']['fr-ca'] = " nœuds"; //copied from fr-fr
$text['title-access_control_nodes']['fr-fr'] = " nœuds";
$text['title-access_control_nodes']['he-il'] = "בלוטות";
$text['title-access_control_nodes']['it-it'] = "Nodi";
$text['title-access_control_nodes']['nl-nl'] = "Knooppunten";
$text['title-access_control_nodes']['pl-pl'] = "węzły";
$text['title-access_control_nodes']['pt-br'] = "Nodes";
$text['title-access_control_nodes']['pt-pt'] = " Nodes";
$text['title-access_control_nodes']['ro-ro'] = "Noduri";
$text['title-access_control_nodes']['ru-ru'] = "Узлы";
$text['title-access_control_nodes']['sv-se'] = "Noder";
$text['title-access_control_nodes']['uk-ua'] = "вузли";
$text['title-access_control_node']['en-us'] = "Node";
$text['title-access_control_node']['en-gb'] = "Node";
$text['title-access_control_node']['ar-eg'] = "العقدة";
$text['title-access_control_node']['de-at'] = "Netzknoten"; //copied from de-de
$text['title-access_control_node']['de-ch'] = "Netzknoten"; //copied from de-de
$text['title-access_control_node']['de-de'] = "Netzknoten";
$text['title-access_control_node']['es-cl'] = "Nodo";
$text['title-access_control_node']['es-mx'] = "Nodo"; //copied from es-cl
$text['title-access_control_node']['fr-ca'] = " noeud"; //copied from fr-fr
$text['title-access_control_node']['fr-fr'] = " noeud";
$text['title-access_control_node']['he-il'] = "צומת";
$text['title-access_control_node']['it-it'] = "Nodo";
$text['title-access_control_node']['nl-nl'] = "Knooppunt";
$text['title-access_control_node']['pl-pl'] = "węzeł";
$text['title-access_control_node']['pt-br'] = ""; //copied from pt-pt
$text['title-access_control_node']['pt-pt'] = "";
$text['title-access_control_node']['ro-ro'] = "Nod";
$text['title-access_control_node']['ru-ru'] = "Узел";
$text['title-access_control_node']['sv-se'] = "Nod";
$text['title-access_control_node']['uk-ua'] = "вузол";
$text['title-access_control']['en-us'] = "Access Control";
$text['title-access_control']['en-gb'] = "Access Control";
$text['title-access_control']['ar-eg'] = "التحكم في الوصول";
$text['title-access_control']['de-at'] = " Zugangskontrolle"; //copied from de-de
$text['title-access_control']['de-ch'] = " Zugangskontrolle"; //copied from de-de
$text['title-access_control']['de-de'] = " Zugangskontrolle";
$text['title-access_control']['es-cl'] = "Control de acceso";
$text['title-access_control']['es-mx'] = "Control de acceso"; //copied from es-cl
$text['title-access_control']['fr-ca'] = "Contrôle d'accès"; //copied from fr-fr
$text['title-access_control']['fr-fr'] = "Contrôle d'accès";
$text['title-access_control']['he-il'] = "בקרת גישה";
$text['title-access_control']['it-it'] = "Controllo Accesso";
$text['title-access_control']['nl-nl'] = "Toegangs Controle";
$text['title-access_control']['pl-pl'] = "Kontrola dostępu";
$text['title-access_control']['pt-br'] = "Controle de acesso"; //copied from pt-pt
$text['title-access_control']['pt-pt'] = "Controle de acesso";
$text['title-access_control']['ro-ro'] = "Controlul accesului";
$text['title-access_control']['ru-ru'] = "Управление доступом";
$text['title-access_control']['sv-se'] = "Åtkomstkontroll";
$text['title-access_control']['uk-ua'] = "Управління доступом";
$text['title_description-access_controls']['en-us'] = "Access control list can allow or deny ranges of IP addresses.";
$text['title_description-access_controls']['en-gb'] = "Access control list can allow or deny ranges of IP addresses.";
$text['title_description-access_controls']['ar-eg'] = "قائمة التحكم بالوصول يمكن السماح أو الرفض نطاقات العناوين.";
$text['title_description-access_controls']['de-at'] = " Die Zugriffskontrollliste kann Bereiche von IP Adressen zulassen oder ablehnen."; //copied from de-de
$text['title_description-access_controls']['de-ch'] = " Die Zugriffskontrollliste kann Bereiche von IP Adressen zulassen oder ablehnen."; //copied from de-de
$text['title_description-access_controls']['de-de'] = " Die Zugriffskontrollliste kann Bereiche von IP Adressen zulassen oder ablehnen.";
$text['title_description-access_controls']['es-cl'] = " Lista de control de acceso puede permitir o denegar los rangos de direcciones IP.";
$text['title_description-access_controls']['es-mx'] = " Lista de control de acceso puede permitir o denegar los rangos de direcciones IP."; //copied from es-cl
$text['title_description-access_controls']['fr-ca'] = " Liste de contrôle d'accès peut autoriser ou refuser des plages d'adresses IP."; //copied from fr-fr
$text['title_description-access_controls']['fr-fr'] = " Liste de contrôle d'accès peut autoriser ou refuser des plages d'adresses IP.";
$text['title_description-access_controls']['he-il'] = " רשימת בקרת גישה יכולה לאפשר או למנוע טווחים של כתובות IP.";
$text['title_description-access_controls']['it-it'] = "Le liste per il controllo di accesso permettono o negano l'accesso a range di IP.";
$text['title_description-access_controls']['nl-nl'] = "Toegang Controle lijst kan IP adres reeks toestaan of verbieden.";
$text['title_description-access_controls']['pl-pl'] = "Lista kontroli dostępu może umożliwić lub zablokować zakresy adresów IP.";
$text['title_description-access_controls']['pt-br'] = "Lista de controle de acesso pode permitir ou negar intervalos de endereços IP."; //copied from pt-pt
$text['title_description-access_controls']['pt-pt'] = "Lista de controle de acesso pode permitir ou negar intervalos de endereços IP.";
$text['title_description-access_controls']['ro-ro'] = "Lista de control al accesului poate permite sau refuza intervale de adrese IP.";
$text['title_description-access_controls']['ru-ru'] = "Контроль доступа может разрешить или запретить диапазоны IP адресов.";
$text['title_description-access_controls']['sv-se'] = "Åtkomstkontrollista kan tillåta eller neka intervall av IP-adresser.";
$text['title_description-access_controls']['uk-ua'] = "Список контролю доступу може дозволити або заборонити діапазони IP-адрес.";
$text['label-node_type']['en-us'] = "Type";
$text['label-node_type']['en-gb'] = "Type";
$text['label-node_type']['ar-eg'] = "اكتب";
$text['label-node_type']['de-at'] = "Art"; //copied from de-de
$text['label-node_type']['de-ch'] = "Art"; //copied from de-de
$text['label-node_type']['de-de'] = "Art";
$text['label-node_type']['es-cl'] = "Escribe";
$text['label-node_type']['es-mx'] = "Escribe"; //copied from es-cl
$text['label-node_type']['fr-ca'] = "Type"; //copied from fr-fr
$text['label-node_type']['fr-fr'] = "Type";
$text['label-node_type']['he-il'] = "סוג";
$text['label-node_type']['it-it'] = "Tipo";
$text['label-node_type']['nl-nl'] = "Type";
$text['label-node_type']['pl-pl'] = "typ";
$text['label-node_type']['pt-br'] = "Tipo"; //copied from pt-pt
$text['label-node_type']['pt-pt'] = "Tipo";
$text['label-node_type']['ro-ro'] = "Tip";
$text['label-node_type']['ru-ru'] = "Тип";
$text['label-node_type']['sv-se'] = "Typ";
$text['label-node_type']['uk-ua'] = "Тип";
$text['label-node_domain']['en-us'] = "Domain";
$text['label-node_domain']['en-gb'] = "Domain";
$text['label-node_domain']['ar-eg'] = "مجال";
$text['label-node_domain']['de-at'] = " Domäne"; //copied from de-de
$text['label-node_domain']['de-ch'] = " Domäne"; //copied from de-de
$text['label-node_domain']['de-de'] = " Domäne";
$text['label-node_domain']['es-cl'] = "Dominio";
$text['label-node_domain']['es-mx'] = "Dominio"; //copied from es-cl
$text['label-node_domain']['fr-ca'] = "Domaine"; //copied from fr-fr
$text['label-node_domain']['fr-fr'] = "Domaine";
$text['label-node_domain']['he-il'] = "תחום";
$text['label-node_domain']['it-it'] = "Dominio";
$text['label-node_domain']['nl-nl'] = "Domein";
$text['label-node_domain']['pl-pl'] = "domeny";
$text['label-node_domain']['pt-br'] = "Domínio"; //copied from pt-pt
$text['label-node_domain']['pt-pt'] = "Domínio";
$text['label-node_domain']['ro-ro'] = "Domeniu";
$text['label-node_domain']['ru-ru'] = "Домен";
$text['label-node_domain']['sv-se'] = "Domän";
$text['label-node_domain']['uk-ua'] = "домен";
$text['label-node_description']['en-us'] = "Description";
$text['label-node_description']['en-gb'] = "Description";
$text['label-node_description']['ar-eg'] = "وصف";
$text['label-node_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-node_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-node_description']['de-de'] = "Beschreibung";
$text['label-node_description']['es-cl'] = "Descripción";
$text['label-node_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-node_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-node_description']['fr-fr'] = "Description";
$text['label-node_description']['he-il'] = "תיאור";
$text['label-node_description']['it-it'] = "Descrizione";
$text['label-node_description']['nl-nl'] = "Beschrijving";
$text['label-node_description']['pl-pl'] = "opis";
$text['label-node_description']['pt-br'] = "Descrição"; //copied from pt-pt
$text['label-node_description']['pt-pt'] = "Descrição";
$text['label-node_description']['ro-ro'] = "Descriere";
$text['label-node_description']['ru-ru'] = "Описание";
$text['label-node_description']['sv-se'] = "Beskrivning";
$text['label-node_description']['uk-ua'] = "опис";
$text['label-node_cidr']['en-us'] = "CIDR";
$text['label-node_cidr']['en-gb'] = "CIDR";
$text['label-node_cidr']['ar-eg'] = "CIDR";
$text['label-node_cidr']['de-at'] = "CIDR"; //copied from de-de
$text['label-node_cidr']['de-ch'] = "CIDR"; //copied from de-de
$text['label-node_cidr']['de-de'] = "CIDR";
$text['label-node_cidr']['es-cl'] = "CIDR";
$text['label-node_cidr']['es-mx'] = "CIDR"; //copied from es-cl
$text['label-node_cidr']['fr-ca'] = "CIDR"; //copied from fr-fr
$text['label-node_cidr']['fr-fr'] = "CIDR";
$text['label-node_cidr']['he-il'] = "CIDR";
$text['label-node_cidr']['it-it'] = "CIDR";
$text['label-node_cidr']['nl-nl'] = "CIDR";
$text['label-node_cidr']['pl-pl'] = "CIDR";
$text['label-node_cidr']['pt-br'] = "CIDR"; //copied from pt-pt
$text['label-node_cidr']['pt-pt'] = "CIDR";
$text['label-node_cidr']['ro-ro'] = "CIDR";
$text['label-node_cidr']['ru-ru'] = "CIDR";
$text['label-node_cidr']['sv-se'] = "CIDR";
$text['label-node_cidr']['uk-ua'] = "CIDR";
$text['label-deny']['en-us'] = "deny";
$text['label-deny']['en-gb'] = "deny";
$text['label-deny']['ar-eg'] = "تنكر";
$text['label-deny']['de-at'] = " verbieten"; //copied from de-de
$text['label-deny']['de-ch'] = " verbieten"; //copied from de-de
$text['label-deny']['de-de'] = " verbieten";
$text['label-deny']['es-cl'] = "Negar";
$text['label-deny']['es-mx'] = "Negar"; //copied from es-cl
$text['label-deny']['fr-ca'] = " nier"; //copied from fr-fr
$text['label-deny']['fr-fr'] = " nier";
$text['label-deny']['he-il'] = "להכחיש";
$text['label-deny']['it-it'] = "nega";
$text['label-deny']['nl-nl'] = "verbieden";
$text['label-deny']['pl-pl'] = "odrzuć";
$text['label-deny']['pt-br'] = "negar"; //copied from pt-pt
$text['label-deny']['pt-pt'] = "negar";
$text['label-deny']['ro-ro'] = "Nega";
$text['label-deny']['ru-ru'] = "запретить";
$text['label-deny']['sv-se'] = "förneka";
$text['label-deny']['uk-ua'] = "правда";
$text['label-allow']['en-us'] = "allow";
$text['label-allow']['en-gb'] = "allow";
$text['label-allow']['ar-eg'] = "السماح";
$text['label-allow']['de-at'] = "erlauben"; //copied from de-de
$text['label-allow']['de-ch'] = "erlauben"; //copied from de-de
$text['label-allow']['de-de'] = "erlauben";
$text['label-allow']['es-cl'] = "Permitir";
$text['label-allow']['es-mx'] = "Permitir"; //copied from es-cl
$text['label-allow']['fr-ca'] = " permettre"; //copied from fr-fr
$text['label-allow']['fr-fr'] = " permettre";
$text['label-allow']['he-il'] = "לאפשר";
$text['label-allow']['it-it'] = "permetti";
$text['label-allow']['nl-nl'] = "toestaan";
$text['label-allow']['pl-pl'] = "zezwól";
$text['label-allow']['pt-br'] = "permitir"; //copied from pt-pt
$text['label-allow']['pt-pt'] = "permitir";
$text['label-allow']['ro-ro'] = "Permite";
$text['label-allow']['ru-ru'] = "разрешить";
$text['label-allow']['sv-se'] = "tillåta";
$text['label-allow']['uk-ua'] = "дозволяти";
$text['label-access_control_name']['en-us'] = "Name";
$text['label-access_control_name']['en-gb'] = "Name";
$text['label-access_control_name']['ar-eg'] = "اسم";
$text['label-access_control_name']['de-at'] = "Name"; //copied from de-de
$text['label-access_control_name']['de-ch'] = "Name"; //copied from de-de
$text['label-access_control_name']['de-de'] = "Name";
$text['label-access_control_name']['es-cl'] = "Nombre";
$text['label-access_control_name']['es-mx'] = "Nombre"; //copied from es-cl
$text['label-access_control_name']['fr-ca'] = "Nom"; //copied from fr-fr
$text['label-access_control_name']['fr-fr'] = "Nom";
$text['label-access_control_name']['he-il'] = "שם";
$text['label-access_control_name']['it-it'] = "Nome";
$text['label-access_control_name']['nl-nl'] = "Naam";
$text['label-access_control_name']['pl-pl'] = " Imię";
$text['label-access_control_name']['pt-br'] = "Nome"; //copied from pt-pt
$text['label-access_control_name']['pt-pt'] = "Nome";
$text['label-access_control_name']['ro-ro'] = "Nume";
$text['label-access_control_name']['ru-ru'] = "Имя";
$text['label-access_control_name']['sv-se'] = "namn";
$text['label-access_control_name']['uk-ua'] = "ім'я";
$text['label-access_control_default']['en-us'] = "Default";
$text['label-access_control_default']['en-gb'] = "Default";
$text['label-access_control_default']['ar-eg'] = "افتراضي";
$text['label-access_control_default']['de-at'] = "Standard"; //copied from de-de
$text['label-access_control_default']['de-ch'] = "Standard"; //copied from de-de
$text['label-access_control_default']['de-de'] = "Standard";
$text['label-access_control_default']['es-cl'] = "Defecto";
$text['label-access_control_default']['es-mx'] = "Defecto"; //copied from es-cl
$text['label-access_control_default']['fr-ca'] = "Par défaut"; //copied from fr-fr
$text['label-access_control_default']['fr-fr'] = "Par défaut";
$text['label-access_control_default']['he-il'] = " ברירת מחדל";
$text['label-access_control_default']['it-it'] = "Predefinito";
$text['label-access_control_default']['nl-nl'] = "Standaard";
$text['label-access_control_default']['pl-pl'] = "Domyślnie";
$text['label-access_control_default']['pt-br'] = "Padrão"; //copied from pt-pt
$text['label-access_control_default']['pt-pt'] = "Padrão";
$text['label-access_control_default']['ro-ro'] = "Implicit";
$text['label-access_control_default']['ru-ru'] = "По умолчанию";
$text['label-access_control_default']['sv-se'] = "Standard";
$text['label-access_control_default']['uk-ua'] = "дефолт";
$text['label-access_control_nodes']['en-us'] = "Nodes";
$text['label-access_control_nodes']['en-gb'] = "Nodes";
$text['label-access_control_nodes']['ar-eg'] = "العقد";
$text['label-access_control_nodes']['de-at'] = "Knoten"; //copied from de-de
$text['label-access_control_nodes']['de-ch'] = "Knoten"; //copied from de-de
$text['label-access_control_nodes']['de-de'] = "Knoten";
$text['label-access_control_nodes']['es-cl'] = "Nodos";
$text['label-access_control_nodes']['es-mx'] = "Nodos"; //copied from es-cl
$text['label-access_control_nodes']['fr-ca'] = " nœuds"; //copied from fr-fr
$text['label-access_control_nodes']['fr-fr'] = " nœuds";
$text['label-access_control_nodes']['he-il'] = "בלוטות";
$text['label-access_control_nodes']['it-it'] = "Nodi";
$text['label-access_control_nodes']['nl-nl'] = "Knooppunten";
$text['label-access_control_nodes']['pl-pl'] = "węzły";
$text['label-access_control_nodes']['pt-br'] = "Nodes";
$text['label-access_control_nodes']['pt-pt'] = " Nodes";
$text['label-access_control_nodes']['ro-ro'] = "Noduri";
$text['label-access_control_nodes']['ru-ru'] = "Узлы";
$text['label-access_control_nodes']['sv-se'] = "Noder";
$text['label-access_control_nodes']['uk-ua'] = "вузли";
$text['label-access_control_description']['en-us'] = "Description";
$text['label-access_control_description']['en-gb'] = "Description";
$text['label-access_control_description']['ar-eg'] = "وصف";
$text['label-access_control_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-access_control_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-access_control_description']['de-de'] = "Beschreibung";
$text['label-access_control_description']['es-cl'] = "Descripción";
$text['label-access_control_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-access_control_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-access_control_description']['fr-fr'] = "Description";
$text['label-access_control_description']['he-il'] = "תיאור";
$text['label-access_control_description']['it-it'] = "Descrizione";
$text['label-access_control_description']['nl-nl'] = "Omschrijving";
$text['label-access_control_description']['pl-pl'] = "opis";
$text['label-access_control_description']['pt-br'] = "Descrição"; //copied from pt-pt
$text['label-access_control_description']['pt-pt'] = "Descrição";
$text['label-access_control_description']['ro-ro'] = "Descriere";
$text['label-access_control_description']['ru-ru'] = "Описание";
$text['label-access_control_description']['sv-se'] = "Beskrivning";
$text['label-access_control_description']['uk-ua'] = "опис";
$text['description-node_type']['en-us'] = "Select the type.";
$text['description-node_type']['en-gb'] = "Select the type.";
$text['description-node_type']['ar-eg'] = "حدد نوع.";
$text['description-node_type']['de-at'] = " Wählen Sie den Typ."; //copied from de-de
$text['description-node_type']['de-ch'] = " Wählen Sie den Typ."; //copied from de-de
$text['description-node_type']['de-de'] = " Wählen Sie den Typ.";
$text['description-node_type']['es-cl'] = "Seleccione el tipo.";
$text['description-node_type']['es-mx'] = "Seleccione el tipo."; //copied from es-cl
$text['description-node_type']['fr-ca'] = " Sélectionnez le type"; //copied from fr-fr
$text['description-node_type']['fr-fr'] = " Sélectionnez le type";
$text['description-node_type']['he-il'] = " בחר את הסוג.";
$text['description-node_type']['it-it'] = "Seleziona il tipo.";
$text['description-node_type']['nl-nl'] = "Selecteer het type.";
$text['description-node_type']['pl-pl'] = "Wybierz rodzaj.";
$text['description-node_type']['pt-br'] = "Selecione o tipo."; //copied from pt-pt
$text['description-node_type']['pt-pt'] = "Selecione o tipo.";
$text['description-node_type']['ro-ro'] = "Selectați tipul.";
$text['description-node_type']['ru-ru'] = "Выберите тип.";
$text['description-node_type']['sv-se'] = "Välj typ.";
$text['description-node_type']['uk-ua'] = "Виберіть тип.";
$text['description-node_domain']['en-us'] = "Enter the domain name.";
$text['description-node_domain']['en-gb'] = "Enter the domain name.";
$text['description-node_domain']['ar-eg'] = "أدخل اسم المجال.";
$text['description-node_domain']['de-at'] = "Geben Sie den Domain-Namen."; //copied from de-de
$text['description-node_domain']['de-ch'] = "Geben Sie den Domain-Namen."; //copied from de-de
$text['description-node_domain']['de-de'] = "Geben Sie den Domain-Namen.";
$text['description-node_domain']['es-cl'] = "Introduzca el nombre de dominio.";
$text['description-node_domain']['es-mx'] = "Introduzca el nombre de dominio."; //copied from es-cl
$text['description-node_domain']['fr-ca'] = "Entrez le nom de domaine."; //copied from fr-fr
$text['description-node_domain']['fr-fr'] = "Entrez le nom de domaine.";
$text['description-node_domain']['he-il'] = " הזן את שם הדומיין.";
$text['description-node_domain']['it-it'] = "Inserisci il dominio.";
$text['description-node_domain']['nl-nl'] = "Voer de domeinnaam in.";
$text['description-node_domain']['pl-pl'] = " Wprowadź nazwę domeny.";
$text['description-node_domain']['pt-br'] = "Digite o nome de domínio."; //copied from pt-pt
$text['description-node_domain']['pt-pt'] = "Digite o nome de domínio.";
$text['description-node_domain']['ro-ro'] = "Introduceți numele de domeniu.";
$text['description-node_domain']['ru-ru'] = "Введите имя домена.";
$text['description-node_domain']['sv-se'] = "Ange domännamnet.";
$text['description-node_domain']['uk-ua'] = "Введіть ім'я домену.";
$text['description-node_description']['en-us'] = "Enter the description.";
$text['description-node_description']['en-gb'] = "Enter the description.";
$text['description-node_description']['ar-eg'] = "أدخل الوصف.";
$text['description-node_description']['de-at'] = "Geben Sie die Beschreibung ein."; //copied from de-de
$text['description-node_description']['de-ch'] = "Geben Sie die Beschreibung ein."; //copied from de-de
$text['description-node_description']['de-de'] = "Geben Sie die Beschreibung ein.";
$text['description-node_description']['es-cl'] = " Introduzca la descripción.";
$text['description-node_description']['es-mx'] = " Introduzca la descripción."; //copied from es-cl
$text['description-node_description']['fr-ca'] = "Entrez la description."; //copied from fr-fr
$text['description-node_description']['fr-fr'] = "Entrez la description.";
$text['description-node_description']['he-il'] = " הזן את התיאור.";
$text['description-node_description']['it-it'] = "Inserisci la descrizione.";
$text['description-node_description']['nl-nl'] = "Voer de beschrijving in.";
$text['description-node_description']['pl-pl'] = " Wprowadź opis.";
$text['description-node_description']['pt-br'] = "Digite a descrição.";
$text['description-node_description']['pt-pt'] = " Digite a descrição.";
$text['description-node_description']['ro-ro'] = "Introduceți descrierea.";
$text['description-node_description']['ru-ru'] = "Введите описание.";
$text['description-node_description']['sv-se'] = "Ange beskrivningen.";
$text['description-node_description']['uk-ua'] = "Введіть опис.";
$text['description-node_cidr']['en-us'] = "Enter the IP CIDR range.";
$text['description-node_cidr']['en-gb'] = "Enter the IP CIDR range.";
$text['description-node_cidr']['ar-eg'] = "أدخل نطاق IP CIDR.";
$text['description-node_cidr']['de-at'] = " Geben Sie die IP CIDR-Bereich an."; //copied from de-de
$text['description-node_cidr']['de-ch'] = " Geben Sie die IP CIDR-Bereich an."; //copied from de-de
$text['description-node_cidr']['de-de'] = " Geben Sie die IP CIDR-Bereich an.";
$text['description-node_cidr']['es-cl'] = " Introduzca el rango de direcciones IP CIDR.";
$text['description-node_cidr']['es-mx'] = " Introduzca el rango de direcciones IP CIDR."; //copied from es-cl
$text['description-node_cidr']['fr-ca'] = "Entrez la plage IP CIDR."; //copied from fr-fr
$text['description-node_cidr']['fr-fr'] = "Entrez la plage IP CIDR.";
$text['description-node_cidr']['he-il'] = " הזן את טווח ה- IP CIDR.";
$text['description-node_cidr']['it-it'] = "Inserisci il range IP CIDR.";
$text['description-node_cidr']['nl-nl'] = "Voer het IP CIDR reeks in.";
$text['description-node_cidr']['pl-pl'] = "Wprowadź zakres IP CIDR.";
$text['description-node_cidr']['pt-br'] = "Digite o intervalo IP CIDR."; //copied from pt-pt
$text['description-node_cidr']['pt-pt'] = "Digite o intervalo IP CIDR.";
$text['description-node_cidr']['ro-ro'] = "Introduceți intervalul de IP CIDR.";
$text['description-node_cidr']['ru-ru'] = "Введите диапазон IP CIDR.";
$text['description-node_cidr']['sv-se'] = "Ange IP CIDR sortimentet.";
$text['description-node_cidr']['uk-ua'] = "Введіть діапазон IP-CIDR.";
$text['description-access_control_name']['en-us'] = "Enter the name.";
$text['description-access_control_name']['en-gb'] = "Enter the name.";
$text['description-access_control_name']['ar-eg'] = "أدخل اسم.";
$text['description-access_control_name']['de-at'] = "Namen eingeben."; //copied from de-de
$text['description-access_control_name']['de-ch'] = "Namen eingeben."; //copied from de-de
$text['description-access_control_name']['de-de'] = "Namen eingeben.";
$text['description-access_control_name']['es-cl'] = " Introduzca el nombre.";
$text['description-access_control_name']['es-mx'] = " Introduzca el nombre."; //copied from es-cl
$text['description-access_control_name']['fr-ca'] = "Entrez le nom."; //copied from fr-fr
$text['description-access_control_name']['fr-fr'] = "Entrez le nom.";
$text['description-access_control_name']['he-il'] = " הזן את השם.";
$text['description-access_control_name']['it-it'] = "Inserisci il nome.";
$text['description-access_control_name']['nl-nl'] = "Voer de naam in.";
$text['description-access_control_name']['pl-pl'] = " Wpisz nazwę.";
$text['description-access_control_name']['pt-br'] = "Digite o nome."; //copied from pt-pt
$text['description-access_control_name']['pt-pt'] = "Digite o nome.";
$text['description-access_control_name']['ro-ro'] = "Introduceți numele.";
$text['description-access_control_name']['ru-ru'] = "Введите имя.";
$text['description-access_control_name']['sv-se'] = "Ange namnet.";
$text['description-access_control_name']['uk-ua'] = "Введіть ім'я.";
$text['description-access_control_description']['en-us'] = "Enter the description";
$text['description-access_control_description']['en-gb'] = "Enter the description";
$text['description-access_control_description']['ar-eg'] = "دخل وصف";
$text['description-access_control_description']['de-at'] = "Beschreibung eingeben."; //copied from de-de
$text['description-access_control_description']['de-ch'] = "Beschreibung eingeben."; //copied from de-de
$text['description-access_control_description']['de-de'] = "Beschreibung eingeben.";
$text['description-access_control_description']['es-cl'] = "Introduzca la descripción";
$text['description-access_control_description']['es-mx'] = "Introduzca la descripción"; //copied from es-cl
$text['description-access_control_description']['fr-ca'] = "Entrez la description."; //copied from fr-fr
$text['description-access_control_description']['fr-fr'] = "Entrez la description.";
$text['description-access_control_description']['he-il'] = " הזן את התיאור";
$text['description-access_control_description']['it-it'] = "Inserisci la descrizione";
$text['description-access_control_description']['nl-nl'] = "Voer de omschrijving in.";
$text['description-access_control_description']['pl-pl'] = "Wprowadź opis";
$text['description-access_control_description']['pt-br'] = "Digite a descrição.";
$text['description-access_control_description']['pt-pt'] = "Digite a descrição";
$text['description-access_control_description']['ro-ro'] = "Introduceți descrierea";
$text['description-access_control_description']['ru-ru'] = "Введите описание";
$text['description-access_control_description']['sv-se'] = "Ange en beskrivning";
$text['description-access_control_description']['uk-ua'] = "Введіть опис";
$text['description-access_control_default']['en-us'] = "Select the default type.";
$text['description-access_control_default']['en-gb'] = "Select the default type.";
$text['description-access_control_default']['ar-eg'] = "حدد نوع الافتراضي.";
$text['description-access_control_default']['de-at'] = " Wählen Sie den Standardtyp."; //copied from de-de
$text['description-access_control_default']['de-ch'] = " Wählen Sie den Standardtyp."; //copied from de-de
$text['description-access_control_default']['de-de'] = " Wählen Sie den Standardtyp.";
$text['description-access_control_default']['es-cl'] = "Seleccione el tipo de defecto.";
$text['description-access_control_default']['es-mx'] = "Seleccione el tipo de defecto."; //copied from es-cl
$text['description-access_control_default']['fr-ca'] = "Sélectionnez le type de défaut"; //copied from fr-fr
$text['description-access_control_default']['fr-fr'] = "Sélectionnez le type de défaut";
$text['description-access_control_default']['he-il'] = " בחר את סוג ברירת המחדל.";
$text['description-access_control_default']['it-it'] = "Scegli il tipo di default.";
$text['description-access_control_default']['nl-nl'] = "Selecteer het standaard type.";
$text['description-access_control_default']['pl-pl'] = "Wybierz typ domyślny.";
$text['description-access_control_default']['pt-br'] = "Selecione o tipo de padrão."; //copied from pt-pt
$text['description-access_control_default']['pt-pt'] = "Selecione o tipo de padrão.";
$text['description-access_control_default']['ro-ro'] = "Selectați tipul implicit.";
$text['description-access_control_default']['ru-ru'] = "Выберите тип по умолчанию.";
$text['description-access_control_default']['sv-se'] = "Välj standardtypen.";
$text['description-access_control_default']['uk-ua'] = "Вибір типу за замовчуванням.";
?>

View File

@ -0,0 +1,30 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Access Controls";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Access Controls";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "عناصر التحكم في الوصول";
$apps[$x]['menu'][$y]['title']['de-at'] = " Zugriffskontrolle";
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
$apps[$x]['menu'][$y]['title']['de-de'] = " Zugriffskontrolle";
$apps[$x]['menu'][$y]['title']['es-cl'] = "Controles de acceso";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Contrôles d'accès";
$apps[$x]['menu'][$y]['title']['he-il'] = "בקרת גישה";
$apps[$x]['menu'][$y]['title']['it-it'] = "Controlli Accesso";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Toegangs Controle";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Kontrola dostępu";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Controles de Acesso";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "Controles de Acesso";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "Controale de acces";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Контроль доступа";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "контроль доступу";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Åtkomstkontroll";
$apps[$x]['menu'][$y]['uuid'] = "bd47c972-5498-4541-b44a-d4bbfac69496";
$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/access_controls/access_controls.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
?>

View File

@ -0,0 +1,292 @@
<?php
/**
* access controls class
*
* @method null download
*/
if (!class_exists('access_controls')) {
class access_controls {
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'access_controls';
$this->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
$this->list_page = 'access_controls.php';
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
//assign private variables
$this->permission_prefix = 'access_control_';
$this->table = 'access_controls';
$this->uuid_prefix = 'access_control_';
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array['access_control_nodes'][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('access_control_node_delete', 'temp');
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//revoke temporary permissions
$p->delete('access_control_node_delete', 'temp');
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
public function delete_nodes($records) {
//assign private variables
$this->permission_prefix = 'access_control_node_';
$this->table = 'access_control_nodes';
$this->uuid_prefix = 'access_control_node_';
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate('/app/access_controls/access_control_nodes.php')) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* copy records
*/
public function copy($records) {
//assign private variables
$this->permission_prefix = 'access_control_';
$this->table = 'access_controls';
$this->uuid_prefix = 'access_control_';
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
//primary table
$sql = "select * from v_".$this->table." ";
$sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
$y = 0;
foreach ($rows as $x => $row) {
$primary_uuid = uuid();
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $primary_uuid;
$array[$this->table][$x]['access_control_description'] = trim($row['access_control_description'].' ('.$text['label-copy'].')');
//nodes sub table
$sql_2 = "select * from v_access_control_nodes where access_control_uuid = :access_control_uuid";
$parameters_2['access_control_uuid'] = $row['access_control_uuid'];
$database = new database;
$rows_2 = $database->select($sql_2, $parameters_2, 'all');
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
foreach ($rows_2 as $row_2) {
//copy data
$array['access_control_nodes'][$y] = $row_2;
//overwrite
$array['access_control_nodes'][$y]['access_control_node_uuid'] = uuid();
$array['access_control_nodes'][$y]['access_control_uuid'] = $primary_uuid;
//increment
$y++;
}
}
unset($sql_2, $parameters_2, $rows_2, $row_2);
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//grant temporary permissions
$p = new permissions;
$p->add('access_control_node_add', 'temp');
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('access_control_node_add', 'temp');
//clear the cache
$cache = new cache;
$cache->delete("configuration:acl.conf");
//create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
event_socket_request($fp, "api reloadacl");
}
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
}
}
}
?>

View File

@ -0,0 +1,90 @@
<?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>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,198 @@
<?php
class azure{
public static $formats = array (
'English-Zira' =>
array (
'lang' => 'en-US',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)'
),
'English-Jessa' =>
array (
'lang' => 'en-US',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)'
),
'English-Benjamin' =>
array (
'lang' => 'en-US',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-US, BenjaminRUS)'
),
'British-Susan' =>
array (
'lang' => 'en-GB',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-GB, Susan, Apollo)'
),
'British-Hazel' =>
array (
'lang' => 'en-GB',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-GB, HazelRUS)'
),
'British-George' =>
array (
'lang' => 'en-GB',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-GB, George, Apollo)'
),
'Australian-Catherine' =>
array (
'lang' => 'en-AU',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (en-AU, Catherine)'
),
'Spanish-Helena' =>
array (
'lang' => 'es-ES',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (es-ES, HelenaRUS)'
),
'Spanish-Laura' =>
array (
'lang' => 'es-ES',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (es-ES, Laura, Apollo)'
),
'Spanish-Pablo' =>
array (
'lang' => 'es-ES',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (es-ES, Pablo, Apollo)'
),
'French-Julie' =>
array (
'lang' => 'fr-FR',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (fr-FR, Julie, Apollo)'
),
'French-Hortense' =>
array (
'lang' => 'fr-FR',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (fr-FR, HortenseRUS)'
),
'French-Paul' =>
array (
'lang' => 'fr-FR',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (fr-FR, Paul, Apollo)'
),
'German-Hedda' =>
array (
'lang' => 'de-DE',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (de-DE, Hedda)'
),
'Russian-Irina' =>
array (
'lang' => 'ru-RU',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (ru-RU, Irina, Apollo)'
),
'Russian-Pavel' =>
array (
'lang' => 'ru-RU',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (ru-RU, Pavel, Apollo)'
),
'Chinese-Huihui' =>
array (
'lang' => 'zh-CN',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (zh-CN, HuihuiRUS)'
),
'Chinese-Yaoyao' =>
array (
'lang' => 'zh-CN',
'gender' => 'Female',
'name' => 'Microsoft Server Speech Text to Speech Voice (zh-CN, Yaoyao, Apollo)'
),
'Chinese-Kangkang' =>
array (
'lang' => 'zh-CN',
'gender' => 'Male',
'name' => 'Microsoft Server Speech Text to Speech Voice (zh-CN, Kangkang, Apollo)'
)
);
private static function getTokenUrl(){
return "https://api.cognitive.microsoft.com/sts/v1.0/issueToken";
}
private static function getApiUrl(){
return "https://speech.platform.bing.com/synthesize";
}
private static function getSubscriptionKey(){
return $_SESSION['azure']['key']['text'];
}
private static function _getToken(){
$url = self::getTokenUrl();
$subscriptionKey = self::getSubscriptionKey();
$headers = array();
$headers[] = 'Ocp-Apim-Subscription-Key: '. $subscriptionKey;
$headers[] = 'Content-Length: 0';
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_URL, $url );
//curl_setopt($ch, CURLOPT_SSLVERSION, 1);
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 60 );
curl_setopt ( $ch, CURLOPT_TIMEOUT, 300 );
curl_setopt ( $ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
public static function synthesize($data,$formate_key){
$lang = self::$formats[$formate_key]['lang'];
$gender = self::$formats[$formate_key]['gender'];
$name = self::$formats[$formate_key]['name'];
$token = self::_getToken();
$url = self::getApiUrl();
$headers = array();
$headers[] = 'Authorization: Bearer '. $token;
$headers[] = 'Content-Type: application/ssml+xml';
$headers[] = 'X-Microsoft-OutputFormat: riff-16khz-16bit-mono-pcm';
$headers[] = 'User-Agent: TTS';
$xml_post_string = "<speak version='1.0' xml:lang='".$lang."'>
<voice xml:lang='".$lang."' xml:gender='".$gender."' name='".$name."'>";
$xml_post_string .= $data;
$xml_post_string .= "</voice>
</speak>";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_URL, $url );
//curl_setopt($ch, CURLOPT_SSLVERSION, 1);
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 60 );
curl_setopt ( $ch, CURLOPT_TIMEOUT, 300 );
curl_setopt ( $ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
$response = curl_exec($ch);
$filename = "tts_".time().".wav";
file_put_contents("/var/www/html/fusionpbx/app/voiplyrecording/tts_record/".$filename, $response);
curl_close($ch);
return $filename;
}
}

View File

@ -0,0 +1,103 @@
<?php
//application details
$apps[$x]['name'] = "Operator Panel";
$apps[$x]['uuid'] = "dd3d173a-5d51-4231-ab22-b18c5b712bb2";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "Operator panel shows the status.";
$apps[$x]['description']['en-gb'] = "Operator panel shows the status.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Das Bedienfeld zeigt den Status an.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Das Bedienfeld zeigt den Status an.";
$apps[$x]['description']['es-cl'] = "";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "";
$apps[$x]['description']['fr-fr'] = "";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Bedieningspaneel laat de status zien";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "";
$apps[$x]['description']['pt-pt'] = "Canais ativos no sistema.";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_manage";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_eavesdrop";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_hangup";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_record";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_call_details";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "operator_panel_on_demand";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "569280f2-a433-4eaf-9c08-945efdc6cf8f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "operator_panel";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "1500";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the refresh rate in seconds (<=120) or milliseconds (>=500).";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0c273cad-1ee4-48d9-9336-08bc8260579a";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "operator_panel";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "group_extensions";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set if extensions are grouped by call_group when viewing all extensions.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a9ccd174-5ae1-4f90-8ee2-b79a183a04f8";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "operator_panel_main_background_color";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "#ffffff";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set main background color (and opacity) of extensions";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b9d34460-db41-40d5-becd-5da037fa8942";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "operator_panel_sub_background_color";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "#e5eaf5";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set sub background color (and opacity) of extensions";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "9cb6477d-0454-4b9c-b0fb-11c258d4f35f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "operator_panel_border_color";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "#b9c5d8";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Set border color (and opacity) of extensions";
$y++;
?>

View File

@ -0,0 +1,424 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-operator_panel']['en-us'] = "Operator Panel";
$text['title-operator_panel']['en-gb'] = "Operator Panel";
$text['title-operator_panel']['ar-eg'] = "";
$text['title-operator_panel']['de-at'] = "Bedienfeld"; //copied from de-de
$text['title-operator_panel']['de-ch'] = "Bedienfeld"; //copied from de-de
$text['title-operator_panel']['de-de'] = "Bedienfeld";
$text['title-operator_panel']['es-cl'] = "Panel de Operador";
$text['title-operator_panel']['es-mx'] = "Panel de Operador"; //copied from es-cl
$text['title-operator_panel']['fr-ca'] = "Operator Panel"; //copied from fr-fr
$text['title-operator_panel']['fr-fr'] = "Operator Panel";
$text['title-operator_panel']['he-il'] = "לוח מפעיל";
$text['title-operator_panel']['it-it'] = "Pannello Operatore";
$text['title-operator_panel']['nl-nl'] = "Operator paneel";
$text['title-operator_panel']['pl-pl'] = "Panel operatora";
$text['title-operator_panel']['pt-br'] = "Painel do operador";
$text['title-operator_panel']['pt-pt'] = "Painel do Operador";
$text['title-operator_panel']['ro-ro'] = "";
$text['title-operator_panel']['ru-ru'] = "Панель Оператора";
$text['title-operator_panel']['sv-se'] = "Telefonist Panel";
$text['title-operator_panel']['uk-ua'] = "Панель оператора";
$text['label-status_on_demand']['en-us'] = "On Demand";
$text['label-status_on_demand']['en-gb'] = "On Demand";
$text['label-status_on_demand']['ar-eg'] = "";
$text['label-status_on_demand']['de-at'] = "Bei Bedarf"; //copied from de-de
$text['label-status_on_demand']['de-ch'] = "Bei Bedarf"; //copied from de-de
$text['label-status_on_demand']['de-de'] = "Bei Bedarf";
$text['label-status_on_demand']['es-cl'] = "A Pedido";
$text['label-status_on_demand']['es-mx'] = "A Pedido"; //copied from es-cl
$text['label-status_on_demand']['fr-ca'] = "Sur Demande"; //copied from fr-fr
$text['label-status_on_demand']['fr-fr'] = "Sur Demande";
$text['label-status_on_demand']['he-il'] = "על פי דרישה";
$text['label-status_on_demand']['it-it'] = "Su Richiesta";
$text['label-status_on_demand']['nl-nl'] = "Op Aanvraag";
$text['label-status_on_demand']['pl-pl'] = "Na żądanie";
$text['label-status_on_demand']['pt-br'] = "A pedido";
$text['label-status_on_demand']['pt-pt'] = "A Pedido";
$text['label-status_on_demand']['ro-ro'] = "";
$text['label-status_on_demand']['ru-ru'] = "По требованию";
$text['label-status_on_demand']['sv-se'] = "På Begäran";
$text['label-status_on_demand']['uk-ua'] = "На вимогу";
$text['label-status_on_break']['en-us'] = "On Break";
$text['label-status_on_break']['en-gb'] = "On Break";
$text['label-status_on_break']['ar-eg'] = "";
$text['label-status_on_break']['de-at'] = "In Pause"; //copied from de-de
$text['label-status_on_break']['de-ch'] = "In Pause"; //copied from de-de
$text['label-status_on_break']['de-de'] = "In Pause";
$text['label-status_on_break']['es-cl'] = "En Pausa";
$text['label-status_on_break']['es-mx'] = "En Pausa"; //copied from es-cl
$text['label-status_on_break']['fr-ca'] = "En Pause"; //copied from fr-fr
$text['label-status_on_break']['fr-fr'] = "En Pause";
$text['label-status_on_break']['he-il'] = "בהפסקה";
$text['label-status_on_break']['it-it'] = "In Pausa";
$text['label-status_on_break']['nl-nl'] = "In de wacht";
$text['label-status_on_break']['pl-pl'] = "Na przerwie";
$text['label-status_on_break']['pt-br'] = "Em pausa";
$text['label-status_on_break']['pt-pt'] = "Em Pausa";
$text['label-status_on_break']['ro-ro'] = "";
$text['label-status_on_break']['ru-ru'] = "Пауза";
$text['label-status_on_break']['sv-se'] = "På Rast";
$text['label-status_on_break']['uk-ua'] = "На перерві";
$text['label-status_logged_out_or_unknown']['en-us'] = "Logged Out / Unknown";
$text['label-status_logged_out_or_unknown']['en-gb'] = "Logged Out / Unknown";
$text['label-status_logged_out_or_unknown']['ar-eg'] = "";
$text['label-status_logged_out_or_unknown']['de-at'] = "Abgemeldet / Unbekannt"; //copied from de-de
$text['label-status_logged_out_or_unknown']['de-ch'] = "Abgemeldet / Unbekannt"; //copied from de-de
$text['label-status_logged_out_or_unknown']['de-de'] = "Abgemeldet / Unbekannt";
$text['label-status_logged_out_or_unknown']['es-cl'] = "Desconectado / Desconocido";
$text['label-status_logged_out_or_unknown']['es-mx'] = "Desconectado / Desconocido"; //copied from es-cl
$text['label-status_logged_out_or_unknown']['fr-ca'] = "Déconnexion / Unknown"; //copied from fr-fr
$text['label-status_logged_out_or_unknown']['fr-fr'] = "Déconnexion / Unknown";
$text['label-status_logged_out_or_unknown']['he-il'] = "";
$text['label-status_logged_out_or_unknown']['it-it'] = "Sloggato/Sconosciuto";
$text['label-status_logged_out_or_unknown']['nl-nl'] = "Afgelogged / Onbekend";
$text['label-status_logged_out_or_unknown']['pl-pl'] = "Wylogowany / Nieznany";
$text['label-status_logged_out_or_unknown']['pt-br'] = "Desligar / Desconhecido";
$text['label-status_logged_out_or_unknown']['pt-pt'] = "Desligado / Unknown";
$text['label-status_logged_out_or_unknown']['ro-ro'] = "";
$text['label-status_logged_out_or_unknown']['ru-ru'] = "Вышел из системы / Неизвестен";
$text['label-status_logged_out_or_unknown']['sv-se'] = "Utloggad / Okänd";
$text['label-status_logged_out_or_unknown']['uk-ua'] = "Вийшов/невідомо";
$text['label-status_logged_out']['en-us'] = "Logged Out";
$text['label-status_logged_out']['en-gb'] = "Logged Out";
$text['label-status_logged_out']['ar-eg'] = "";
$text['label-status_logged_out']['de-at'] = "Abgemeldet"; //copied from de-de
$text['label-status_logged_out']['de-ch'] = "Abgemeldet"; //copied from de-de
$text['label-status_logged_out']['de-de'] = "Abgemeldet";
$text['label-status_logged_out']['es-cl'] = "Desconectado";
$text['label-status_logged_out']['es-mx'] = "Desconectado"; //copied from es-cl
$text['label-status_logged_out']['fr-ca'] = "Déconnexion"; //copied from fr-fr
$text['label-status_logged_out']['fr-fr'] = "Déconnexion";
$text['label-status_logged_out']['he-il'] = "";
$text['label-status_logged_out']['it-it'] = "Sloggato";
$text['label-status_logged_out']['nl-nl'] = "Afgelogged";
$text['label-status_logged_out']['pl-pl'] = "Wylogowany";
$text['label-status_logged_out']['pt-br'] = "Desligado"; //copied from pt-pt
$text['label-status_logged_out']['pt-pt'] = "Desligado";
$text['label-status_logged_out']['ro-ro'] = "";
$text['label-status_logged_out']['ru-ru'] = "Вышел из системы";
$text['label-status_logged_out']['sv-se'] = "Utloggad";
$text['label-status_logged_out']['uk-ua'] = "Вийшов";
$text['label-status_do_not_disturb']['en-us'] = "Do Not Disturb";
$text['label-status_do_not_disturb']['en-gb'] = "Do Not Disturb";
$text['label-status_do_not_disturb']['ar-eg'] = "";
$text['label-status_do_not_disturb']['de-at'] = "Bitte nicht Stören"; //copied from de-de
$text['label-status_do_not_disturb']['de-ch'] = "Bitte nicht Stören"; //copied from de-de
$text['label-status_do_not_disturb']['de-de'] = "Bitte nicht Stören";
$text['label-status_do_not_disturb']['es-cl'] = "No Molestar";
$text['label-status_do_not_disturb']['es-mx'] = "No Molestar"; //copied from es-cl
$text['label-status_do_not_disturb']['fr-ca'] = "Ne pas Déranger"; //copied from fr-fr
$text['label-status_do_not_disturb']['fr-fr'] = "Ne pas Déranger";
$text['label-status_do_not_disturb']['he-il'] = "נא לא להפריע";
$text['label-status_do_not_disturb']['it-it'] = "Non Disturbare";
$text['label-status_do_not_disturb']['nl-nl'] = "Niet Storen";
$text['label-status_do_not_disturb']['pl-pl'] = "Nie przeszkadzać (DND)";
$text['label-status_do_not_disturb']['pt-br'] = "Não perturbe";
$text['label-status_do_not_disturb']['pt-pt'] = "Não perturbe (DND)";
$text['label-status_do_not_disturb']['ro-ro'] = "";
$text['label-status_do_not_disturb']['ru-ru'] = "Просьба не беспокоить";
$text['label-status_do_not_disturb']['sv-se'] = "Stör Ej";
$text['label-status_do_not_disturb']['uk-ua'] = "Не турбувати";
$text['label-status_available_on_demand']['en-us'] = "Available (On Demand)";
$text['label-status_available_on_demand']['en-gb'] = "Available (On Demand)";
$text['label-status_available_on_demand']['ar-eg'] = "";
$text['label-status_available_on_demand']['de-at'] = "Verfügbar (Bei Bedarf)"; //copied from de-de
$text['label-status_available_on_demand']['de-ch'] = "Verfügbar (Bei Bedarf)"; //copied from de-de
$text['label-status_available_on_demand']['de-de'] = "Verfügbar (Bei Bedarf)";
$text['label-status_available_on_demand']['es-cl'] = "Disponible (A Pedido)";
$text['label-status_available_on_demand']['es-mx'] = "Disponible (A Pedido)"; //copied from es-cl
$text['label-status_available_on_demand']['fr-ca'] = "Disponible (sur demande)"; //copied from fr-fr
$text['label-status_available_on_demand']['fr-fr'] = "Disponible (sur demande)";
$text['label-status_available_on_demand']['he-il'] = "";
$text['label-status_available_on_demand']['it-it'] = "Disponibile (Su Richiesta)";
$text['label-status_available_on_demand']['nl-nl'] = "Beschikbaar (Op Aaanvraag)";
$text['label-status_available_on_demand']['pl-pl'] = "Dostępny (na żądanie)";
$text['label-status_available_on_demand']['pt-br'] = "Disponivel (A pedido)";
$text['label-status_available_on_demand']['pt-pt'] = "Disponível (A Pedido)";
$text['label-status_available_on_demand']['ro-ro'] = "";
$text['label-status_available_on_demand']['ru-ru'] = "Доступен (по требованию)";
$text['label-status_available_on_demand']['sv-se'] = "Tillgänglig (På Begäran)";
$text['label-status_available_on_demand']['uk-ua'] = "Доступний (на вимогу)";
$text['label-status_available']['en-us'] = "Available";
$text['label-status_available']['en-gb'] = "Available";
$text['label-status_available']['ar-eg'] = "";
$text['label-status_available']['de-at'] = "Verfügbar"; //copied from de-de
$text['label-status_available']['de-ch'] = "Verfügbar"; //copied from de-de
$text['label-status_available']['de-de'] = "Verfügbar";
$text['label-status_available']['es-cl'] = "Disponible";
$text['label-status_available']['es-mx'] = "Disponible"; //copied from es-cl
$text['label-status_available']['fr-ca'] = "Disponible"; //copied from fr-fr
$text['label-status_available']['fr-fr'] = "Disponible";
$text['label-status_available']['he-il'] = "זמין";
$text['label-status_available']['it-it'] = "Disponibile";
$text['label-status_available']['nl-nl'] = "Beschikbaar";
$text['label-status_available']['pl-pl'] = "Dostępny";
$text['label-status_available']['pt-br'] = "Disponível";
$text['label-status_available']['pt-pt'] = "Disponível";
$text['label-status_available']['ro-ro'] = "";
$text['label-status_available']['ru-ru'] = "Доступен";
$text['label-status_available']['sv-se'] = "Tillgänglig";
$text['label-status_available']['uk-ua'] = "Доступний";
$text['label-refresh_pause']['en-us'] = "Pause Refresh";
$text['label-refresh_pause']['en-gb'] = "Pause Refresh";
$text['label-refresh_pause']['ar-eg'] = "";
$text['label-refresh_pause']['de-at'] = "Seite neu laden deaktivieren"; //copied from de-de
$text['label-refresh_pause']['de-ch'] = "Seite neu laden deaktivieren"; //copied from de-de
$text['label-refresh_pause']['de-de'] = "Seite neu laden deaktivieren";
$text['label-refresh_pause']['es-cl'] = "Actualizar Pausa";
$text['label-refresh_pause']['es-mx'] = "Actualizar Pausa"; //copied from es-cl
$text['label-refresh_pause']['fr-ca'] = "Pause Actualiser"; //copied from fr-fr
$text['label-refresh_pause']['fr-fr'] = "Pause Actualiser";
$text['label-refresh_pause']['he-il'] = "עצור רענון";
$text['label-refresh_pause']['it-it'] = "Interrompi";
$text['label-refresh_pause']['nl-nl'] = "Stop verversen";
$text['label-refresh_pause']['pl-pl'] = "Pauzuj odświeżanie";
$text['label-refresh_pause']['pt-br'] = "Pausar atualização";
$text['label-refresh_pause']['pt-pt'] = "Pausa Atualizar";
$text['label-refresh_pause']['ro-ro'] = "";
$text['label-refresh_pause']['ru-ru'] = "Приостановить обновление";
$text['label-refresh_pause']['sv-se'] = "Paus Uppdatera";
$text['label-refresh_pause']['uk-ua'] = "Припинити оновлення";
$text['label-refresh_enable']['en-us'] = "Enable Refresh";
$text['label-refresh_enable']['en-gb'] = "Enable Refresh";
$text['label-refresh_enable']['ar-eg'] = "";
$text['label-refresh_enable']['de-at'] = "Seite neu laden aktivieren"; //copied from de-de
$text['label-refresh_enable']['de-ch'] = "Seite neu laden aktivieren"; //copied from de-de
$text['label-refresh_enable']['de-de'] = "Seite neu laden aktivieren";
$text['label-refresh_enable']['es-cl'] = "Activar Actualizar";
$text['label-refresh_enable']['es-mx'] = "Activar Actualizar"; //copied from es-cl
$text['label-refresh_enable']['fr-ca'] = "Activer Actualiser"; //copied from fr-fr
$text['label-refresh_enable']['fr-fr'] = "Activer Actualiser";
$text['label-refresh_enable']['he-il'] = "אפשר רענון";
$text['label-refresh_enable']['it-it'] = "Abilita Aggiornamento";
$text['label-refresh_enable']['nl-nl'] = "Start verversen";
$text['label-refresh_enable']['pl-pl'] = "Włącz odświeżanie";
$text['label-refresh_enable']['pt-br'] = "Habilitar atualização";
$text['label-refresh_enable']['pt-pt'] = "Habilitar Atualização";
$text['label-refresh_enable']['ro-ro'] = "";
$text['label-refresh_enable']['ru-ru'] = "Включить обновление";
$text['label-refresh_enable']['sv-se'] = "Aktivera Uppdatering";
$text['label-refresh_enable']['uk-ua'] = "Включити оновлення";
$text['label-recording']['en-us'] = "Recording";
$text['label-recording']['en-gb'] = "Recording";
$text['label-recording']['ar-eg'] = "";
$text['label-recording']['de-at'] = "Aufnahme"; //copied from de-de
$text['label-recording']['de-ch'] = "Aufnahme"; //copied from de-de
$text['label-recording']['de-de'] = "Aufnahme";
$text['label-recording']['es-cl'] = "Grabación de Llamadas";
$text['label-recording']['es-mx'] = "Grabación de Llamadas"; //copied from es-cl
$text['label-recording']['fr-ca'] = "Enregistrement de L'appel"; //copied from fr-fr
$text['label-recording']['fr-fr'] = "Enregistrement de L'appel";
$text['label-recording']['he-il'] = "מקליט";
$text['label-recording']['it-it'] = "Registrazione";
$text['label-recording']['nl-nl'] = "Opnemend";
$text['label-recording']['pl-pl'] = "Nagrywanie";
$text['label-recording']['pt-br'] = "Gravação de chamadas";
$text['label-recording']['pt-pt'] = "Gravação de Chamadas";
$text['label-recording']['ro-ro'] = "";
$text['label-recording']['ru-ru'] = "Запись";
$text['label-recording']['sv-se'] = "Inspelning";
$text['label-recording']['uk-ua'] = "Запис";
$text['label-record']['en-us'] = "Record";
$text['label-record']['en-gb'] = "Record";
$text['label-record']['ar-eg'] = "";
$text['label-record']['de-at'] = "Aufnehmen"; //copied from de-de
$text['label-record']['de-ch'] = "Aufnehmen"; //copied from de-de
$text['label-record']['de-de'] = "Aufnehmen";
$text['label-record']['es-cl'] = "Registro";
$text['label-record']['es-mx'] = "Registro"; //copied from es-cl
$text['label-record']['fr-ca'] = "Enregistrer"; //copied from fr-fr
$text['label-record']['fr-fr'] = "Enregistrer";
$text['label-record']['he-il'] = "הקלטה";
$text['label-record']['it-it'] = "Registrazione";
$text['label-record']['nl-nl'] = "Opnemen";
$text['label-record']['pl-pl'] = "Nagrywanie";
$text['label-record']['pt-br'] = "Registro"; //copied from pt-pt
$text['label-record']['pt-pt'] = "Registro";
$text['label-record']['ro-ro'] = "";
$text['label-record']['ru-ru'] = "Воспроизведение";
$text['label-record']['sv-se'] = "Spela In";
$text['label-record']['uk-ua'] = "Запис";
$text['label-other_extensions']['en-us'] = "Other Extensions";
$text['label-other_extensions']['en-gb'] = "Other Extensions";
$text['label-other_extensions']['ar-eg'] = "";
$text['label-other_extensions']['de-at'] = "Andere Nebenstellen"; //copied from de-de
$text['label-other_extensions']['de-ch'] = "Andere Nebenstellen"; //copied from de-de
$text['label-other_extensions']['de-de'] = "Andere Nebenstellen";
$text['label-other_extensions']['es-cl'] = "Otras Extensiones";
$text['label-other_extensions']['es-mx'] = "Otras Extensiones"; //copied from es-cl
$text['label-other_extensions']['fr-ca'] = "Autres Extensions"; //copied from fr-fr
$text['label-other_extensions']['fr-fr'] = "Autres Extensions";
$text['label-other_extensions']['he-il'] = "שלוחות אחרות";
$text['label-other_extensions']['it-it'] = "Altri Interni";
$text['label-other_extensions']['nl-nl'] = "Andere toestellen";
$text['label-other_extensions']['pl-pl'] = "Inne numery wewnętrzne";
$text['label-other_extensions']['pt-br'] = "Outras extensões";
$text['label-other_extensions']['pt-pt'] = "Outros Extensions";
$text['label-other_extensions']['ro-ro'] = "";
$text['label-other_extensions']['ru-ru'] = "Другие внутренние номера";
$text['label-other_extensions']['sv-se'] = "Annan Anknytning";
$text['label-other_extensions']['uk-ua'] = "Інші розширення";
$text['label-no_extensions_found']['en-us'] = "No extensions found.";
$text['label-no_extensions_found']['en-gb'] = "No extensions found.";
$text['label-no_extensions_found']['ar-eg'] = "";
$text['label-no_extensions_found']['de-at'] = "Keine Nebenstellen gefunden."; //copied from de-de
$text['label-no_extensions_found']['de-ch'] = "Keine Nebenstellen gefunden."; //copied from de-de
$text['label-no_extensions_found']['de-de'] = "Keine Nebenstellen gefunden.";
$text['label-no_extensions_found']['es-cl'] = "No hay extensiones encontrados.";
$text['label-no_extensions_found']['es-mx'] = "No hay extensiones encontrados."; //copied from es-cl
$text['label-no_extensions_found']['fr-ca'] = "Aucun extensions trouvés."; //copied from fr-fr
$text['label-no_extensions_found']['fr-fr'] = "Aucun extensions trouvés.";
$text['label-no_extensions_found']['he-il'] = "לא נמצאו שלוחות";
$text['label-no_extensions_found']['it-it'] = "Nessun interno trovato.";
$text['label-no_extensions_found']['nl-nl'] = "Geen toestellen gevonden.";
$text['label-no_extensions_found']['pl-pl'] = "Nie znaleziono numerów wewnętrznych";
$text['label-no_extensions_found']['pt-br'] = "Não foi encontrada nenhuma extensão";
$text['label-no_extensions_found']['pt-pt'] = "Sem extensões encontrado.";
$text['label-no_extensions_found']['ro-ro'] = "";
$text['label-no_extensions_found']['ru-ru'] = "Внутренних номеров не найдено.";
$text['label-no_extensions_found']['sv-se'] = "Ingen anknytning funnen.";
$text['label-no_extensions_found']['uk-ua'] = "Не знайдено розширень";
$text['label-hangup']['en-us'] = "Hangup";
$text['label-hangup']['en-gb'] = "Hangup";
$text['label-hangup']['ar-eg'] = "";
$text['label-hangup']['de-at'] = "Abwürgen"; //copied from de-de
$text['label-hangup']['de-ch'] = "Abwürgen"; //copied from de-de
$text['label-hangup']['de-de'] = "Abwürgen";
$text['label-hangup']['es-cl'] = "Finalizar Llamada";
$text['label-hangup']['es-mx'] = "Finalizar Llamada"; //copied from es-cl
$text['label-hangup']['fr-ca'] = "Tuer Appel"; //copied from fr-fr
$text['label-hangup']['fr-fr'] = "Tuer Appel";
$text['label-hangup']['he-il'] = "הפסק";
$text['label-hangup']['it-it'] = "Abbatti";
$text['label-hangup']['nl-nl'] = "Ophangen";
$text['label-hangup']['pl-pl'] = "Rozłączenie się";
$text['label-hangup']['pt-br'] = "Chamada final";
$text['label-hangup']['pt-pt'] = "Chamada Final";
$text['label-hangup']['ro-ro'] = "";
$text['label-hangup']['ru-ru'] = "Убить";
$text['label-hangup']['sv-se'] = "Lägg På";
$text['label-hangup']['uk-ua'] = "вбити";
$text['label-eavesdrop']['en-us'] = "Eavesdrop";
$text['label-eavesdrop']['en-gb'] = "Eavesdrop";
$text['label-eavesdrop']['ar-eg'] = "";
$text['label-eavesdrop']['de-at'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-ch'] = "Mithören"; //copied from de-de
$text['label-eavesdrop']['de-de'] = "Mithören";
$text['label-eavesdrop']['es-cl'] = "Escuchar";
$text['label-eavesdrop']['es-mx'] = "Escuchar"; //copied from es-cl
$text['label-eavesdrop']['fr-ca'] = "Espionner"; //copied from fr-fr
$text['label-eavesdrop']['fr-fr'] = "Espionner";
$text['label-eavesdrop']['he-il'] = "";
$text['label-eavesdrop']['it-it'] = "Ascolta";
$text['label-eavesdrop']['nl-nl'] = "Afluisteren";
$text['label-eavesdrop']['pl-pl'] = "Podsłuchiwanie";
$text['label-eavesdrop']['pt-br'] = "Investigar";
$text['label-eavesdrop']['pt-pt'] = "Bisbilhotar";
$text['label-eavesdrop']['ro-ro'] = "";
$text['label-eavesdrop']['ru-ru'] = "Подслушивать";
$text['label-eavesdrop']['sv-se'] = "Medlyssning";
$text['label-eavesdrop']['uk-ua'] = "підслуховувати";
$text['label-call_group']['en-us'] = "Call Group";
$text['label-call_group']['en-gb'] = "Call Group";
$text['label-call_group']['ar-eg'] = "";
$text['label-call_group']['de-at'] = "Rufgruppe"; //copied from de-de
$text['label-call_group']['de-ch'] = "Rufgruppe"; //copied from de-de
$text['label-call_group']['de-de'] = "Rufgruppe";
$text['label-call_group']['es-cl'] = "Llamar a Grupo";
$text['label-call_group']['es-mx'] = "Llamar a Grupo"; //copied from es-cl
$text['label-call_group']['fr-ca'] = "Groupe d'appel"; //copied from fr-fr
$text['label-call_group']['fr-fr'] = "Groupe d'appel";
$text['label-call_group']['he-il'] = "קבוצת חיוג";
$text['label-call_group']['it-it'] = "Gruppo di Chiamata";
$text['label-call_group']['nl-nl'] = "Oproep Groep";
$text['label-call_group']['pl-pl'] = "Grupa odbiorców rozmowy";
$text['label-call_group']['pt-br'] = "Grupo"; //copied from pt-pt
$text['label-call_group']['pt-pt'] = "Grupo";
$text['label-call_group']['ro-ro'] = "";
$text['label-call_group']['ru-ru'] = "Группы вызова";
$text['label-call_group']['sv-se'] = "Ring Grupp";
$text['label-call_group']['uk-ua'] = "груповий виклик";
$text['label-call_direction']['en-us'] = "Call Direction";
$text['label-call_direction']['en-gb'] = "Call Direction";
$text['label-call_direction']['ar-eg'] = "";
$text['label-call_direction']['de-at'] = "Anruf Richtung"; //copied from de-de
$text['label-call_direction']['de-ch'] = "Anruf Richtung"; //copied from de-de
$text['label-call_direction']['de-de'] = "Anruf Richtung";
$text['label-call_direction']['es-cl'] = "Dirección de la llamada";
$text['label-call_direction']['es-mx'] = "Dirección de la llamada"; //copied from es-cl
$text['label-call_direction']['fr-ca'] = "Sens de l'appel"; //copied from fr-fr
$text['label-call_direction']['fr-fr'] = "Sens de l'appel";
$text['label-call_direction']['he-il'] = "כיוון שיחה";
$text['label-call_direction']['it-it'] = "Direzione Chiamata";
$text['label-call_direction']['nl-nl'] = "Oproep richting";
$text['label-call_direction']['pl-pl'] = "Kierunek rozmowy";
$text['label-call_direction']['pt-br'] = "Direção da chamada";
$text['label-call_direction']['pt-pt'] = "Direção da chamada";
$text['label-call_direction']['ro-ro'] = "";
$text['label-call_direction']['ru-ru'] = "Направление вызова";
$text['label-call_direction']['sv-se'] = "Samtals Riktning";
$text['label-call_direction']['uk-ua'] = "напрямок виклику";
$text['description-eavesdrop_destination']['en-us'] = "Select the Eavesdrop Destination";
$text['description-eavesdrop_destination']['en-gb'] = "Select the Eavesdrop Destination";
$text['description-eavesdrop_destination']['ar-eg'] = "";
$text['description-eavesdrop_destination']['de-at'] = "Wählen Sie ein Ziel zum Mithören"; //copied from de-de
$text['description-eavesdrop_destination']['de-ch'] = "Wählen Sie ein Ziel zum Mithören"; //copied from de-de
$text['description-eavesdrop_destination']['de-de'] = "Wählen Sie ein Ziel zum Mithören";
$text['description-eavesdrop_destination']['es-cl'] = "Seleccione el Eavesdrop Destino";
$text['description-eavesdrop_destination']['es-mx'] = "Seleccione el Eavesdrop Destino"; //copied from es-cl
$text['description-eavesdrop_destination']['fr-ca'] = "Sélectionnez la destination d'espionnage"; //copied from fr-fr
$text['description-eavesdrop_destination']['fr-fr'] = "Sélectionnez la destination d'espionnage";
$text['description-eavesdrop_destination']['he-il'] = "";
$text['description-eavesdrop_destination']['it-it'] = "Seleziona la Destinazione d'Ascolto";
$text['description-eavesdrop_destination']['nl-nl'] = "Kies afluister bestemming";
$text['description-eavesdrop_destination']['pl-pl'] = "Wybierz destynację podsłuchiwanych rozmów";
$text['description-eavesdrop_destination']['pt-br'] = "Selecione o eavesdrop de destino";
$text['description-eavesdrop_destination']['pt-pt'] = "Selecione o Eavesdrop Destino";
$text['description-eavesdrop_destination']['ro-ro'] = "";
$text['description-eavesdrop_destination']['ru-ru'] = "Выберите подслушивание пункта назначения";
$text['description-eavesdrop_destination']['sv-se'] = "Välj Medlyssning Destination";
$text['description-eavesdrop_destination']['uk-ua'] = "Виберіть пункт призначення підслуховувати";
$text['button-all']['en-us'] = "All";
$text['button-all']['en-gb'] = "All";
$text['button-all']['ar-eg'] = "";
$text['button-all']['de-at'] = "Alle"; //copied from de-de
$text['button-all']['de-ch'] = "Alle"; //copied from de-de
$text['button-all']['de-de'] = "Alle";
$text['button-all']['es-cl'] = "Todos";
$text['button-all']['es-mx'] = "Todos"; //copied from es-cl
$text['button-all']['fr-ca'] = "Tous"; //copied from fr-fr
$text['button-all']['fr-fr'] = "Tous";
$text['button-all']['he-il'] = "הכל";
$text['button-all']['it-it'] = "Tutti";
$text['button-all']['nl-nl'] = "Alle";
$text['button-all']['pl-pl'] = "Wszyscy";
$text['button-all']['pt-br'] = "Tudo"; //copied from pt-pt
$text['button-all']['pt-pt'] = "Tudo";
$text['button-all']['ro-ro'] = "";
$text['button-all']['ru-ru'] = "Все";
$text['button-all']['sv-se'] = "Alla";
$text['button-all']['uk-ua'] = "Всі";
?>

View File

@ -0,0 +1,30 @@
<?php
$y=0;
$apps[$x]['menu'][$y]['title']['en-us'] = "Operator Panel";
$apps[$x]['menu'][$y]['title']['en-gb'] = "Operator Panel";
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
$apps[$x]['menu'][$y]['title']['de-at'] = "Bedienfeld";
$apps[$x]['menu'][$y]['title']['de-de'] = "Bedienfeld";
$apps[$x]['menu'][$y]['title']['es-cl'] = "";
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
$apps[$x]['menu'][$y]['title']['fr-fr'] = "Panneau Operateur";
$apps[$x]['menu'][$y]['title']['he-il'] = "לוח מפעיל";
$apps[$x]['menu'][$y]['title']['it-it'] = "Pannello Operatore";
$apps[$x]['menu'][$y]['title']['nl-nl'] = "Bedienings paneel";
$apps[$x]['menu'][$y]['title']['pl-pl'] = "Panel operatora";
$apps[$x]['menu'][$y]['title']['pt-br'] = "Painel do operador";
$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
$apps[$x]['menu'][$y]['title']['ru-ru'] = "Панель оператора";
$apps[$x]['menu'][$y]['title']['sv-se'] = "Telefonist Panel";
$apps[$x]['menu'][$y]['title']['uk-ua'] = "Панель оператора";
$apps[$x]['menu'][$y]['uuid'] = "dd3d173a-5d51-4231-ab22-b18c5b712bb2";
$apps[$x]['menu'][$y]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
$apps[$x]['menu'][$y]['category'] = "internal";
$apps[$x]['menu'][$y]['path'] = "/app/basic_operator_panel/index.php";
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
$apps[$x]['menu'][$y]['groups'][] = "admin";
?>

View File

@ -0,0 +1,195 @@
<?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-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('contact_view')) {
//access granted
}
else {
exit;
}
//search term
$term = check_str($_GET['term']);
if (isset($_GET['debug'])) {
echo "Search Term: ".escape($term)."<br><br>";
}
//if term contains spaces, break into array
if (substr_count($term, ' ') > 0) {
$terms = explode(' ', $term);
}
else {
$terms[] = $term;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//retrieve current user's assigned groups (uuids)
foreach ($_SESSION['groups'] as $group_data) {
$user_group_uuids[] = $group_data['group_uuid'];
}
//add user's uuid to group uuid list to include private (non-shared) contacts
$user_group_uuids[] = $_SESSION["user_uuid"];
//create the database object
$database = new database;
//get extensions list
$sql = "select \n";
$sql .= "e.extension, \n";
$sql .= "e.effective_caller_id_name, \n";
$sql .= "concat(e.directory_first_name, ' ', e.directory_last_name) as directory_full_name \n";
$sql .= "from \n";
$sql .= "v_extensions e \n";
$sql .= "where \n";
foreach ($terms as $index => $term) {
$sql .= "( \n";
$sql .= " lower(e.effective_caller_id_name) like lower(:term) or \n";
$sql .= " lower(e.outbound_caller_id_name) like lower(:term) or \n";
$sql .= " lower(concat(e.directory_first_name, ' ', e.directory_last_name)) like lower(:term) or \n";
$sql .= " lower(e.description) like lower(:term) or \n";
$sql .= " lower(e.call_group) like lower(:term) or \n";
$sql .= " e.extension like :term \n";
$sql .= ") \n";
if ($index + 1 < sizeof($terms)) {
$sql .= " and \n";
}
}
$sql .= "and e.domain_uuid = :domain_uuid \n";
$sql .= "and e.enabled = 'true' \n";
$sql .= "order by \n";
$sql .= "directory_full_name asc, \n";
$sql .= "e.effective_caller_id_name asc \n";
if (isset($_GET['debug'])) { echo $sql."<br><br>"; }
$parameters['term'] = '%'.$term.'%';
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset ($parameters, $sql);
if (is_array($result)) {
if (isset($_GET['debug'])) { echo $result."<br><br>"; }
foreach($result as $row) {
if ($row['directory_full_name'] != '') { $values[] = $row['directory_full_name']; }
if ($row['effective_caller_id_name'] != '') { $values[] = $row['effective_caller_id_name']; }
$suggestions[] = "{ \"label\": \"".(implode(', ', $values)." @ ".$row['extension'])."\", \"value\": \"".$row['extension']."\" }";
unset($values);
}
unset($sql, $result, $row_count);
}
//get contacts list
$sql = "select \n";
$sql .= "c.contact_organization, \n";
$sql .= "c.contact_name_given, \n";
$sql .= "c.contact_name_middle, \n";
$sql .= "c.contact_name_family, \n";
$sql .= "c.contact_nickname, \n";
$sql .= "p.phone_number, \n";
$sql .= "p.phone_label \n";
$sql .= "from \n";
$sql .= "v_contacts as c, \n";
$sql .= "v_contact_phones as p \n";
$sql .= "where \n";
foreach ($terms as $index => $term) {
$sql .= "( \n";
$sql .= " lower(c.contact_organization) like lower(:term) or \n";
$sql .= " lower(c.contact_name_given) like lower(:term) or \n";
$sql .= " lower(c.contact_name_middle) like lower(:term) or \n";
$sql .= " lower(c.contact_name_family) like lower(:term) or \n";
$sql .= " lower(c.contact_nickname) like lower(:term) or \n";
$sql .= " p.phone_number like :term \n";
$sql .= ") \n";
if ($index + 1 < sizeof($terms)) {
$sql .= " and \n";
}
}
$sql .= "and c.contact_uuid = p.contact_uuid \n";
$sql .= "and c.domain_uuid = :domain_uuid \n";
if (sizeof($user_group_uuids) > 0) {
$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " c.contact_uuid in ( \n";
$sql .= " select contact_uuid from v_contact_groups \n";
$sql .= " where group_uuid in ('".implode("','", $user_group_uuids)."') \n";
$sql .= " and domain_uuid = :domain_uuid \n";
$sql .= " ) \n";
$sql .= " or \n";
$sql .= " c.contact_uuid not in ( \n";
$sql .= " select contact_uuid from v_contact_groups \n";
$sql .= " where domain_uuid = :domain_uuid \n";
$sql .= " ) \n";
$sql .= ") \n";
}
$sql .= "and p.phone_type_voice = 1 \n";
$sql .= "order by \n";
$sql .= "contact_organization desc, \n";
$sql .= "contact_name_given asc, \n";
$sql .= "contact_name_family asc \n";
if (isset($_GET['debug'])) { echo $sql."<br><br>"; }
$parameters['term'] = '%'.$term.'%';
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
unset ($parameters, $sql);
if (is_array($result)) {
foreach($result as $row) {
if ($row['contact_organization'] != '') { $values[] = $row['contact_organization']; }
if ($row['contact_name_given'] != '') { $names = $row['contact_name_given']; }
if ($row['contact_name_middle'] != '') { $names .= " ".$row['contact_name_middle']; }
if ($row['contact_name_family'] != '') { $names .= " ".$row['contact_name_family']; }
if ($names != '') { $values[] = $names; }
if ($row['contact_nickname'] != '') { $values[] = $row['contact_nickname']; }
$suggestions[] = "{ \"label\": \"".(implode(', ', $values)." - ".format_phone($row['phone_number']).(($row['phone_label'] != '') ? " (".$row['phone_label'].")" : null))."\", \"value\": \"".$row['phone_number']."\" }";
unset($values, $names);
}
unset($sql, $result, $row_count);
}
//output suggestions, if any
if (sizeof($suggestions) > 0) {
$resp .= "[\n";
$resp .= implode(",\n", $suggestions)."\n";
$resp .= "]";
if (isset($_GET['debug'])) { echo "<pre>"; }
echo $resp;
if (isset($_GET['debug'])) { echo "</pre>"; }
}
?>

View File

@ -0,0 +1,124 @@
<?php
/* $Id$ */
/*
v_exec.php
Copyright (C) 2008-2019 Mark J Crane
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//authorized referrer
// if(stristr($_SERVER["HTTP_REFERER"], '/index.php') === false) {
// if(stristr($_SERVER["HTTP_REFERER"], '/index_inc.php') === false) {
// echo " access denied";
// exit;
// }
// }
//process the requests
if (count($_GET) > 0) {
//set the variables
$switch_cmd = trim($_GET["cmd"]);
$action = trim($_GET["action"]);
$data = trim($_GET["data"]);
$direction = trim($_GET["direction"]);
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//allow specific commands
if (strlen($switch_cmd) > 0) {
$api_cmd = '';
$uuid_pattern = '/[^-A-Fa-f0-9]/';
$num_pattern = '/[^-A-Za-z0-9()*#]/';
if ($switch_cmd == 'originate') {
$source = preg_replace($num_pattern,'',$_GET['source']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$api_cmd = 'bgapi originate {sip_auto_answer=true,origination_caller_id_number=' . $source . ',sip_h_Call-Info=_undef_}user/' . $source . '@' . $_SESSION['domain_name'] . ' ' . $destination . ' XML ' . trim($_SESSION['user_context']);
} elseif ($switch_cmd == 'uuid_record') {
$uuid = preg_replace($uuid_pattern,'',$_GET['uuid']);
$api_cmd = 'uuid_record ' . $uuid . ' start ' . $_SESSION['switch']['recordings']['dir'] . '/' . $_SESSION['domain_name'] . '/archive/' . date('Y/M/d') . '/' . $uuid . '.wav';
} elseif ($switch_cmd == 'uuid_transfer') {
$uuid = preg_replace($uuid_pattern,'',$_GET['uuid']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$api_cmd = 'uuid_transfer ' . $uuid . ' ' . $destination . ' XML ' . trim($_SESSION['user_context']);
} elseif ($switch_cmd == 'uuid_eavesdrop') {
$chan_uuid = preg_replace($uuid_pattern,'',$_GET['chan_uuid']);
$ext = preg_replace($num_pattern,'',$_GET['ext']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$language = new text;
$text = $language->get();
$api_cmd = 'bgapi originate {origination_caller_id_name=' . $text['label-eavesdrop'] . ',origination_caller_id_number=' . $ext . '}user/' . $destination . '@' . $_SESSION['domain_name'] . ' &eavesdrop(' . $chan_uuid . ')';
} elseif ($switch_cmd == 'uuid_kill') {
$call_id = preg_replace($uuid_pattern,'',$_GET['call_id']);
$api_cmd = 'uuid_kill ' . $call_id;
} else {
echo 'access denied';
return;
}
//run the command
$switch_result = event_socket_request($fp, 'api '.$api_cmd);
/*
//record stop
if ($action == "record") {
if (trim($_GET["action2"]) == "stop") {
$x=0;
while (true) {
if ($x > 0) {
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"]."_".$x.".wav";
}
else {
$dest_file = $_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav";
}
if (!file_exists($dest_file)) {
rename($_SESSION['switch']['recordings']['dir']."/archive/".date("Y")."/".date("M")."/".date("d")."/".$_GET["uuid"].".wav", $dest_file);
break;
}
$x++;
}
}
}
*/
}
}
?>

View File

@ -0,0 +1,599 @@
<?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-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set user status
if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') {
//validate the user status
$user_status = $_REQUEST['status'];
switch ($user_status) {
case "Available" :
break;
case "Available (On Demand)" :
break;
case "On Break" :
break;
case "Do Not Disturb" :
break;
case "Logged Out" :
break;
default :
$user_status = '';
}
//update the status
if (permission_exists("user_setting_edit")) {
//add the user_edit permission
$p = new permissions;
$p->add("user_edit", "temp");
//update the database user_status
$array['users'][0]['user_uuid'] = $_SESSION['user']['user_uuid'];
$array['users'][0]['domain_uuid'] = $_SESSION['user']['domain_uuid'];
$array['users'][0]['user_status'] = $user_status;
$database = new database;
$database->app_name = 'operator_panel';
$database->app_uuid = 'dd3d173a-5d51-4231-ab22-b18c5b712bb2';
$database->save($array);
//remove the temporary permission
$p->delete("user_edit", "temp");
unset($array);
}
//if call center app is installed then update the user_status
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/call_centers')) {
//get the call center agent uuid
$sql = "select call_center_agent_uuid from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_uuid = :user_uuid ";
$parameters['domain_uuid'] = $_SESSION['user']['domain_uuid'];
$parameters['user_uuid'] = $_SESSION['user']['user_uuid'];
$database = new database;
$call_center_agent_uuid = $database->select($sql, $parameters, 'column');
unset($sql, $parameters);
//update the user_status
if (is_uuid($call_center_agent_uuid)) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$switch_cmd .= "callcenter_config agent set status ".$call_center_agent_uuid." '".$user_status."'";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
//update the user state
if (is_uuid($call_center_agent_uuid)) {
$cmd = "api callcenter_config agent set state ".$call_center_agent_uuid." Waiting";
$response = event_socket_request($fp, $cmd);
}
//update do not disturb
if ($user_status == "Do Not Disturb") {
$x = 0;
foreach($_SESSION['user']['extension'] as $row) {
//build the array
$array['extensions'][$x]['extension_uuid'] = $row['extension_uuid'];
$array['extensions'][$x]['dial_string'] = '!USER_BUSY';
$array['extensions'][$x]['do_not_disturb'] = 'true';
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
}
//incrment
$x++;
}
}
else {
$x = 0;
foreach($_SESSION['user']['extension'] as $row) {
//build the array
$array['extensions'][$x]['extension_uuid'] = $row['extension_uuid'];
$array['extensions'][$x]['dial_string'] = null;
$array['extensions'][$x]['do_not_disturb'] = 'false';
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
}
//incrment
$x++;
}
}
//grant temporary permissions
$p = new permissions;
$p->add('extension_edit', 'temp');
//execute update
$database = new database;
$database->app_name = 'calls';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->save($array);
unset($array);
//revoke temporary permissions
$p->delete('extension_edit', 'temp');
//delete extension from the cache
$cache = new cache;
$cache->delete("directory:".$extension."@".$this->domain_name);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$number_alias."@".$this->domain_name);
}
}
//stop execution
exit;
}
//set the title
$document['title'] = $text['title-operator_panel'];
//include the header
require_once "resources/header.php";
?>
<!-- virtual_drag function holding elements -->
<input type='hidden' class='formfld' id='vd_call_id' value=''>
<input type='hidden' class='formfld' id='vd_ext_from' value=''>
<input type='hidden' class='formfld' id='vd_ext_to' value=''>
<input type='hidden' class='formfld' id='sort1' value=''>
<!-- autocomplete for contact lookup -->
<link rel="stylesheet" type="text/css" href="<?php echo PROJECT_PATH; ?>/resources/jquery/jquery-ui.min.css">
<script language="JavaScript" type="text/javascript" src="<?php echo PROJECT_PATH; ?>/resources/jquery/jquery-ui.min.js"></script>
<script type="text/javascript">
<?php
//determine refresh rate
$refresh_default = 1500; //milliseconds
$refresh = is_numeric($_SESSION['operator_panel']['refresh']['numeric']) ? $_SESSION['operator_panel']['refresh']['numeric'] : $refresh_default;
if ($refresh >= 0.5 && $refresh <= 120) { //convert seconds to milliseconds
$refresh = $refresh * 1000;
}
else if ($refresh < 0.5 || ($refresh > 120 && $refresh < 500)) {
$refresh = $refresh_default; //use default
}
else {
//>= 500, must be milliseconds
}
unset($refresh_default);
?>
//ajax refresh
var refresh = <?php echo $refresh; ?>;
var source_url = 'resources/content.php?' <?php if (isset($_GET['debug'])) { echo " + '&debug'"; } ?>;
var interval_timer_id;
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
loadXmlHttp.prototype.stateChanged=function () {
var url = new URL(this.xmlHttp.responseURL);
if (/login\.php$/.test(url.pathname)) {
// You are logged out. Stop refresh!
refresh_stop();
url.searchParams.set('path', '<?php echo $_SERVER['REQUEST_URI']; ?>');
window.location.href = url.href;
return;
}
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
if (document.getElementById('sort')) {
if (document.getElementById('sort').value != "")
document.getElementById('sort1').value=document.getElementById('sort').value;
}
}
var requestTime = function() {
var url = source_url;
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
url += '&extension_filter=' + ((document.getElementById('extension_filter')) ? document.getElementById('extension_filter').value : '');
url += '&name_filter=' + ((document.getElementById('name_filter')) ? document.getElementById('name_filter').value : '');
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
if (document.getElementById('sort1'))
if (document.getElementById('sort1').value == '1') url += '&sort';
<?php
if (isset($_GET['debug'])) {
echo "url += '&debug';";
}
?>
new loadXmlHttp(url, 'ajax_reponse');
refresh_start();
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
//drag/drop functionality
var ie_workaround = false;
function drag(ev, from_ext) {
refresh_stop();
try {
ev.dataTransfer.setData("Call", ev.target.id);
ev.dataTransfer.setData("From", from_ext);
virtual_drag_reset();
}
catch (err) {
// likely internet explorer being used, do workaround
virtual_drag(ev.target.id, from_ext);
ie_workaround = true;
}
}
function allowDrop(ev, target_id) {
ev.preventDefault();
}
function discardDrop(ev, target_id) {
ev.preventDefault();
}
function drop(ev, to_ext) {
ev.preventDefault();
if (ie_workaround) { // potentially set on drag() function above
var call_id = document.getElementById('vd_call_id').value;
var from_ext = document.getElementById('vd_ext_from').value;
virtual_drag_reset();
}
else {
var call_id = ev.dataTransfer.getData("Call");
var from_ext = ev.dataTransfer.getData("From");
}
var to_ext = to_ext;
var cmd;
if (call_id != '') {
cmd = get_transfer_cmd(call_id, to_ext); //transfer a call
}
else {
if (from_ext != to_ext) { // prevent user from dragging extention onto self
cmd = get_originate_cmd(from_ext, to_ext); //make a call
}
}
if (cmd != '') { send_cmd(cmd) }
refresh_start();
}
//refresh controls
function refresh_stop() {
clearInterval(interval_timer_id);
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">"; }
}
function refresh_start() {
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
refresh_stop();
interval_timer_id = setInterval( function() {
url = source_url;
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
url += '&extension_filter=' + ((document.getElementById('extension_filter')) ? document.getElementById('extension_filter').value : '');
url += '&name_filter=' + ((document.getElementById('name_filter')) ? document.getElementById('name_filter').value : '');
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
if (document.getElementById('sort1'))
if (document.getElementById('sort1').value == '1') url += '&sort';
<?php
if (isset($_GET['debug'])) {
echo "url += '&debug';";
}
?>
new loadXmlHttp(url, 'ajax_reponse');
}, refresh);
}
//call or transfer to destination
function go_destination(from_ext, destination, which, call_id) {
call_id = typeof call_id !== 'undefined' ? call_id : '';
if (destination != '') {
if (!isNaN(parseFloat(destination)) && isFinite(destination)) {
if (call_id == '') {
cmd = get_originate_cmd(from_ext, destination); //make a call
}
else {
cmd = get_transfer_cmd(call_id, destination);
}
if (cmd != '') {
send_cmd(cmd);
$('#destination_'+from_ext+'_'+which).removeAttr('onblur');
toggle_destination(from_ext, which);
}
}
}
}
//hangup call
function hangup_call(call_id) {
if (call_id != '') {
send_cmd('exec.php?cmd=uuid_kill&call_id=' + call_id)
}
}
//eavesdrop call
function eavesdrop_call(ext, chan_uuid) {
if (ext != '' && chan_uuid != '') {
cmd = get_eavesdrop_cmd(ext, chan_uuid, document.getElementById('eavesdrop_dest').value);
if (cmd != '') {
send_cmd(cmd)
}
}
}
//record call
function record_call(chan_uuid) {
if (chan_uuid != '') {
cmd = get_record_cmd(chan_uuid);
if (cmd != '') {
send_cmd(cmd);
}
}
}
//used by call control and ajax refresh functions
function send_cmd(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
}
//hide/show destination input field
function toggle_destination(ext, which) {
refresh_stop();
if (which == 'call') {
if ($('#destination_'+ext+'_call').is(':visible')) {
$('#destination_'+ext+'_call').val('');
$('#destination_'+ext+'_call').autocomplete('destroy');
$('#destination_'+ext+'_call').hide(0, function() {
$('.call_control').children().attr('onmouseout', "refresh_start();");
$('.destination_control').attr('onmouseout', "refresh_start();");
refresh_start();
});
}
else {
$('#destination_'+ext+'_call').show(0, function() {
$('#destination_'+ext+'_call').trigger('focus');
$('#destination_'+ext+'_call').autocomplete({
source: "autocomplete.php",
minLength: 3,
select: function(event, ui) {
$('#destination_'+ext+'_call').val(ui.item.value);
$('#frm_destination_'+ext+'_call').submit();
}
});
$('.call_control').children().removeAttr('onmouseout');
$('.destination_control').removeAttr('onmouseout');
});
}
}
else if (which == 'transfer') {
if ($('#destination_'+ext+'_transfer').is(':visible')) {
$('#destination_'+ext+'_transfer').val('');
$('#destination_'+ext+'_transfer').autocomplete('destroy');
$('#destination_'+ext+'_transfer').hide(0, function() {
$('#op_caller_details_'+ext).show();
$('.call_control').children().attr('onmouseout', "refresh_start();");
$('.destination_control').attr('onmouseout', "refresh_start();");
refresh_start();
});
}
else {
$('#op_caller_details_'+ext).hide(0, function() {
$('#destination_'+ext+'_transfer').show(0, function() {
$('#destination_'+ext+'_transfer').trigger('focus');
$('#destination_'+ext+'_transfer').autocomplete({
source: "autocomplete.php",
minLength: 3,
select: function(event, ui) {
$('#destination_'+ext+'_transfer').val(ui.item.value);
$('#frm_destination_'+ext+'_transfer').submit();
}
});
$('.call_control').children().removeAttr('onmouseout');
$('.destination_control').removeAttr('onmouseout');
});
});
}
}
}
function get_transfer_cmd(uuid, destination) {
url = "exec.php?cmd=uuid_transfer&uuid=" + uuid + "&destination=" + destination
return url;
}
function get_originate_cmd(source, destination) {
url = "exec.php?cmd=originate&source=" + source + "&destination=" + destination
return url;
}
function get_eavesdrop_cmd(ext, chan_uuid, destination) {
url = "exec.php?cmd=uuid_eavesdrop&ext=" + ext + "&chan_uuid=" + chan_uuid + "&destination=" + destination;
return url;
}
function get_record_cmd(uuid) {
url = "exec.php?cmd=uuid_record&uuid=" + uuid;
return url;
}
//virtual functions
function virtual_drag(call_id, ext) {
if (document.getElementById('vd_ext_from').value != '' && document.getElementById('vd_ext_to').value != '') {
virtual_drag_reset();
}
if (call_id != '') {
document.getElementById('vd_call_id').value = call_id;
}
if (ext != '') {
if (document.getElementById('vd_ext_from').value == '') {
document.getElementById('vd_ext_from').value = ext;
document.getElementById(ext).style.borderStyle = 'dotted';
if (document.getElementById('vd_ext_to').value != '') {
document.getElementById(document.getElementById('vd_ext_to').value).style.borderStyle = '';
document.getElementById('vd_ext_to').value = '';
}
}
else {
document.getElementById('vd_ext_to').value = ext;
if (document.getElementById('vd_ext_from').value != document.getElementById('vd_ext_to').value) {
if (document.getElementById('vd_call_id').value != '') {
cmd = get_transfer_cmd(document.getElementById('vd_call_id').value, document.getElementById('vd_ext_to').value); //transfer a call
}
else {
cmd = get_originate_cmd(document.getElementById('vd_ext_from').value, document.getElementById('vd_ext_to').value); //originate a call
}
if (cmd != '') {
//alert(cmd);
send_cmd(cmd);
}
}
virtual_drag_reset();
}
}
}
function virtual_drag_reset(vd_var) {
if (!(vd_var === undefined)) {
document.getElementById(vd_var).value = '';
}
else {
document.getElementById('vd_call_id').value = '';
if (document.getElementById('vd_ext_from').value != '') {
document.getElementById(document.getElementById('vd_ext_from').value).style.borderStyle = '';
document.getElementById('vd_ext_from').value = '';
}
if (document.getElementById('vd_ext_to').value != '') {
document.getElementById(document.getElementById('vd_ext_to').value).style.borderStyle = '';
document.getElementById('vd_ext_to').value = '';
}
}
}
</script>
<style type="text/css">
TABLE {
border-spacing: 0px;
border-collapse: collapse;
border: none;
}
</style>
<?php
//create simple array of users own extensions
unset($_SESSION['user']['extensions']);
if (is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $assigned_extensions) {
$_SESSION['user']['extensions'][] = $assigned_extensions['user'];
}
}
?>
<div id='ajax_reponse'></div>
<div id='cmd_reponse' style='display: none;'></div>
<br><br>
<?php
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,257 @@
<?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-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
/**
* Define the operator_panel class
*/
if (!class_exists('basic_operator_panel')) {
class basic_operator_panel {
/**
* Define the variables
*/
public $domain_uuid;
/**
* Called when the object is created
*/
public function __construct() {
if (!isset($this->domain_uuid)) {
$this->domain_uuid = $_SESSION['domain_uuid'];
}
}
/**
* Called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* Get the call activity
*/
public function call_activity() {
//define the global variable
global $ext_user_status;
//get the extensions and their user status
$sql = "select ";
$sql .= "e.extension, ";
$sql .= "e.number_alias, ";
$sql .= "e.effective_caller_id_name, ";
$sql .= "lower(e.effective_caller_id_name) as filter_name, ";
$sql .= "e.effective_caller_id_number, ";
$sql .= "e.call_group, ";
$sql .= "e.description, ";
$sql .= "u.user_uuid, ";
$sql .= "u.user_status ";
$sql .= "from ";
$sql .= "v_extensions as e ";
$sql .= "left outer join v_extension_users as eu on ( eu.extension_uuid = e.extension_uuid and eu.domain_uuid = :domain_uuid ) ";
$sql .= "left outer join v_users as u on ( u.user_uuid = eu.user_uuid and u.domain_uuid = :domain_uuid ) ";
$sql .= "where ";
$sql .= "e.enabled = 'true' and ";
$sql .= "e.domain_uuid = :domain_uuid ";
$sql .= "order by ";
$sql .= "e.extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$extensions = $database->select($sql, $parameters);
//store extension status by user uuid
if (isset($extensions)) {
foreach($extensions as &$row) {
if ($row['user_uuid'] != '') {
$ext_user_status[$row['user_uuid']] = $row['user_status'];
unset($row['user_status']);
}
}
}
//send the command
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_result = event_socket_request($fp, 'api show channels as json');
$json_array = json_decode($switch_result, true);
}
//build the response
$x = 0;
if (isset($extensions)) {
foreach($extensions as &$row) {
$user = $row['extension'];
if (strlen($row['number_alias']) >0 ) {
$user = $row['number_alias'];
}
//add the extension details
$array[$x] = $row;
//set the call detail defaults
$array[$x]["uuid"] = null;
$array[$x]["direction"] = null;
$array[$x]["created"] = null;
$array[$x]["created_epoch"] = null;
$array[$x]["name"] = null;
$array[$x]["state"] = null;
$array[$x]["cid_name"] = null;
$array[$x]["cid_num"] = null;
$array[$x]["ip_addr"] = null;
$array[$x]["dest"] = null;
$array[$x]["application"] = null;
$array[$x]["application_data"] = null;
$array[$x]["dialplan"] = null;
$array[$x]["context"] = null;
$array[$x]["read_codec"] = null;
$array[$x]["read_rate"] = null;
$array[$x]["read_bit_rate"] = null;
$array[$x]["write_codec"] = null;
$array[$x]["write_rate"] = null;
$array[$x]["write_bit_rate"] = null;
$array[$x]["secure"] = null;
$array[$x]["hostname"] = null;
$array[$x]["presence_id"] = null;
$array[$x]["presence_data"] = null;
$array[$x]["callstate"] = null;
$array[$x]["callee_name"] = null;
$array[$x]["callee_num"] = null;
$array[$x]["callee_direction"] = null;
$array[$x]["call_uuid"] = null;
$array[$x]["sent_callee_name"] = null;
$array[$x]["sent_callee_num"] = null;
$array[$x]["destination"] = null;
//add the active call details
$found = false;
if (isset($json_array['rows'])) {
foreach($json_array['rows'] as &$field) {
$presence_id = $field['presence_id'];
$presence = explode("@", $presence_id);
$presence_id = $presence[0];
$presence_domain = $presence[1];
if ($user == $presence_id) {
if ($presence_domain == $_SESSION['domain_name']) {
$found = true;
break;
}
}
}
}
//normalize the array
if ($found) {
$array[$x]["uuid"] = $field['uuid'];
$array[$x]["direction"] = $field['direction'];
$array[$x]["created"] = $field['created'];
$array[$x]["created_epoch"] = $field['created_epoch'];
$array[$x]["name"] = $field['name'];
$array[$x]["state"] = $field['state'];
$array[$x]["cid_name"] = $field['cid_name'];
$array[$x]["cid_num"] = $field['cid_num'];
$array[$x]["ip_addr"] = $field['ip_addr'];
$array[$x]["dest"] = $field['dest'];
$array[$x]["application"] = $field['application'];
$array[$x]["application_data"] = $field['application_data'];
$array[$x]["dialplan"] = $field['dialplan'];
$array[$x]["context"] = $field['context'];
$array[$x]["read_codec"] = $field['read_codec'];
$array[$x]["read_rate"] = $field['read_rate'];
$array[$x]["read_bit_rate"] = $field['read_bit_rate'];
$array[$x]["write_codec"] = $field['write_codec'];
$array[$x]["write_rate"] = $field['write_rate'];
$array[$x]["write_bit_rate"] = $field['write_bit_rate'];
$array[$x]["secure"] = $field['secure'];
$array[$x]["hostname"] = $field['hostname'];
$array[$x]["presence_id"] = $field['presence_id'];
$array[$x]["presence_data"] = $field['presence_data'];
$array[$x]["callstate"] = $field['callstate'];
$array[$x]["callee_name"] = $field['callee_name'];
$array[$x]["callee_num"] = $field['callee_num'];
$array[$x]["callee_direction"] = $field['callee_direction'];
$array[$x]["call_uuid"] = $field['call_uuid'];
$array[$x]["sent_callee_name"] = $field['sent_callee_name'];
$array[$x]["sent_callee_num"] = $field['sent_callee_num'];
$array[$x]["destination"] = $user;
//calculate and set the call length
$call_length_seconds = time() - $array[$x]["created_epoch"];
$call_length_hour = floor($call_length_seconds/3600);
$call_length_min = floor($call_length_seconds/60 - ($call_length_hour * 60));
$call_length_sec = $call_length_seconds - (($call_length_hour * 3600) + ($call_length_min * 60));
$call_length_min = sprintf("%02d", $call_length_min);
$call_length_sec = sprintf("%02d", $call_length_sec);
$call_length = $call_length_hour.':'.$call_length_min.':'.$call_length_sec;
$array[$x]['call_length'] = $call_length;
//send the command
if ($field['state'] != '') {
if ($fp) {
if (is_uuid($field['uuid'])) {
$switch_cmd = 'uuid_dump '.$field['uuid'].' json';
$dump_result = event_socket_request($fp, 'api '.$switch_cmd);
$dump_array = json_decode($dump_result, true);
if (is_array($dump_array)) {
foreach ($dump_array as $dump_var_name => $dump_var_value) {
$array[$x][$dump_var_name] = $dump_var_value;
}
}
}
}
}
}
//increment the row
$x++;
}
}
//reindex array using extension instead of auto-incremented value
$result = array();
if (is_array($array)) {
foreach ($array as $index => $subarray) {
$extension = $subarray['extension'];
if (is_array($subarray)) foreach ($subarray as $field => $value) {
$result[$extension][$field] = $array[$index][$field];
unset($array[$index][$field]);
}
unset($array[$subarray['extension']]['extension']);
unset($array[$index]);
}
}
//return array
return $result;
}
}
}
?>

View File

@ -0,0 +1,678 @@
<?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-2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('operator_panel_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get(null,'app/basic_operator_panel');
//get the call activity
$operator_panel = new basic_operator_panel;
$activity = $operator_panel->call_activity();
if (is_array($activity)) {
foreach ($activity as $extension => $fields) {
if (substr_count($fields['call_group'], ',')) {
$tmp = explode(',', $fields['call_group']);
if (is_array($tmp)) foreach ($tmp as $tmp_index => $tmp_value) {
if (trim($tmp_value) == '') { unset($tmp[$tmp_index]); }
else { $groups[] = $tmp_value; }
}
}
else if ($fields['call_group'] != '') {
$groups[] = $fields['call_group'];
}
}
}
if (is_array($groups)) {
$groups = array_unique($groups);
sort($groups);
}
//get the valet info
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$valet_info = event_socket_request($fp, 'api valet_info park@'.$_SESSION['domain_name']);
//get an array of the valet call uuid and park numbers
if (isset($valet_info)) {
preg_match_all('/<extension uuid=\"(.*?)\">(.*?)<\/extension>/s', $valet_info, $valet_matches, PREG_SET_ORDER);
//view_array($valet_matches, false);
}
//view_array($valet_matches, false);
//unset($_SESSION['valet']);
foreach($valet_matches as $row) {
if (!isset($_SESSION['valet']['uuid']['caller_id_name'])) {
$_SESSION['valet'][$row[1]]['caller_id_name'] = event_socket_request($fp, 'api uuid_getvar '.$row[1].' caller_id_name');
}
if (!isset($_SESSION['valet']['uuid']['caller_id_number'])) {
$_SESSION['valet'][$row[1]]['caller_id_number'] = event_socket_request($fp, 'api uuid_getvar '.$row[1].' caller_id_number');
}
}
//unset the array
//view_array($_SESSION['valet']);
//reformat the array and add the caller ID name and numbers
$x = 0;
foreach($valet_matches as $row) {
$valet_array[$x]['uuid'] = $row[1];
$valet_array[$x]['extension'] = $row[2];
if (isset($_SESSION['valet'][$row[1]]['caller_id_name'])) {
$valet_array[$x]['caller_id_name'] = $_SESSION['valet'][$row[1]]['caller_id_name'];
}
if (isset($_SESSION['valet'][$row[1]]['caller_id_number'])) {
$valet_array[$x]['caller_id_number'] = $_SESSION['valet'][$row[1]]['caller_id_number'];
}
$x++;
}
//view_array($valet, false);
}
//prevent warnings
if (!is_array($_SESSION['user']['extensions'])) {
$_SESSION['user']['extensions'] = array();
}
//get registrations -- All SIP profiles
$obj = new registrations;
$registrations = $obj->get("all");
//set the onhover paush refresh
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
echo "<table width='100%'>\n";
echo " <tr>\n";
echo " <td valign='top' align='left' width='50%' nowrap>\n";
echo " <b>".$text['title-operator_panel']."</b>\n";
echo " </td>\n";
echo " <td valign='top' align='center' nowrap>\n";
if (permission_exists("user_setting_edit") && sizeof($_SESSION['user']['extensions']) > 0) {
$status_options[1]['status'] = "Available";
$status_options[1]['label'] = $text['label-status_available'];
$status_options[1]['style'] = "op_btn_status_available";
if (permission_exists('operator_panel_on_demand')) {
$status_options[2]['status'] = "Available (On Demand)";
$status_options[2]['label'] = $text['label-status_on_demand'];
$status_options[2]['style'] = "op_btn_status_available_on_demand";
}
$status_options[3]['status'] = "On Break";
$status_options[3]['label'] = $text['label-status_on_break'];
$status_options[3]['style'] = "op_btn_status_on_break";
$status_options[4]['status'] = "Do Not Disturb";
$status_options[4]['label'] = $text['label-status_do_not_disturb'];
$status_options[4]['style'] = "op_btn_status_do_not_disturb";
$status_options[5]['status'] = "Logged Out";
$status_options[5]['label'] = $text['label-status_logged_out'];
$status_options[5]['style'] = "op_btn_status_logged_out";
if (is_array($status_options)) foreach ($status_options as $status_option) {
echo " <input type='button' id='".$status_option['style']."' class='btn' value=\"".$status_option['label']."\" onclick=\"send_cmd('index.php?status='+escape('".$status_option['status']."')); this.disabled='disabled'; refresh_start();\" ".$onhover_pause_refresh.">\n";
}
}
echo " </td>\n";
echo " <td valign='top' align='right' width='50%' nowrap>\n";
echo " <table cellpadding='0' cellspacing='0' border='0'>\n";
echo " <tr>\n";
echo " <td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>\n";
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">\n";
echo " </td>\n";
if (permission_exists('operator_panel_eavesdrop')) {
echo " <td valign='top' nowrap='nowrap'>\n";
if (sizeof($_SESSION['user']['extensions']) > 1) {
echo " <input type='hidden' id='eavesdrop_dest' value=\"".(($_REQUEST['eavesdrop_dest'] == '') ? $_SESSION['user']['extension'][0]['destination'] : escape($_REQUEST['eavesdrop_dest']))."\">\n";
echo " <img src='resources/images/eavesdrop.png' style='width: 12px; height: 12px; border: none; margin: 0px 5px; cursor: help;' title='".$text['description-eavesdrop_destination']."' align='absmiddle'>\n";
echo " <select class='formfld' style='margin-right: 5px;' align='absmiddle' onchange=\"document.getElementById('eavesdrop_dest').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
if (is_array($_SESSION['user']['extensions'])) foreach ($_SESSION['user']['extensions'] as $user_extension) {
echo " <option value='".escape($user_extension)."' ".(($_REQUEST['eavesdrop_dest'] == $user_extension) ? "selected" : null).">".escape($user_extension)."</option>\n";
}
echo " </select>\n";
}
else if (sizeof($_SESSION['user']['extensions']) == 1) {
echo " <input type='hidden' id='eavesdrop_dest' value=\"".escape($_SESSION['user']['extension'][0]['destination'])."\">\n";
}
echo " </td>\n";
}
if (is_array($groups) && @sizeof($groups) > 0) {
echo " <td valign='top' nowrap='nowrap'>\n";
echo " <input type='hidden' id='group' value=\"".escape($_REQUEST['group'])."\">\n";
if (sizeof($groups) > 5) {
//show select box
echo " <select class='formfld' onchange=\"document.getElementById('group').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <option value='' ".(($_REQUEST['group'] == '') ? "selected" : null).">".$text['label-call_group']."</option>\n";
echo " <option value=''>".$text['button-all']."</option>\n";
if (is_array($groups)) foreach ($groups as $group) {
echo " <option value='".escape($group)."' ".(($_REQUEST['group'] == $group) ? "selected" : null).">".escape($group)."</option>\n";
}
echo " </select>\n";
}
else {
//show buttons
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".$text['button-all']."\" onclick=\"document.getElementById('group').value = '';\" ".$onhover_pause_refresh.">\n";
if (is_array($groups)) foreach ($groups as $group) {
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".escape($group)."\" ".(($_REQUEST['group'] == $group) ? "disabled='disabled'" : null)." onclick=\"document.getElementById('group').value = this.value;\" ".$onhover_pause_refresh.">\n";
}
}
echo " </td>\n";
}
echo " <td valign='top' nowrap='nowrap'>\n";
echo " <input type='hidden' id='extension_filter' value=\"".escape($_REQUEST['extension_filter'])."\">\n";
echo " <input type='hidden' id='name_filter' value=\"".strtolower(escape($_REQUEST['name_filter']))."\">\n";
echo " <input type='text' class='formfld' placeholder='Filter Extension' value=\"".escape($_REQUEST['extension_filter'])."\" onkeyup=\"document.getElementById('extension_filter').value = this.value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <input type='text' class='formfld' placeholder='Filter Name' value=\"".strtolower(escape($_REQUEST['name_filter']))."\" onkeyup=\"document.getElementById('name_filter').value = this.value; refresh_start();\" onfocus='refresh_stop();'>\n";
echo " <input type='button' class='btn' title=\"Clear\" value=\"Clear\" onclick=\"document.getElementById('extension_filter').value = ''; document.getElementById('name_filter').value = '';\" ".$onhover_pause_refresh.">\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<br>\n";
//define the arrays to ensure no errors are omitted below with the sizeof operators
$user_extensions = array();
$grouped_extensions = array();
$other_extensions = array();
//loop through the array
if (is_array($activity)) {
foreach ($activity as $extension => $ext) {
unset($block);
//filter by group, if defined
if ($_REQUEST['group'] != '' && substr_count($ext['call_group'], $_REQUEST['group']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
//filter by extension or name, if defined
if ($_REQUEST['extension_filter'] != '' && substr_count($ext['extension'], $_REQUEST['extension_filter']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
if ($_REQUEST['name_filter'] != '' && substr_count($ext['filter_name'], $_REQUEST['name_filter']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
//check if feature code being called
$format_number = (substr($ext['dest'], 0, 1) == '*') ? false : true;
//determine extension state, direction icon, and displayed name/number for caller/callee
if ($ext['state'] == 'CS_EXECUTE') {
if (($ext['callstate'] == 'RINGING' || $ext['callstate'] == 'EARLY' || $ext['callstate'] == 'RING_WAIT') && $ext['direction'] == 'inbound') {
$ext_state = 'ringing';
}
else if ($ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['callstate'] == 'HELD' && $ext['direction'] == 'outbound') {
$ext_state = 'held';
}
else if ($ext['callstate'] == 'RING_WAIT' && $ext['direction'] == 'outbound') {
$ext_state = 'ringing';
}
else if ($ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'inbound') {
$ext_state = 'active';
}
else if ($ext['callstate'] == 'HELD' && $ext['direction'] == 'inbound') {
$ext_state = 'held';
}
if (!$format_number) {
$call_name = 'System';
$call_number = $ext['dest'];
}
else {
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
$dir_icon = 'outbound';
}
else if ($ext['state'] == 'CS_HIBERNATE') {
if ($ext['callstate'] == 'ACTIVE') {
$ext_state = 'active';
if ($ext['direction'] == 'inbound') {
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
$dir_icon = 'outbound';
}
else if ($ext['direction'] == 'outbound') {
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
$call_number = format_phone($ext['cid_num']);
$dir_icon = 'inbound';
}
}
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'inbound') {
//valet park
$ext_state = 'active';
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
else if ($ext['state'] == 'CS_SOFT_EXECUTE' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
//valet park
$ext_state = 'active';
$call_name = $activity[$ext['dest']]['effective_caller_id_name'];
$call_number = format_phone($ext['dest']);
}
else if ($ext['state'] == 'CS_CONSUME_MEDIA' || $ext['state'] == 'CS_EXCHANGE_MEDIA') {
if ($ext['state'] == 'CS_CONSUME_MEDIA' && $ext['callstate'] == 'RINGING' && $ext['direction'] == 'outbound') {
$ext_state = 'ringing';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'ACTIVE' && $ext['direction'] == 'outbound') {
$ext_state = 'active';
}
else if ($ext['state'] == 'CS_CONSUME_MEDIA' && $ext['callstate'] == 'HELD' && $ext['direction'] == 'outbound') {
$ext_state = 'held';
}
else if ($ext['state'] == 'CS_EXCHANGE_MEDIA' && $ext['callstate'] == 'HELD' && $ext['direction'] == 'outbound') {
$ext_state = 'held';
}
$dir_icon = 'inbound';
$call_name = $activity[$ext['cid_num']]['effective_caller_id_name'];
$call_number = format_phone($ext['cid_num']);
}
else {
unset($ext_state, $dir_icon, $call_name, $call_number);
}
//determin extension register status
$extension_number = $extension.'@'.$_SESSION['domain_name'];
$found_count = 0;
if (is_array($registrations)) {
foreach ($registrations as $array) {
if ($extension_number == $array['user']) {
$found_count++;
}
}
}
if ($found_count > 0) {
//determine block style by state (if any) and register status
$style = ($ext_state != '') ? "op_ext op_state_".$ext_state : "op_ext";
} else {
$style = "off_ext";
}
unset($extension_number, $found_count, $array);
//determine the call identifier passed on drop
if ($ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') { // transfer an outbound internal call
$call_identifier = $activity[$call_number]['uuid'];
}
else if (($ext['variable_call_direction'] == 'outbound' || $ext['variable_call_direction'] == 'local') && $ext['variable_bridge_uuid'] != '') { // transfer an outbound external call
$call_identifier = $ext['variable_bridge_uuid'];
}
else {
if( $ext['call_uuid'] ) {
$call_identifier = $ext['call_uuid']; // transfer all other call types
}
else {
$call_identifier = $ext['uuid']; // e.g. voice menus
}
}
//determine extension draggable state
if (permission_exists('operator_panel_manage')) {
if (!in_array($extension, $_SESSION['user']['extensions'])) {
//other extension
if ($ext_state == "ringing") {
if ($_GET['vd_ext_from'] == '' && $dir_icon == 'inbound') {
$draggable = true; // selectable - is ringing and not outbound so can transfer away the call (can set as vd_ext_from)
}
else {
$draggable = false; // unselectable - is ringing so can't send a call to the ext (can't set as vd_ext_to)
}
}
else if ($ext_state == 'active') {
$draggable = false; // unselectable - on a call already so can't transfer or send a call to the ext (can't set as vd_ext_from or vd_ext_to)
}
else { // idle
if ($_GET['vd_ext_from'] == '') {
$draggable = false; // unselectable - is idle, but can't initiate a call from the ext as is not assigned to user (can't set as vd_ext_from)
}
else {
$draggable = true; // selectable - is idle, so can transfer a call in to ext (can set as vd_ext_to).
}
}
}
else {
//user extension
if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') {
$draggable = false;
}
else if ($ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') {
$draggable = false;
}
else if ($ext_state != '' && !$format_number) {
$draggable = false;
}
else {
$draggable = true;
}
}
}
else {
$draggable = false;
}
//determine extension (user) status
$ext_status = (in_array($extension, $_SESSION['user']['extensions'])) ? $ext_user_status[$_SESSION['user_uuid']] : $ext_user_status[$ext['user_uuid']];
switch ($ext_status) {
case "Available" :
$status_icon = "available";
$status_hover = $text['label-status_available'];
break;
case "Available (On Demand)" :
$status_icon = "available_on_demand";
$status_hover = $text['label-status_available_on_demand'];
break;
case "On Break" :
$status_icon = "on_break";
$status_hover = $text['label-status_on_break'];
break;
case "Do Not Disturb" :
$status_icon = "do_not_disturb";
$status_hover = $text['label-status_do_not_disturb'];
break;
default :
$status_icon = "logged_out";
$status_hover = $text['label-status_logged_out_or_unknown'];
}
//build the list of extensions
$block .= "<div id='".escape($extension)."' class='".$style."' ".(($_GET['vd_ext_from'] == $extension || $_GET['vd_ext_to'] == $extension) ? "style='border-style: dotted;'" : null)." ".(($ext_state != 'active' && $ext_state != 'ringing') ? "ondrop='drop(event, this.id);' ondragover='allowDrop(event, this.id);' ondragleave='discardDrop(event, this.id);'" : null).">"; // DRAG TO
$block .= "<table class='".$style."'>\n";
$block .= " <tr>\n";
$block .= " <td class='op_ext_icon'>\n";
$block .= " <span name='".escape($extension)."'>\n"; // DRAG FROM
$block .= "<img id='".escape($call_identifier)."' class='op_ext_icon' src='resources/images/status_".$status_icon.".png' title='".$status_hover."' ".(($draggable) ? "draggable='true' ondragstart=\"drag(event, this.parentNode.getAttribute('name'));\" onclick=\"virtual_drag('".escape($call_identifier)."', '".escape($extension)."');\"" : "onfocus='this.blur();' draggable='false' style='cursor: not-allowed;'").">\n";
$block .= "</span>\n";
$block .= " </td>\n";
$block .= " <td class='op_ext_info ".$style."'>\n";
if ($dir_icon != '') {
$block .= " <img src='resources/images/".$dir_icon.".png' align='right' style='margin-top: 3px; margin-right: 1px; width: 12px; height: 12px; cursor: help;' draggable='false' alt=\"".$text['label-call_direction']."\" title=\"".$text['label-call_direction']."\">\n";
}
$block .= " <span class='op_user_info'>\n";
if ($ext['effective_caller_id_name'] != '' && escape($ext['effective_caller_id_name']) != $extension) {
$block .= " <strong class='strong'>".escape($ext['effective_caller_id_name'])."</strong> (".escape($extension).")\n";
}
else {
$block .= " <strong class='strong'>".escape($extension)."</strong>\n";
}
$block .= " </span><br>\n";
if ($ext_state != '') {
$block .= " <span class='op_caller_info'>\n";
$block .= " <table align='right'><tr><td style='text-align: right;'>\n";
$block .= " <span class='op_call_info'>".escape($ext['call_length'])."</span><br>\n";
$block .= " <span class='call_control'>\n";
//record
if (permission_exists('operator_panel_record') && $ext_state == 'active') {
$call_identifier_record = $ext['call_uuid'];
$rec_file = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/".escape($call_identifier_record).".wav";
if (file_exists($rec_file)) {
$block .= "<img src='resources/images/recording.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: help;' title=\"".$text['label-recording']."\" ".$onhover_pause_refresh.">\n";
}
else {
$block .= "<img src='resources/images/record.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title=\"".$text['label-record']."\" onclick=\"record_call('".$call_identifier_record."');\" ".$onhover_pause_refresh.">\n";
}
}
//eavesdrop
if (permission_exists('operator_panel_eavesdrop') && $ext_state == 'active' && sizeof($_SESSION['user']['extensions']) > 0 && !in_array($extension, $_SESSION['user']['extensions'])) {
$block .= "<img src='resources/images/eavesdrop.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title='".$text['label-eavesdrop']."' onclick=\"eavesdrop_call('".escape($ext['destination'])."','".escape($call_identifier)."');\" ".$onhover_pause_refresh.">\n";
}
//hangup
if (permission_exists('operator_panel_hangup') || in_array($extension, $_SESSION['user']['extensions'])) {
if ($ext['variable_bridge_uuid'] == '' && $ext_state == 'ringing') {
$call_identifier_hangup_uuid = $ext['uuid'];
}
else if ($dir_icon == 'outbound') {
$call_identifier_hangup_uuid = $ext['uuid'];
}
else {
$call_identifier_hangup_uuid = $call_identifier;
}
$block .= "<img src='resources/images/kill.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' title='".$text['label-hangup']."' onclick=\"hangup_call('".escape($call_identifier_hangup_uuid)."');\" ".$onhover_pause_refresh.">\n";
}
$block .= "</span>\n";
//transfer
if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$block .= "<img id='destination_control_".escape($extension)."_transfer' class='destination_control' src='resources/images/keypad_transfer.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' onclick=\"toggle_destination('".escape($extension)."', 'transfer');\" ".$onhover_pause_refresh.">\n";
}
$block .= " </td></tr></table>\n";
if (permission_exists('operator_panel_call_details')) {
$block .= " <span id='op_caller_details_".escape($extension)."'><strong>".escape($call_name)."</strong><br>".escape($call_number)."</span>\n";
}
$block .= " </span>\n";
//transfer
if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$call_identifier_transfer = $ext['variable_bridge_uuid'];
$block .= " <form id='frm_destination_".escape($extension)."_transfer' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_transfer').value, 'transfer', '".escape($call_identifier_transfer)."'); return false;\">\n";
$block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_transfer' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 3px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'transfer');\">\n";
$block .= " </form>\n";
}
}
else {
//call
if (in_array($extension, $_SESSION['user']['extensions'])) {
$block .= " <img id='destination_control_".escape($extension)."_call' class='destination_control' src='resources/images/keypad_call.png' style='width: 12px; height: 12px; border: none; margin-top: 26px; margin-right: 1px; cursor: pointer;' align='right' onclick=\"toggle_destination('".escape($extension)."', 'call');\" ".$onhover_pause_refresh.">\n";
$block .= " <form id='frm_destination_".escape($extension)."_call' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_call').value, 'call'); return false;\">\n";
$block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_call' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 10px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'call');\">\n";
$block .= " </form>\n";
}
}
$block .= " </td>\n";
$block .= " </tr>\n";
$block .= "</table>\n";
if (if_group("superadmin") && isset($_GET['debug'])) {
$block .= "<span style='font-size: 10px;'>\n";
$block .= "From ID<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: maroon'>".escape($extension)."</strong><br>\n";
$block .= "uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['uuid'] ? 'blue' : 'black').";'>".escape($ext['uuid'])."</strong><br>\n";
$block .= "call_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['call_uuid'] ? 'blue' : 'black').";'>".escape($ext['call_uuid'])."</strong><br>\n";
$block .= "variable_bridge_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['variable_bridge_uuid'] ? 'blue' : 'black').";'>".escape($ext['variable_bridge_uuid'])."</strong><br>\n";
$block .= "direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['direction'])."</strong><br>\n";
$block .= "variable_call_direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['variable_call_direction'])."</strong><br>\n";
$block .= "state<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['state'])."</strong><br>\n";
$block .= "cid_num<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['cid_num'])."</strong><br>\n";
$block .= "dest<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['dest'])."</strong><br>\n";
$block .= "context<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['context'])."</strong><br>\n";
$block .= "presence_id<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['presence_id'])."</strong><br>\n";
$block .= "callstate<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['callstate'])."</strong><br>\n";
$block .= "</span>\n";
}
$block .= "</div>\n";
if (in_array($extension, $_SESSION['user']['extensions'])) {
$user_extensions[] = $block;
} elseif (!empty($ext['call_group']) && filter_var($_SESSION['operator_panel']['group_extensions']['boolean'], FILTER_VALIDATE_BOOLEAN)) {
$grouped_extensions[$ext['call_group']][] = $block;
} else {
$other_extensions[] = $block;
}
}
}
if (sizeof($user_extensions) > 0) {
echo "<table width='100%'><tr><td>\n";
if (is_array($user_extensions)) {
foreach ($user_extensions as $ext_block) {
echo $ext_block;
}
}
foreach($valet_array as $row) {
$extension = $row['extension'];
$ext_state = 'active';
$style = "op_ext op_valet_park_active";
$draggable = false;
//build the list of park extensions
$valet_block .= "<div id='".escape($extension)."' class='".$style."' ".(($_GET['vd_ext_from'] == $extension || $_GET['vd_ext_to'] == $extension) ? "style='border-style: dotted;'" : null)." ondrop='drop(event, this.id);' ondragover='allowDrop(event, this.id);' ondragleave='discardDrop(event, this.id);'>\n"; // DRAG TO
$valet_block .= "<table class='".$style."'>\n";
$valet_block .= " <tr>\n";
$valet_block .= " <td class='op_ext_icon'>\n";
$valet_block .= " <span name='".escape($extension)."'>"; // DRAG FROM
$valet_block .= "<img id='".escape($call_identifier)."' class='op_ext_icon' src='resources/images/status_".$status_icon.".png' title='".$status_hover."' ".(($draggable) ? "draggable='true' ondragstart=\"drag(event, this.parentNode.getAttribute('name'));\" onclick=\"virtual_drag('".escape($call_identifier)."', '".escape($extension)."');\"" : "onfocus='this.blur();' draggable='false' style='cursor: not-allowed;'").">\n";
$valet_block .= "</span>\n";
$valet_block .= " </td>\n";
$valet_block .= " <td class='op_ext_info ".$style."'>\n";
if ($dir_icon != '') {
$valet_block .= " <img src='resources/images/".$dir_icon.".png' align='right' style='margin-top: 3px; margin-right: 1px; width: 12px; height: 12px; cursor: help;' draggable='false' alt=\"".$text['label-call_direction']."\" title=\"".$text['label-call_direction']."\">\n";
}
$valet_block .= " <span class='op_user_info'>\n";
//$valet_block .= " <strong class='strong'>".escape($extension)."</strong>";
$valet_block .= " <strong class='strong'>Park </strong> (".escape($extension).")\n";
$valet_block .= " </span><br>\n";
//if ($ext_state != '') {
$valet_block .= " <span class='op_caller_info'>\n";
$valet_block .= " <table align='right'><tr><td style='text-align: right;'>\n";
$valet_block .= " <span class='op_call_info'>".escape($ext['call_length'])."</span><br>\n";
$valet_block .= " <span class='call_control'>\n";
$call_identifier_record = $ext['call_uuid'];
$valet_block .= "</span>\n";
//transfer
//if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
// $valet_block .= "<img id='destination_control_".escape($extension)."_transfer' class='destination_control' src='resources/images/keypad_transfer.png' style='width: 12px; height: 12px; border: none; margin: 4px 0px 0px 5px; cursor: pointer;' onclick=\"toggle_destination('".escape($extension)."', 'transfer');\" ".$onhover_pause_refresh.">";
//}
$valet_block .= " </td></tr></table>\n";
if (permission_exists('operator_panel_call_details')) {
$valet_block .= " <span id='op_caller_details_".escape($extension)."'><strong>".escape($row['caller_id_name'])."</strong><br>".escape($row['caller_id_number'])."</span>\n";
}
$valet_block .= " </span>\n";
//transfer
//if (in_array($extension, $_SESSION['user']['extensions']) && $ext_state == 'active') {
$call_identifier_transfer = $ext['variable_bridge_uuid'];
$valet_block .= " <form id='frm_destination_".escape($extension)."_transfer' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_transfer').value, 'transfer', '".escape($call_identifier_transfer)."'); return false;\">\n";
$valet_block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_transfer' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 3px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'transfer');\">\n";
$valet_block .= " </form>\n";
//}
//}
//else {
// //call
// if (in_array($extension, $_SESSION['user']['extensions'])) {
// $valet_block .= " <img id='destination_control_".escape($extension)."_call' class='destination_control' src='resources/images/keypad_call.png' style='width: 12px; height: 12px; border: none; margin-top: 26px; margin-right: 1px; cursor: pointer;' align='right' onclick=\"toggle_destination('".escape($extension)."', 'call');\" ".$onhover_pause_refresh.">";
// $valet_block .= " <form id='frm_destination_".escape($extension)."_call' onsubmit=\"go_destination('".escape($extension)."', document.getElementById('destination_".escape($extension)."_call').value, 'call'); return false;\">";
// $valet_block .= " <input type='text' class='formfld' id='destination_".escape($extension)."_call' style='width: 100px; min-width: 100px; max-width: 100px; margin-top: 10px; text-align: center; display: none;' onblur=\"toggle_destination('".escape($extension)."', 'call');\">";
// $valet_block .= " </form>\n";
// }
//}
$valet_block .= " </td>\n";
$valet_block .= " </tr>\n";
$valet_block .= "</table>\n";
if (if_group("superadmin") && isset($_GET['debug'])) {
$valet_block .= "<span style='font-size: 10px;'>\n";
$valet_block .= "From ID<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: maroon'>".escape($extension)."</strong><br>\n";
$valet_block .= "uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['uuid'] ? 'blue' : 'black').";'>".escape($ext['uuid'])."</strong><br>\n";
$valet_block .= "call_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['call_uuid'] ? 'blue' : 'black').";'>".escape($ext['call_uuid'])."</strong><br>\n";
$valet_block .= "variable_bridge_uuid<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: ".($call_identifier == $ext['variable_bridge_uuid'] ? 'blue' : 'black').";'>".escape($ext['variable_bridge_uuid'])."</strong><br>\n";
$valet_block .= "direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['direction'])."</strong><br>\n";
$valet_block .= "variable_call_direction<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['variable_call_direction'])."</strong><br>\n";
$valet_block .= "state<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['state'])."</strong><br>\n";
$valet_block .= "cid_num<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['cid_num'])."</strong><br>\n";
$valet_block .= "dest<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['dest'])."</strong><br>\n";
$valet_block .= "context<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['context'])."</strong><br>\n";
$valet_block .= "presence_id<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['presence_id'])."</strong><br>\n";
$valet_block .= "callstate<br>&nbsp;&nbsp;&nbsp;&nbsp;<strong style='color: black;'>".escape($ext['callstate'])."</strong><br>\n";
$valet_block .= "</span>\n";
}
$valet_block .= "</div>\n";
echo $valet_block;
unset($valet_block);
}
echo "</td></tr></table><br>\n";
}
//loop throug each group
if (sizeof($grouped_extensions) > 0) {
//alphabetical order
ksort($grouped_extensions);
//loop through the groups
foreach ($grouped_extensions as $group => $extensions) {
echo "<div class=\"heading\"><strong>".ucwords(escape($group))."</strong></div>\n";
echo "<br><br>\n";
echo "<table width='100%'><tr><td>\n";
foreach ($extensions as $ext_block) {
echo $ext_block;
}
echo "</td></tr></table><br>\n";
}
}
//show the other extensions
if (sizeof($other_extensions) > 0) {
echo "<div class=\"heading\"><strong>".$text['label-other_extensions']."</strong></div>\n";
echo "<br><br>\n";
echo "<table width='100%'><tr><td>\n";
foreach ($other_extensions as $ext_block) {
echo $ext_block;
}
echo "</td></tr></table>\n";
}
//no extensions found
if (sizeof($other_extensions) + sizeof($grouped_extensions) < 1) {
echo $text['label-no_extensions_found'];
}
echo "<br><br>\n";
/*
if (if_group("superadmin") && isset($_GET['debug'])) {
echo '$activity<br>';
echo "<textarea style='width: 100%; height: 600px; overflow: scroll;' onfocus='refresh_stop();' onblur='refresh_start();'>";
print_r($activity);
echo "</textarea>";
echo "<br><br>";
echo '$_SESSION<br>';
echo "<textarea style='width: 100%; height: 600px; overflow: scroll;' onfocus='refresh_stop();' onblur='refresh_start();'>";
print_r($_SESSION);
echo "</textarea>";
}
*/
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,90 @@
<?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>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,90 @@
<?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>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,97 @@
<?php
//application details
$apps[$x]['name'] = 'Bridges';
$apps[$x]['uuid'] = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$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'] = '';
$apps[$x]['description']['en-gb'] = '';
//permission details
$y = 0;
$apps[$x]['permissions'][$y]['name'] = 'bridge_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'bridge_destinations';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
//destination details
$y = 0;
$apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "bridges";
$apps[$x]['destinations'][$y]['name'] = "bridges";
//$apps[$x]['destinations'][$y]['sql'] = "select bridge_name, bridge_destination, bridge_description from v_bridges ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and bridge_enabled = 'true'";
$apps[$x]['destinations'][$y]['order_by'] = "bridge_name asc";
$apps[$x]['destinations'][$y]['field']['bridge_uuid'] = "bridge_uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "bridge_name";
$apps[$x]['destinations'][$y]['field']['description'] = "bridge_description";
$apps[$x]['destinations'][$y]['field']['destination'] = "bridge_destination";
$apps[$x]['destinations'][$y]['select_value']['user_contact'] = "\${destination}";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "bridge:\${destination}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:bridge \${destination}";
$apps[$x]['destinations'][$y]['select_label'] = "\${name} \${description} ";
$y++;
//Bridges
$y = 0;
$apps[$x]['db'][$y]['table']['name'] = 'v_bridges';
$apps[$x]['db'][$y]['table']['parent'] = '';
$z = 0;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_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'] = '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'] = 'bridge_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the name.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_destination';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the destination.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_enabled';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select to enable or disable.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
$z++;
?>

View File

@ -0,0 +1,257 @@
<?php
//Bridges
$text['title-bridges']['en-us'] = 'Bridges';
$text['title-bridges']['en-gb'] = 'Bridges';
$text['title-bridges']['ar-eg'] = '';
$text['title-bridges']['de-at'] = '';
$text['title-bridges']['de-ch'] = '';
$text['title-bridges']['de-de'] = '';
$text['title-bridges']['es-cl'] = '';
$text['title-bridges']['es-mx'] = '';
$text['title-bridges']['fr-ca'] = 'Ponts';
$text['title-bridges']['fr-fr'] = 'Ponts';
$text['title-bridges']['he-il'] = '';
$text['title-bridges']['it-it'] = '';
$text['title-bridges']['nl-nl'] = 'Bruggen';
$text['title-bridges']['pl-pl'] = 'Mostki';
$text['title-bridges']['pt-br'] = '';
$text['title-bridges']['pt-pt'] = '';
$text['title-bridges']['ro-ro'] = '';
$text['title-bridges']['ru-ru'] = '';
$text['title-bridges']['sv-se'] = '';
$text['title-bridges']['uk-ua'] = '';
$text['title-bridge']['en-us'] = 'Bridge';
$text['title-bridge']['en-gb'] = 'Bridge';
$text['title-bridge']['ar-eg'] = '';
$text['title-bridge']['de-at'] = '';
$text['title-bridge']['de-ch'] = '';
$text['title-bridge']['de-de'] = '';
$text['title-bridge']['es-cl'] = '';
$text['title-bridge']['es-mx'] = '';
$text['title-bridge']['fr-ca'] = 'Pont';
$text['title-bridge']['fr-fr'] = 'Pont';
$text['title-bridge']['he-il'] = '';
$text['title-bridge']['it-it'] = '';
$text['title-bridge']['nl-nl'] = 'Brug';
$text['title-bridge']['pl-pl'] = 'Mostek';
$text['title-bridge']['pt-br'] = '';
$text['title-bridge']['pt-pt'] = '';
$text['title-bridge']['ro-ro'] = '';
$text['title-bridge']['ru-ru'] = '';
$text['title-bridge']['sv-se'] = '';
$text['title-bridge']['uk-ua'] = '';
$text['title_description-bridge']['en-us'] = 'Add bridge statements to destination select list.';
$text['title_description-bridge']['en-gb'] = 'Add bridge statements to destination select list.';
$text['title_description-bridge']['ar-eg'] = '';
$text['title_description-bridge']['de-at'] = '';
$text['title_description-bridge']['de-ch'] = '';
$text['title_description-bridge']['de-de'] = '';
$text['title_description-bridge']['es-cl'] = '';
$text['title_description-bridge']['es-mx'] = '';
$text['title_description-bridge']['fr-ca'] = 'Ajouter des déclarations de pont à la liste de sélection';
$text['title_description-bridge']['fr-fr'] = 'Ajouter des déclarations de pont à la liste de sélection';
$text['title_description-bridge']['he-il'] = '';
$text['title_description-bridge']['it-it'] = '';
$text['title_description-bridge']['nl-nl'] = 'Voeg brug opdrachten toe aan bestemmings lijst.';
$text['title_description-bridge']['pl-pl'] = 'Dodaj wyrażenia mostkowania do listy wyboru destynacji.';
$text['title_description-bridge']['pt-br'] = '';
$text['title_description-bridge']['pt-pt'] = '';
$text['title_description-bridge']['ro-ro'] = '';
$text['title_description-bridge']['ru-ru'] = '';
$text['title_description-bridge']['sv-se'] = '';
$text['title_description-bridge']['uk-ua'] = '';
$text['label-bridge_name']['en-us'] = 'Name';
$text['label-bridge_name']['en-gb'] = 'Name';
$text['label-bridge_name']['ar-eg'] = '';
$text['label-bridge_name']['de-at'] = '';
$text['label-bridge_name']['de-ch'] = '';
$text['label-bridge_name']['de-de'] = '';
$text['label-bridge_name']['es-cl'] = '';
$text['label-bridge_name']['es-mx'] = '';
$text['label-bridge_name']['fr-ca'] = 'Nom';
$text['label-bridge_name']['fr-fr'] = 'Nom';
$text['label-bridge_name']['he-il'] = '';
$text['label-bridge_name']['it-it'] = '';
$text['label-bridge_name']['nl-nl'] = 'Naam';
$text['label-bridge_name']['pl-pl'] = 'Nazwa';
$text['label-bridge_name']['pt-br'] = '';
$text['label-bridge_name']['pt-pt'] = '';
$text['label-bridge_name']['ro-ro'] = '';
$text['label-bridge_name']['ru-ru'] = '';
$text['label-bridge_name']['sv-se'] = '';
$text['label-bridge_name']['uk-ua'] = '';
$text['description-bridge_name']['en-us'] = 'Enter the name.';
$text['description-bridge_name']['en-gb'] = 'Enter the name.';
$text['description-bridge_name']['ar-eg'] = '';
$text['description-bridge_name']['de-at'] = '';
$text['description-bridge_name']['de-ch'] = '';
$text['description-bridge_name']['de-de'] = '';
$text['description-bridge_name']['es-cl'] = '';
$text['description-bridge_name']['es-mx'] = '';
$text['description-bridge_name']['fr-ca'] = 'Entrez le nom';
$text['description-bridge_name']['fr-fr'] = 'Entrez le nom';
$text['description-bridge_name']['he-il'] = '';
$text['description-bridge_name']['it-it'] = '';
$text['description-bridge_name']['nl-nl'] = 'Voer naam in.';
$text['description-bridge_name']['pl-pl'] = 'Wprowadź nazwę.';
$text['description-bridge_name']['pt-br'] = '';
$text['description-bridge_name']['pt-pt'] = '';
$text['description-bridge_name']['ro-ro'] = '';
$text['description-bridge_name']['ru-ru'] = '';
$text['description-bridge_name']['sv-se'] = '';
$text['description-bridge_name']['uk-ua'] = '';
$text['label-bridge_destination']['en-us'] = 'Destination';
$text['label-bridge_destination']['en-gb'] = 'Destination';
$text['label-bridge_destination']['ar-eg'] = '';
$text['label-bridge_destination']['de-at'] = '';
$text['label-bridge_destination']['de-ch'] = '';
$text['label-bridge_destination']['de-de'] = '';
$text['label-bridge_destination']['es-cl'] = '';
$text['label-bridge_destination']['es-mx'] = '';
$text['label-bridge_destination']['fr-ca'] = 'Destination';
$text['label-bridge_destination']['fr-fr'] = 'Destination';
$text['label-bridge_destination']['he-il'] = '';
$text['label-bridge_destination']['it-it'] = '';
$text['label-bridge_destination']['nl-nl'] = 'Bestemming';
$text['label-bridge_destination']['pl-pl'] = 'Destynacja';
$text['label-bridge_destination']['pt-br'] = '';
$text['label-bridge_destination']['pt-pt'] = '';
$text['label-bridge_destination']['ro-ro'] = '';
$text['label-bridge_destination']['ru-ru'] = '';
$text['label-bridge_destination']['sv-se'] = '';
$text['label-bridge_destination']['uk-ua'] = '';
$text['description-bridge_destination']['en-us'] = 'Enter the destination.';
$text['description-bridge_destination']['en-gb'] = 'Enter the destination.';
$text['description-bridge_destination']['ar-eg'] = '';
$text['description-bridge_destination']['de-at'] = '';
$text['description-bridge_destination']['de-ch'] = '';
$text['description-bridge_destination']['de-de'] = '';
$text['description-bridge_destination']['es-cl'] = '';
$text['description-bridge_destination']['es-mx'] = '';
$text['description-bridge_destination']['fr-ca'] = 'Entrer la destination';
$text['description-bridge_destination']['fr-fr'] = 'Entrer la destination';
$text['description-bridge_destination']['he-il'] = '';
$text['description-bridge_destination']['it-it'] = '';
$text['description-bridge_destination']['nl-nl'] = 'Voer de bestemming in.';
$text['description-bridge_destination']['pl-pl'] = 'Wprowadź destynację.';
$text['description-bridge_destination']['pt-br'] = '';
$text['description-bridge_destination']['pt-pt'] = '';
$text['description-bridge_destination']['ro-ro'] = '';
$text['description-bridge_destination']['ru-ru'] = '';
$text['description-bridge_destination']['sv-se'] = '';
$text['description-bridge_destination']['uk-ua'] = '';
$text['label-bridge_enabled']['en-us'] = 'Enabled';
$text['label-bridge_enabled']['en-gb'] = 'Enabled';
$text['label-bridge_enabled']['ar-eg'] = '';
$text['label-bridge_enabled']['de-at'] = '';
$text['label-bridge_enabled']['de-ch'] = '';
$text['label-bridge_enabled']['de-de'] = '';
$text['label-bridge_enabled']['es-cl'] = '';
$text['label-bridge_enabled']['es-mx'] = '';
$text['label-bridge_enabled']['fr-ca'] = 'Activé';
$text['label-bridge_enabled']['fr-fr'] = 'Activé';
$text['label-bridge_enabled']['he-il'] = '';
$text['label-bridge_enabled']['it-it'] = '';
$text['label-bridge_enabled']['nl-nl'] = 'Geactiveerd';
$text['label-bridge_enabled']['pl-pl'] = 'Aktywny';
$text['label-bridge_enabled']['pt-br'] = '';
$text['label-bridge_enabled']['pt-pt'] = '';
$text['label-bridge_enabled']['ro-ro'] = '';
$text['label-bridge_enabled']['ru-ru'] = '';
$text['label-bridge_enabled']['sv-se'] = '';
$text['label-bridge_enabled']['uk-ua'] = '';
$text['description-bridge_enabled']['en-us'] = 'Select to enable or disable.';
$text['description-bridge_enabled']['en-gb'] = 'Select to enable or disable.';
$text['description-bridge_enabled']['ar-eg'] = '';
$text['description-bridge_enabled']['de-at'] = '';
$text['description-bridge_enabled']['de-ch'] = '';
$text['description-bridge_enabled']['de-de'] = '';
$text['description-bridge_enabled']['es-cl'] = '';
$text['description-bridge_enabled']['es-mx'] = '';
$text['description-bridge_enabled']['fr-ca'] = 'Sélectionnez pour activer ou désactiver';
$text['description-bridge_enabled']['fr-fr'] = 'Sélectionnez pour activer ou désactiver';
$text['description-bridge_enabled']['he-il'] = '';
$text['description-bridge_enabled']['it-it'] = '';
$text['description-bridge_enabled']['nl-nl'] = 'Kies aktiveer/deactiveer.';
$text['description-bridge_enabled']['pl-pl'] = 'Wybierz czy aktywować lub dezaktywować.';
$text['description-bridge_enabled']['pt-br'] = '';
$text['description-bridge_enabled']['pt-pt'] = '';
$text['description-bridge_enabled']['ro-ro'] = '';
$text['description-bridge_enabled']['ru-ru'] = '';
$text['description-bridge_enabled']['sv-se'] = '';
$text['description-bridge_enabled']['uk-ua'] = '';
$text['label-bridge_description']['en-us'] = 'Description';
$text['label-bridge_description']['en-gb'] = 'Description';
$text['label-bridge_description']['ar-eg'] = '';
$text['label-bridge_description']['de-at'] = '';
$text['label-bridge_description']['de-ch'] = '';
$text['label-bridge_description']['de-de'] = '';
$text['label-bridge_description']['es-cl'] = '';
$text['label-bridge_description']['es-mx'] = '';
$text['label-bridge_description']['fr-ca'] = 'La description';
$text['label-bridge_description']['fr-fr'] = 'La description';
$text['label-bridge_description']['he-il'] = '';
$text['label-bridge_description']['it-it'] = '';
$text['label-bridge_description']['nl-nl'] = 'Omschrijving';
$text['label-bridge_description']['pl-pl'] = 'Opis';
$text['label-bridge_description']['pt-br'] = '';
$text['label-bridge_description']['pt-pt'] = '';
$text['label-bridge_description']['ro-ro'] = '';
$text['label-bridge_description']['ru-ru'] = '';
$text['label-bridge_description']['sv-se'] = '';
$text['label-bridge_description']['uk-ua'] = '';
$text['description-bridge_description']['en-us'] = 'Enter the description. ';
$text['description-bridge_description']['en-gb'] = 'Enter the description. ';
$text['description-bridge_description']['ar-eg'] = '';
$text['description-bridge_description']['de-at'] = '';
$text['description-bridge_description']['de-ch'] = '';
$text['description-bridge_description']['de-de'] = '';
$text['description-bridge_description']['es-cl'] = '';
$text['description-bridge_description']['es-mx'] = '';
$text['description-bridge_description']['fr-ca'] = 'Entrez la description';
$text['description-bridge_description']['fr-fr'] = 'Entrez la description';
$text['description-bridge_description']['he-il'] = '';
$text['description-bridge_description']['it-it'] = '';
$text['description-bridge_description']['nl-nl'] = 'Voer omschrijving in.';
$text['description-bridge_description']['pl-pl'] = 'Wprowadź opis.';
$text['description-bridge_description']['pt-br'] = '';
$text['description-bridge_description']['pt-pt'] = '';
$text['description-bridge_description']['ro-ro'] = '';
$text['description-bridge_description']['ru-ru'] = '';
$text['description-bridge_description']['sv-se'] = '';
$text['description-bridge_description']['uk-ua'] = '';
$text['label-bridge_description']['en-us'] = "Description";
$text['label-bridge_description']['en-gb'] = "Description";
$text['label-bridge_description']['ar-eg'] = "";
$text['label-bridge_description']['de-at'] = "Beschreibung"; //copied from de-de
$text['label-bridge_description']['de-ch'] = "Beschreibung"; //copied from de-de
$text['label-bridge_description']['de-de'] = "Beschreibung";
$text['label-bridge_description']['es-cl'] = "Descripción";
$text['label-bridge_description']['es-mx'] = "Descripción"; //copied from es-cl
$text['label-bridge_description']['fr-ca'] = "Description"; //copied from fr-fr
$text['label-bridge_description']['fr-fr'] = "Description";
$text['label-bridge_description']['he-il'] = "";
$text['label-bridge_description']['it-it'] = "Descrizione";
$text['label-bridge_description']['nl-nl'] = "Omschrijving";
$text['label-bridge_description']['pl-pl'] = "Opis";
$text['label-bridge_description']['pt-br'] = "Descrição";
$text['label-bridge_description']['pt-pt'] = "Descripção";
$text['label-bridge_description']['ro-ro'] = "";
$text['label-bridge_description']['ru-ru'] = "Описание";
$text['label-bridge_description']['sv-se'] = "Beskrivning";
$text['label-bridge_description']['uk-ua'] = "Опис";
$text['label-bridge_description']['tr-tr'] = "ıklama";
?>

21
app/bridges/app_menu.php Normal file
View File

@ -0,0 +1,21 @@
<?php
$apps[$x]['menu'][0]['title']['en-us'] = 'Bridges';
$apps[$x]['menu'][0]['title']['en-gb'] = 'Bridges';
$apps[$x]['menu'][0]['title']['es-cl'] = '';
$apps[$x]['menu'][0]['title']['fr-fr'] = '';
$apps[$x]['menu'][0]['title']['fr-ca'] = '';
$apps[$x]['menu'][0]['title']['nl-nl'] = 'Bruggen';
$apps[$x]['menu'][0]['title']['pl'] = 'Mostkowania';
$apps[$x]['menu'][0]['title']['sv-se'] = '';
$apps[$x]['menu'][0]['title']['uk'] = '';
$apps[$x]['menu'][0]['title']['de-at'] = '';
$apps[$x]['menu'][0]['uuid'] = '345f0aad-8321-4a8b-9f08-c4730297660c';
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
$apps[$x]['menu'][0]['category'] = 'internal';
$apps[$x]['menu'][0]['path'] = '/app/bridges/bridges.php';
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//$apps[$x]['menu'][0]['groups'][] = 'admin';
//$apps[$x]['menu'][0]['groups'][] = 'user';
?>

261
app/bridges/bridge_edit.php Normal file
View File

@ -0,0 +1,261 @@
<?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) 2018 - 2019
the Initial Developer. All Rights Reserved.
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (!permission_exists('bridge_add') && !permission_exists('bridge_edit')) {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$bridge_uuid = $_REQUEST["id"];
$id = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
$bridge_uuid = $_POST["bridge_uuid"];
$bridge_name = $_POST["bridge_name"];
$bridge_destination = $_POST["bridge_destination"];
$bridge_enabled = $_POST["bridge_enabled"];
$bridge_description = $_POST["bridge_description"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//delete the bridge
if (permission_exists('bridge_delete')) {
if ($_POST['action'] == 'delete' && is_uuid($bridge_uuid)) {
//prepare
$array[0]['checked'] = 'true';
$array[0]['uuid'] = $bridge_uuid;
//delete
$obj = new bridges;
$obj->delete($array);
//redirect
header('Location: bridges.php');
exit;
}
}
//get the uuid from the POST
if ($action == "update") {
$bridge_uuid = $_POST["bridge_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: bridges.php');
exit;
}
//check for all required data
$msg = '';
if (strlen($bridge_name) == 0) { $msg .= $text['message-required']." ".$text['label-bridge_name']."<br>\n"; }
if (strlen($bridge_destination) == 0) { $msg .= $text['message-required']." ".$text['label-bridge_destination']."<br>\n"; }
if (strlen($bridge_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-bridge_enabled']."<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 the bridge_uuid
if (strlen($bridge_uuid) == 0) {
$bridge_uuid = uuid();
}
//prepare the array
$array['bridges'][0]['bridge_uuid'] = $bridge_uuid;
$array['bridges'][0]['domain_uuid'] = $_SESSION["domain_uuid"];
$array['bridges'][0]['bridge_name'] = $bridge_name;
$array['bridges'][0]['bridge_destination'] = $bridge_destination;
$array['bridges'][0]['bridge_enabled'] = $bridge_enabled;
$array['bridges'][0]['bridge_description'] = $bridge_description;
//save to the data
$database = new database;
$database->app_name = 'bridges';
$database->app_uuid = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$database->save($array);
$message = $database->message;
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//redirect the user
if (isset($action)) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
}
header('Location: bridges.php');
return;
}
}
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
$bridge_uuid = $_GET["id"];
$sql = "select * from v_bridges ";
$sql .= "where bridge_uuid = :bridge_uuid ";
$parameters['bridge_uuid'] = $bridge_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) {
$bridge_name = $row["bridge_name"];
$bridge_destination = $row["bridge_destination"];
$bridge_enabled = $row["bridge_enabled"];
$bridge_description = $row["bridge_description"];
}
unset($sql, $parameters, $row);
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
$document['title'] = $text['title-bridge'];
require_once "resources/header.php";
//show the content
echo "<form name='frm' id='frm' method='post'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-bridge']."</b></div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'bridges.php']);
if ($action == 'update' && permission_exists('bridge_delete')) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','name'=>'action','value'=>'save']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if ($action == 'update' && permission_exists('bridge_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-bridge_name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_name' maxlength='255' value='".escape($bridge_name)."'>\n";
echo "<br />\n";
echo $text['description-bridge_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-bridge_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_destination' maxlength='255' value='".escape($bridge_destination)."'>\n";
echo "<br />\n";
echo $text['description-bridge_destination']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-bridge_enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select class='formfld' name='bridge_enabled'>\n";
if ($bridge_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($bridge_enabled == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-bridge_enabled']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-bridge_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_description' maxlength='255' value=\"".escape($bridge_description)."\">\n";
echo "<br />\n";
echo $text['description-bridge_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
if ($action == "update") {
echo "<input type='hidden' name='bridge_uuid' value='".escape($bridge_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>

265
app/bridges/bridges.php Normal file
View File

@ -0,0 +1,265 @@
<?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) 2018 - 2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('bridge_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//get the http post data
if (is_array($_POST['bridges'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$bridges = $_POST['bridges'];
}
//process the http post data by action
if ($action != '' && is_array($bridges) && @sizeof($bridges) != 0) {
switch ($action) {
case 'copy':
if (permission_exists('bridge_add')) {
$obj = new bridges;
$obj->copy($bridges);
}
break;
case 'toggle':
if (permission_exists('bridge_edit')) {
$obj = new bridges;
$obj->toggle($bridges);
}
break;
case 'delete':
if (permission_exists('bridge_delete')) {
$obj = new bridges;
$obj->delete($bridges);
}
break;
}
header('Location: bridges.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//get order and order by
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//add the search string
if (isset($_GET["search"])) {
$search = strtolower($_GET["search"]);
$sql_search = " (";
$sql_search .= " lower(bridge_name) like :search ";
$sql_search .= " or lower(bridge_destination) like :search ";
$sql_search .= " or lower(bridge_enabled) like :search ";
$sql_search .= " or lower(bridge_description) like :search ";
$sql_search .= ") ";
$parameters['search'] = '%'.$search.'%';
}
//get the count
$sql = "select count(bridge_uuid) from v_bridges ";
if ($_GET['show'] == "all" && permission_exists('bridge_all')) {
if (isset($sql_search)) {
$sql .= "where ".$sql_search;
}
}
else {
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
if (isset($sql_search)) {
$sql .= "and ".$sql_search;
}
$parameters['domain_uuid'] = $domain_uuid;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = $search ? "&search=".$search : null;
$param = ($_GET['show'] == 'all' && permission_exists('bridge_all')) ? "&show=all" : null;
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
$offset = $rows_per_page * $page;
//get the list
$sql = str_replace('count(bridge_uuid)', '*', $sql);
$sql .= order_by($order_by, $order, 'bridge_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$bridges = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//include the header
$document['title'] = $text['title-bridges'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-bridges']." (".$num_rows.")</b></div>\n";
echo " <div class='actions'>\n";
if (permission_exists('bridge_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','link'=>'bridge_edit.php']);
}
if (permission_exists('bridge_add') && $bridges) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
}
if (permission_exists('bridge_edit') && $bridges) {
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display: none;','onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
}
if (permission_exists('bridge_delete') && $bridges) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('bridge_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>\n";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'bridges.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
}
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
if (permission_exists('bridge_add') && $bridges) {
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
}
if (permission_exists('bridge_edit') && $bridges) {
echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle'); list_form_submit('form_list');"])]);
}
if (permission_exists('bridge_delete') && $bridges) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
}
echo $text['title_description-bridge']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('bridge_add') || permission_exists('bridge_edit') || permission_exists('bridge_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($bridges ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == 'all' && permission_exists('bridge_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
}
echo th_order_by('bridge_name', $text['label-bridge_name'], $order_by, $order);
echo th_order_by('bridge_destination', $text['label-bridge_destination'], $order_by, $order);
echo th_order_by('bridge_enabled', $text['label-bridge_enabled'], $order_by, $order, null, "class='center'");
echo " <th class='hide-sm-dn'>".$text['label-bridge_description']."</th>\n";
if (permission_exists('bridge_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($bridges) && @sizeof($bridges) != 0) {
$x = 0;
foreach ($bridges as $row) {
if (permission_exists('bridge_edit')) {
$list_row_url = "bridge_edit.php?id=".urlencode($row['bridge_uuid']);
}
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (permission_exists('bridge_add') || permission_exists('bridge_edit') || permission_exists('bridge_delete')) {
echo " <td class='checkbox'>\n";
echo " <input type='checkbox' name='bridges[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"checkbox_on_change(this); if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
echo " <input type='hidden' name='bridges[$x][uuid]' value='".escape($row['bridge_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == 'all' && permission_exists('bridge_all')) {
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
}
echo " <td>\n";
if (permission_exists('bridge_edit')) {
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['bridge_name'])."</a>\n";
}
else {
echo " ".escape($row['bridge_name']);
}
echo " </td>\n";
echo " <td>".escape($row['bridge_destination'])."</td>\n";
if (permission_exists('bridge_edit')) {
echo " <td class='no-link center'>\n";
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['bridge_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
}
else {
echo " <td class='center'>\n";
echo $text['label-'.$row['bridge_enabled']];
}
echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['bridge_description'])."</td>\n";
if (permission_exists('bridge_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
$x++;
}
unset($bridges);
}
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@ -0,0 +1,270 @@
<?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-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//define the bridges class
if (!class_exists('bridges')) {
class bridges {
/**
* declare private variables
*/
private $app_name;
private $app_uuid;
private $permission_prefix;
private $list_page;
private $table;
private $uuid_prefix;
private $toggle_field;
private $toggle_values;
/**
* called when the object is created
*/
public function __construct() {
//assign private variables
$this->app_name = 'bridges';
$this->app_uuid = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
$this->permission_prefix = 'bridge_';
$this->list_page = 'bridges.php';
$this->table = 'bridges';
$this->uuid_prefix = 'bridge_';
$this->toggle_field = 'bridge_enabled';
$this->toggle_values = ['true','false'];
}
/**
* called when there are no references to a particular object
* unset the variables used in the class
*/
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
/**
* delete records
*/
public function delete($records) {
if (permission_exists($this->permission_prefix.'delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//delete multiple records
if (is_array($records) && @sizeof($records) != 0) {
//build the delete array
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
}
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->delete($array);
unset($array);
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//set message
message::add($text['message-delete']);
}
unset($records);
}
}
}
/**
* toggle records
*/
public function toggle($records) {
if (permission_exists($this->permission_prefix.'edit')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//toggle the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
$states[$row['uuid']] = $row['toggle'];
}
}
unset($sql, $parameters, $rows, $row);
}
//build update array
$x = 0;
foreach ($states as $uuid => $state) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
$x++;
}
//save the changes
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
//set message
message::add($text['message-toggle']);
}
unset($records, $states);
}
}
}
/**
* copy records
*/
public function copy($records) {
if (permission_exists($this->permission_prefix.'add')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: '.$this->list_page);
exit;
}
//copy the checked records
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach ($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
//create insert array from existing data
if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select * from v_".$this->table." ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) {
//copy data
$array[$this->table][$x] = $row;
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = uuid();
$array[$this->table][$x]['bridge_description'] = trim($row['bridge_description'].' ('.$text['label-copy'].')');
}
}
unset($sql, $parameters, $rows, $row);
}
//save the changes and set the message
if (is_array($array) && @sizeof($array) != 0) {
//save the array
$database = new database;
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
unset($array);
//set message
message::add($text['message-copy']);
}
unset($records);
}
}
}
}
}
?>

90
app/bridges/root.php Normal file
View File

@ -0,0 +1,90 @@
<?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) 2018
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
umask(2);
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false) {
define("PATH_SEPARATOR", ";");
} else {
define("PATH_SEPARATOR", ":");
}
}
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
if(PHP_SAPI == 'cli'){
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
}
$_SERVER["DOCUMENT_ROOT"] = $path;
}else{
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
}
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
// try to detect if a project path is being used
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
$i = 1;
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);
}
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
}
?>

View File

@ -0,0 +1,170 @@
<?php
//application details
$apps[$x]['name'] = "Call Block";
$apps[$x]['uuid'] = "9ed63276-e085-4897-839c-4f2e36d92d6c";
$apps[$x]['category'] = "Switch";
$apps[$x]['subcategory'] = "";
$apps[$x]['version'] = "1.0";
$apps[$x]['license'] = "Mozilla Public License 1.1";
$apps[$x]['url'] = "http://www.fusionpbx.com";
$apps[$x]['description']['en-us'] = "A tool to block incoming numbers.";
$apps[$x]['description']['en-gb'] = "A tool to block incoming numbers.";
$apps[$x]['description']['ar-eg'] = "";
$apps[$x]['description']['de-at'] = "Ein Werkzeug um eingehende Rufnummern zu sperren.";
$apps[$x]['description']['de-ch'] = "";
$apps[$x]['description']['de-de'] = "Ein Werkzeug um eingehende Rufnummern zu sperren.";
$apps[$x]['description']['el-gr'] = "Εργαλείο για αποκλεισμό εισερχόμενων κλήσεων από συγκεκριμένους αριθμούς.";
$apps[$x]['description']['es-cl'] = "Una herramineta para bloquear números entrantes";
$apps[$x]['description']['es-mx'] = "";
$apps[$x]['description']['fr-ca'] = "Outil pour bloquer des numéros d'appelant.";
$apps[$x]['description']['fr-fr'] = "Outil pour bloquer des numéros d'appelant.";
$apps[$x]['description']['he-il'] = "";
$apps[$x]['description']['it-it'] = "";
$apps[$x]['description']['nl-nl'] = "Gereedschap om inkommende nummers te blokkeren.";
$apps[$x]['description']['pl-pl'] = "";
$apps[$x]['description']['pt-br'] = "Uma ferramenta para bloquear números que entram.";
$apps[$x]['description']['pt-pt'] = "Uma ferramenta para bloquear números indesejados";
$apps[$x]['description']['ro-ro'] = "";
$apps[$x]['description']['ru-ru'] = "";
$apps[$x]['description']['sv-se'] = "";
$apps[$x]['description']['uk-ua'] = "";
//default settings
$y=0;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e8356e52-3d18-4da5-93b1-9b2e08878982";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_block";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "recent_call_limit";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "50";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Number of recent calls to show.";
//permission details
$y=0;
$apps[$x]['permissions'][$y]['name'] = "call_block_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "29295c90-b1b9-440b-9c7E-c8363c6e8975";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_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'] = "call_block_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_extension";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_ivr";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_ring_group";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_block_voicemail";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "view_call_block";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
//schema details
$y=0;
$apps[$x]['db'][$y]['table']['name'] = "v_call_block";
$apps[$x]['db'][$y]['table']['parent'] = "";
$z=0;
$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";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_uuid";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_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']['text'] = "call_block_direction";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the direction of the calls to block.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "extension_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_extensions";
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "extension_uuid";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_name";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_country_code";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the country code.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_number";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_number";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the phone number.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_count";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_call_count";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Number of calls.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_action";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_call_action";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Action for call.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_app";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Application";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_data";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Data";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "date_added";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Date/Time number was added.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_enabled";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "block_call_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable/disable blocking the call.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_block_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
?>

View File

@ -0,0 +1,51 @@
<?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) 2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
if ($domains_processed == 1) {
//create a view for call block
$database = new database;
$database->execute("DROP VIEW view_call_block;", null);
$sql = "CREATE VIEW view_call_block AS ( \n";
$sql .= " select c.domain_uuid, call_block_uuid, c.call_block_direction, c.extension_uuid, c.call_block_name, c.call_block_country_code, \n";
$sql .= " c.call_block_number, e.extension, e.number_alias, c.call_block_count, c.call_block_app, c.call_block_data, c.date_added, c.call_block_enabled, c.call_block_description \n";
$sql .= " from v_call_block as c \n";
$sql .= " left join v_extensions as e \n";
$sql .= " on c.extension_uuid = e.extension_uuid \n";
$sql .= "); \n";
$database = new database;
$database->execute($sql, null);
unset($sql);
//set call blocks to inbound if no direction defined
$sql = "update v_call_block set call_block_direction = 'inbound' where call_block_direction is null ";
$database = new database;
$database->execute($sql, null);
unset($sql);
}
?>

View File

@ -0,0 +1,965 @@
<?php
#This file was last reorganized on 19th of September 2017 08:54:24 AM UTC
$text['title-call-block']['en-us'] = "Call Block";
$text['title-call-block']['en-gb'] = "Call Block";
$text['title-call-block']['ar-eg'] = "حظر المكالمات";
$text['title-call-block']['de-at'] = "Sperrlisten"; //copied from de-de
$text['title-call-block']['de-ch'] = "Sperrlisten"; //copied from de-de
$text['title-call-block']['de-de'] = "Sperrlisten";
$text['title-call-block']['el-gr'] = "Λίστα αποκλεισμών";
$text['title-call-block']['es-cl'] = "Bloqueo de llamadas";
$text['title-call-block']['es-mx'] = "Bloqueo de llamadas"; //copied from es-cl
$text['title-call-block']['fr-ca'] = "Filtrage d'appel"; //copied from fr-fr
$text['title-call-block']['fr-fr'] = "Filtrage d'appel";
$text['title-call-block']['he-il'] = "חסימת מספר";
$text['title-call-block']['it-it'] = "Blocco Chiamate";
$text['title-call-block']['nl-nl'] = "Oproep blokkade";
$text['title-call-block']['pl-pl'] = "Blokowanie rozmów";
$text['title-call-block']['pt-br'] = "Bloqueio de chamadas";
$text['title-call-block']['pt-pt'] = "Bloqueio de Chamadas";
$text['title-call-block']['ro-ro'] = "Blocare apel";
$text['title-call-block']['ru-ru'] = "Черный список";
$text['title-call-block']['sv-se'] = "Blockera Samtal";
$text['title-call-block']['uk-ua'] = "Блокування дзвінків";
$text['heading-recent_calls']['en-us'] = "Recent Calls";
$text['heading-recent_calls']['en-gb'] = "Recent Calls";
$text['heading-recent_calls']['ar-eg'] = "";
$text['heading-recent_calls']['de-at'] = "Kürzliche Anrufe"; //copied from de-de
$text['heading-recent_calls']['de-ch'] = "Kürzliche Anrufe"; //copied from de-de
$text['heading-recent_calls']['de-de'] = "Kürzliche Anrufe";
$text['heading-recent_calls']['el-gr'] = "Πρόσφατες Κλήσεις";
$text['heading-recent_calls']['es-cl'] = "Llamadas Recientes";
$text['heading-recent_calls']['es-mx'] = "Llamadas Recientes"; //copied from es-cl
$text['heading-recent_calls']['fr-ca'] = "Appels récents"; //copied from fr-fr
$text['heading-recent_calls']['fr-fr'] = "Appels récents";
$text['heading-recent_calls']['he-il'] = "שיחות אחרונות";
$text['heading-recent_calls']['it-it'] = "Chiamate Recenti";
$text['heading-recent_calls']['nl-nl'] = "Recente oproepen";
$text['heading-recent_calls']['pl-pl'] = "Ostatnie rozmowy";
$text['heading-recent_calls']['pt-br'] = "Chamadas recentes";
$text['heading-recent_calls']['pt-pt'] = "Chamadas Recentes";
$text['heading-recent_calls']['ro-ro'] = "Apeluri recente";
$text['heading-recent_calls']['ru-ru'] = "Недавние вызовы";
$text['heading-recent_calls']['sv-se'] = "Senaste Samtal";
$text['heading-recent_calls']['uk-ua'] = "Останні дзвінки";
$text['heading-block_recent_calls']['en-us'] = "Block Recent Calls";
$text['heading-block_recent_calls']['en-gb'] = "Block Recent Calls";
$text['heading-block_recent_calls']['ar-eg'] = "";
$text['heading-block_recent_calls']['de-at'] = "Kürzliche Anrufe Blockieren"; //copied from de-de
$text['heading-block_recent_calls']['de-ch'] = "Kürzliche Anrufe Blockieren"; //copied from de-de
$text['heading-block_recent_calls']['de-de'] = "Kürzliche Anrufe Blockieren";
$text['heading-block_recent_calls']['el-gr'] = "Αποκλεισμός Πρόσφατης Κλήσης";
$text['heading-block_recent_calls']['es-cl'] = "Bloqueo de llamadas recientes";
$text['heading-block_recent_calls']['es-mx'] = "Bloqueo de llamadas recientes"; //copied from es-cl
$text['heading-block_recent_calls']['fr-ca'] = "Bloquer appels récents"; //copied from fr-fr
$text['heading-block_recent_calls']['fr-fr'] = "Bloquer appels récents";
$text['heading-block_recent_calls']['he-il'] = "";
$text['heading-block_recent_calls']['it-it'] = "Blocca le chiamate recenti";
$text['heading-block_recent_calls']['nl-nl'] = "Blokkeer recente oproep";
$text['heading-block_recent_calls']['pl-pl'] = "Zablokuj ostatnią rozmowę";
$text['heading-block_recent_calls']['pt-br'] = "Bloquear chamadas recentes";
$text['heading-block_recent_calls']['pt-pt'] = "Bloquear Chamadas Recentes";
$text['heading-block_recent_calls']['ro-ro'] = "Blocare apel recent";
$text['heading-block_recent_calls']['ru-ru'] = "Блокировать недавний вызов";
$text['heading-block_recent_calls']['sv-se'] = "Blockera Senaste Samtal";
$text['heading-block_recent_calls']['uk-ua'] = "Блокувати недавній дзвінок";
$text['label-update-complete']['en-us'] = "Update Complete";
$text['label-update-complete']['en-gb'] = "Update Complete";
$text['label-update-complete']['ar-eg'] = "اكتمال التحديث";
$text['label-update-complete']['de-at'] = "Aktualisierung abgeschlossen"; //copied from de-de
$text['label-update-complete']['de-ch'] = "Aktualisierung abgeschlossen"; //copied from de-de
$text['label-update-complete']['de-de'] = "Aktualisierung abgeschlossen";
$text['label-update-complete']['el-gr'] = "Η ενημέρωση ολοκληρώθηκε";
$text['label-update-complete']['es-cl'] = "Actualización Completa";
$text['label-update-complete']['es-mx'] = "Actualización Completa"; //copied from es-cl
$text['label-update-complete']['fr-ca'] = "Mise à jour effectuée"; //copied from fr-fr
$text['label-update-complete']['fr-fr'] = "Mise à jour effectuée";
$text['label-update-complete']['he-il'] = "העדכון הושלם";
$text['label-update-complete']['it-it'] = "Aggiornamento Completato";
$text['label-update-complete']['nl-nl'] = "Bijgewerkt";
$text['label-update-complete']['pl-pl'] = "Zaktualizowano pomyślnie";
$text['label-update-complete']['pt-br'] = "Atualização Completa";
$text['label-update-complete']['pt-pt'] = "Actualização Efectuada";
$text['label-update-complete']['ro-ro'] = "Actualizare completă";
$text['label-update-complete']['ru-ru'] = "Обновление завершено";
$text['label-update-complete']['sv-se'] = "Uppdatering Klar";
$text['label-update-complete']['uk-ua'] = "Оновлено";
$text['label-reject']['en-us'] = "Reject";
$text['label-reject']['en-gb'] = "Reject";
$text['label-reject']['ar-eg'] = "رفض";
$text['label-reject']['de-at'] = "Zurückweisen"; //copied from de-de
$text['label-reject']['de-ch'] = "Zurückweisen"; //copied from de-de
$text['label-reject']['de-de'] = "Zurückweisen";
$text['label-reject']['el-gr'] = "Απόρριψη";
$text['label-reject']['es-cl'] = "Rechazar";
$text['label-reject']['es-mx'] = "Rechazar"; //copied from es-cl
$text['label-reject']['fr-ca'] = "Rejeter"; //copied from fr-fr
$text['label-reject']['fr-fr'] = "Rejeter";
$text['label-reject']['he-il'] = "לדחות";
$text['label-reject']['it-it'] = "Blocca";
$text['label-reject']['nl-nl'] = "Weigeren";
$text['label-reject']['pl-pl'] = "Odrzuć ";
$text['label-reject']['pt-br'] = "Rejeitar"; //copied from pt-pt
$text['label-reject']['pt-pt'] = "Rejeitar";
$text['label-reject']['ro-ro'] = "";
$text['label-reject']['ru-ru'] = "Отклонить";
$text['label-reject']['sv-se'] = "Neka";
$text['label-reject']['uk-ua'] = "Відхилити";
$text['label-provide-number']['en-us'] = "Please provide: Number";
$text['label-provide-number']['en-gb'] = "Please provide: Number";
$text['label-provide-number']['ar-eg'] = "من فضلك أدخل: الرقم";
$text['label-provide-number']['de-at'] = "Bitte geben Sie die Nummer an"; //copied from de-de
$text['label-provide-number']['de-ch'] = "Bitte geben Sie die Nummer an"; //copied from de-de
$text['label-provide-number']['de-de'] = "Bitte geben Sie die Nummer an";
$text['label-provide-number']['el-gr'] = "Εισάγετε: Αριθμό";
$text['label-provide-number']['es-cl'] = "Por favor agregue: Número";
$text['label-provide-number']['es-mx'] = "Por favor agregue: Número"; //copied from es-cl
$text['label-provide-number']['fr-ca'] = "S'il vous plaît indiquer: Numéro";
$text['label-provide-number']['fr-fr'] = "Merci d'indiquer: Numéro";
$text['label-provide-number']['he-il'] = "אנא הכנס מספר";
$text['label-provide-number']['it-it'] = "Prego fornire: Numero";
$text['label-provide-number']['nl-nl'] = "Geef aub: Nummer";
$text['label-provide-number']['pl-pl'] = " Wprowadź numer";
$text['label-provide-number']['pt-br'] = "Por favor indique: Número"; //copied from pt-pt
$text['label-provide-number']['pt-pt'] = "Por favor indique: Número";
$text['label-provide-number']['ro-ro'] = "";
$text['label-provide-number']['ru-ru'] = "Введите номер";
$text['label-provide-number']['sv-se'] = "Ange: Nummer";
$text['label-provide-number']['uk-ua'] = "Введіть номер";
$text['label-provide-name']['en-us'] = "Please provide: Name";
$text['label-provide-name']['en-gb'] = "Please provide: Name";
$text['label-provide-name']['ar-eg'] = "من فضلك أدخل: الأسم";
$text['label-provide-name']['de-at'] = "Bitte geben Sie den Namen an"; //copied from de-de
$text['label-provide-name']['de-ch'] = "Bitte geben Sie den Namen an"; //copied from de-de
$text['label-provide-name']['de-de'] = "Bitte geben Sie den Namen an";
$text['label-provide-name']['el-gr'] = "Εισάγετε: Όνομα";
$text['label-provide-name']['es-cl'] = "Por favor agregue: Nombre";
$text['label-provide-name']['es-mx'] = "Por favor agregue: Nombre"; //copied from es-cl
$text['label-provide-name']['fr-ca'] = "S'il vous plaît indiquer: Nom"; //copied from fr-fr
$text['label-provide-name']['fr-fr'] = "Merci d'indiquer: Nom";
$text['label-provide-name']['he-il'] = "אנא הכנס שם";
$text['label-provide-name']['it-it'] = "Prego fornire: Nome";
$text['label-provide-name']['nl-nl'] = "Geef aub: Naam";
$text['label-provide-name']['pl-pl'] = " Wprowadź nazwę ";
$text['label-provide-name']['pt-br'] = "Por favor indique: Nome"; //copied from pt-pt
$text['label-provide-name']['pt-pt'] = "Por favor indique: Nome";
$text['label-provide-name']['ro-ro'] = "";
$text['label-provide-name']['ru-ru'] = "Пожалуйста, введите: Имя";
$text['label-provide-name']['sv-se'] = "Ange: Namn";
$text['label-provide-name']['uk-ua'] = "Введіть назву";
$text['label-provide-enabled']['en-us'] = "Please provide: Enabled";
$text['label-provide-enabled']['en-gb'] = "Please provide: Enabled";
$text['label-provide-enabled']['ar-eg'] = "";
$text['label-provide-enabled']['de-at'] = "Bitte geben Sie folgendes an: Aktiv"; //copied from de-de
$text['label-provide-enabled']['de-ch'] = "Bitte geben Sie folgendes an: Aktiv"; //copied from de-de
$text['label-provide-enabled']['de-de'] = "Bitte geben Sie folgendes an: Aktiv";
$text['label-provide-enabled']['el-gr'] = "Εισάγετε: Ενεργοποιημένο";
$text['label-provide-enabled']['es-cl'] = "Por favor agregue: Activo";
$text['label-provide-enabled']['es-mx'] = "Por favor agregue: Activo"; //copied from es-cl
$text['label-provide-enabled']['fr-ca'] = "S'il vous plaît indiquer: Actif"; //copied from fr-fr
$text['label-provide-enabled']['fr-fr'] = "Merci d'indiquer: Actif";
$text['label-provide-enabled']['he-il'] = "";
$text['label-provide-enabled']['it-it'] = "Prego fornire: Abilitazione";
$text['label-provide-enabled']['nl-nl'] = "Geef aub: Aktief";
$text['label-provide-enabled']['pl-pl'] = " Wprowadź: Włączony";
$text['label-provide-enabled']['pt-br'] = "Por favor indique se está habilitado";
$text['label-provide-enabled']['pt-pt'] = "Por favor indique: Activado";
$text['label-provide-enabled']['ro-ro'] = "";
$text['label-provide-enabled']['ru-ru'] = "Пожалуйста, введите: Включить";
$text['label-provide-enabled']['sv-se'] = "Ange: Aktiverad";
$text['label-provide-enabled']['uk-ua'] = "Включити/відключити";
$text['label-country_code']['en-us'] = "Country Code";
$text['label-country_code']['en-gb'] = "Country Code";
$text['label-country_code']['ar-eg'] = "";
$text['label-country_code']['de-at'] = ""; //copied from de-de
$text['label-country_code']['de-ch'] = ""; //copied from de-de
$text['label-country_code']['de-de'] = "";
$text['label-country_code']['es-cl'] = "";
$text['label-country_code']['es-mx'] = ""; //copied from es-cl
$text['label-country_code']['fr-ca'] = "Préfixe"; //copied from fr-fr
$text['label-country_code']['fr-fr'] = "Préfixe";
$text['label-country_code']['he-il'] = "";
$text['label-country_code']['it-it'] = "";
$text['label-country_code']['nl-nl'] = "Voorloop";
$text['label-country_code']['pl-pl'] = "Kod Kraju";
$text['label-country_code']['pt-br'] = "Prefixo"; //copied from pt-pt
$text['label-country_code']['pt-pt'] = "";
$text['label-country_code']['ro-ro'] = "";
$text['label-country_code']['ru-ru'] = "";
$text['label-country_code']['sv-se'] = "";
$text['label-country_code']['uk-ua'] = "";
$text['label-number']['en-us'] = "Number";
$text['label-number']['en-gb'] = "Number";
$text['label-number']['ar-eg'] = "رقم";
$text['label-number']['de-at'] = "Nummer"; //copied from de-de
$text['label-number']['de-ch'] = "Nummer"; //copied from de-de
$text['label-number']['de-de'] = "Nummer";
$text['label-number']['el-gr'] = "Αριθμός";
$text['label-number']['es-cl'] = "Número";
$text['label-number']['es-mx'] = "Número"; //copied from es-cl
$text['label-number']['fr-ca'] = "Numéro"; //copied from fr-fr
$text['label-number']['fr-fr'] = "Numéro";
$text['label-number']['he-il'] = "מספר";
$text['label-number']['it-it'] = "Numero";
$text['label-number']['nl-nl'] = "Nummer";
$text['label-number']['pl-pl'] = "Numer";
$text['label-number']['pt-br'] = "Número"; //copied from pt-pt
$text['label-number']['pt-pt'] = "Número";
$text['label-number']['ro-ro'] = "Număr";
$text['label-number']['ru-ru'] = "Номер";
$text['label-number']['sv-se'] = "Nummer";
$text['label-number']['uk-ua'] = "Номер";
$text['label-message']['en-us'] = "Message";
$text['label-message']['en-gb'] = "Message";
$text['label-message']['ar-eg'] = "رسالة";
$text['label-message']['de-at'] = "Nachricht"; //copied from de-de
$text['label-message']['de-ch'] = "Nachricht"; //copied from de-de
$text['label-message']['de-de'] = "Nachricht";
$text['label-message']['el-gr'] = "Μήνυμα";
$text['label-message']['es-cl'] = "Mensaje";
$text['label-message']['es-mx'] = "Mensaje"; //copied from es-cl
$text['label-message']['fr-ca'] = "Message"; //copied from fr-fr
$text['label-message']['fr-fr'] = "Message";
$text['label-message']['he-il'] = "הודעה";
$text['label-message']['it-it'] = "Messaggio";
$text['label-message']['nl-nl'] = "Bericht";
$text['label-message']['pl-pl'] = "Wiadomość";
$text['label-message']['pt-br'] = "Mensagem"; //copied from pt-pt
$text['label-message']['pt-pt'] = "Mensagem";
$text['label-message']['ro-ro'] = "Mesaj";
$text['label-message']['ru-ru'] = "Сообщение";
$text['label-message']['sv-se'] = "Meddelande";
$text['label-message']['uk-ua'] = "Повідомлення";
$text['label-ivr_menus']['en-us'] = "IVR Menus";
$text['label-ivr_menus']['en-gb'] = "IVR Menus";
$text['label-ivr_menus']['ar-eg'] = "";
$text['label-ivr_menus']['de-at'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr_menus']['de-ch'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr_menus']['de-de'] = "Automatische Vermittlungen";
$text['label-ivr_menus']['es-cl'] = "Menus IVR";
$text['label-ivr_menus']['es-mx'] = "Menus IVR"; //copied from es-cl
$text['label-ivr_menus']['fr-ca'] = "Menus RVI"; //copied from fr-fr
$text['label-ivr_menus']['fr-fr'] = "Menus SVI";
$text['label-ivr_menus']['he-il'] = "";
$text['label-ivr_menus']['it-it'] = "Menu IVR";
$text['label-ivr_menus']['nl-nl'] = "IVR menus";
$text['label-ivr_menus']['pl-pl'] = "Menu zapowiedzi głosowych (IVR)";
$text['label-ivr_menus']['pt-br'] = "Menus de IVR"; //copied from pt-pt
$text['label-ivr_menus']['pt-pt'] = "Menus de IVR";
$text['label-ivr_menus']['ro-ro'] = "";
$text['label-ivr_menus']['ru-ru'] = "Голосовые Меню (IVR)";
$text['label-ivr_menus']['sv-se'] = "IVR Menyer";
$text['label-ivr_menus']['uk-ua'] = "";
$text['label-ivr']['en-us'] = "IVR";
$text['label-ivr']['en-gb'] = "IVR";
$text['label-ivr']['ar-eg'] = "";
$text['label-ivr']['de-at'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr']['de-ch'] = "Automatische Vermittlungen"; //copied from de-de
$text['label-ivr']['de-de'] = "Automatische Vermittlungen";
$text['label-ivr']['es-cl'] = "IVR";
$text['label-ivr']['es-mx'] = "IVR";
$text['label-ivr']['fr-ca'] = "RVI";
$text['label-ivr']['fr-fr'] = "SVI";
$text['label-ivr']['he-il'] = "";
$text['label-ivr']['it-it'] = "IVR";
$text['label-ivr']['nl-nl'] = "IVR";
$text['label-ivr']['pl-pl'] = "IVR";
$text['label-ivr']['pt-br'] = "IVR";
$text['label-ivr']['pt-pt'] = "IVR";
$text['label-ivr']['ro-ro'] = "";
$text['label-ivr']['ru-ru'] = "IVR";
$text['label-ivr']['sv-se'] = "IVR";
$text['label-ivr']['uk-ua'] = "";
$text['label-ring_groups']['en-us'] = "Ring Groups";
$text['label-ring_groups']['en-gb'] = "Ring Groups";
$text['label-ring_groups']['ar-eg'] = "مجموعات الرنين";
$text['label-ring_groups']['de-at'] = "Ringgruppen"; //copied from de-de
$text['label-ring_groups']['de-ch'] = "Ringgruppen"; //copied from de-de
$text['label-ring_groups']['de-de'] = "Ringgruppen";
$text['label-ring_groups']['es-cl'] = "Grupos de timbre";
$text['label-ring_groups']['es-mx'] = "Grupos de timbre"; //copied from es-cl
$text['label-ring_groups']['fr-ca'] = "Groupes de sonnerie"; //copied from fr-fr
$text['label-ring_groups']['fr-fr'] = "Groupes de sonnerie";
$text['label-ring_groups']['he-il'] = "קבוצות טבעת";
$text['label-ring_groups']['it-it'] = "Gruppi di suoneria";
$text['label-ring_groups']['nl-nl'] = "Belgroepen";
$text['label-ring_groups']['pl-pl'] = "Grupy dzwonków";
$text['label-ring_groups']['pt-br'] = "Grupos de toque"; //copied from pt-pt
$text['label-ring_groups']['pt-pt'] = "Grupos de toque";
$text['label-ring_groups']['ro-ro'] = "Grupuri de apeluri";
$text['label-ring_groups']['ru-ru'] = "Кольцевые группы";
$text['label-ring_groups']['sv-se'] = "Ringgrupper";
$text['label-ring_groups']['uk-ua'] = "Кільцеві групи";
$text['label-ring_group']['en-us'] = "Ring Group";
$text['label-ring_group']['en-gb'] = "Ring Group";
$text['label-ring_group']['ar-eg'] = "";
$text['label-ring_group']['de-at'] = "Rufgruppe"; //copied from de-de
$text['label-ring_group']['de-ch'] = "Rufgruppe"; //copied from de-de
$text['label-ring_group']['de-de'] = "Rufgruppe";
$text['label-ring_group']['es-cl'] = "Grupo de llamado";
$text['label-ring_group']['es-mx'] = "Grupo de llamado"; //copied from es-cl
$text['label-ring_group']['fr-ca'] = "Groupe de sonnerie"; //copied from fr-fr
$text['label-ring_group']['fr-fr'] = "Groupe de sonnerie";
$text['label-ring_group']['he-il'] = "קבוצת חיוג";
$text['label-ring_group']['it-it'] = "Gruppo di Squillo";
$text['label-ring_group']['nl-nl'] = "Belgroep";
$text['label-ring_group']['pl-pl'] = "Grupa odbiorców.";
$text['label-ring_group']['pt-br'] = "Grupo"; //copied from pt-pt
$text['label-ring_group']['pt-pt'] = "Grupo";
$text['label-ring_group']['ro-ro'] = "";
$text['label-ring_group']['ru-ru'] = "Группа вызовов";
$text['label-ring_group']['sv-se'] = "Ringgrupp";
$text['label-ring_group']['uk-ua'] = "";
$text['label-local']['en-us'] = "Local";
$text['label-local']['en-gb'] = "Local";
$text['label-local']['ar-eg'] = "محلي";
$text['label-local']['de-at'] = "Lokal"; //copied from de-de
$text['label-local']['de-ch'] = "Lokal"; //copied from de-de
$text['label-local']['de-de'] = "Lokal";
$text['label-local']['el-gr'] = "Τοπικό";
$text['label-local']['es-cl'] = "Local";
$text['label-local']['es-mx'] = "Local"; //copied from es-cl
$text['label-local']['fr-ca'] = "Local"; //copied from fr-fr
$text['label-local']['fr-fr'] = "Local";
$text['label-local']['he-il'] = "מקומי";
$text['label-local']['it-it'] = "Locale";
$text['label-local']['nl-nl'] = "Lokaal";
$text['label-local']['pl-pl'] = "Lokalny";
$text['label-local']['pt-br'] = "Local"; //copied from pt-pt
$text['label-local']['pt-pt'] = "Local";
$text['label-local']['ro-ro'] = "Local";
$text['label-local']['ru-ru'] = "Локальный";
$text['label-local']['sv-se'] = "Lokal";
$text['label-local']['uk-ua'] = "Місцевий";
$text['label-inbound']['en-us'] = "Inbound";
$text['label-inbound']['en-gb'] = "Inbound";
$text['label-inbound']['ar-eg'] = "";
$text['label-inbound']['de-at'] = "Eingehend"; //copied from de-de
$text['label-inbound']['de-ch'] = "Eingehend"; //copied from de-de
$text['label-inbound']['de-de'] = "Eingehend";
$text['label-inbound']['el-gr'] = "Εισερχόμενο";
$text['label-inbound']['es-cl'] = "Entrada";
$text['label-inbound']['es-mx'] = "Entrada"; //copied from es-cl
$text['label-inbound']['fr-ca'] = "Entrant"; //copied from fr-fr
$text['label-inbound']['fr-fr'] = "Entrant";
$text['label-inbound']['he-il'] = "";
$text['label-inbound']['it-it'] = "In ingresso";
$text['label-inbound']['nl-nl'] = "Inkomend";
$text['label-inbound']['pl-pl'] = "Przychodzący";
$text['label-inbound']['pt-br'] = "Entrada"; //copied from pt-pt
$text['label-inbound']['pt-pt'] = "Entrada";
$text['label-inbound']['ro-ro'] = "";
$text['label-inbound']['ru-ru'] = "Входящий";
$text['label-inbound']['sv-se'] = "Inkommande";
$text['label-inbound']['uk-ua'] = "Вихідний";
$text['label-outbound']['en-us'] = "Outbound";
$text['label-outbound']['en-gb'] = "Outbound";
$text['label-outbound']['ar-eg'] = "";
$text['label-outbound']['de-at'] = "Ausgehend"; //copied from de-de
$text['label-outbound']['de-ch'] = "Ausgehend"; //copied from de-de
$text['label-outbound']['de-de'] = "Ausgehend";
$text['label-outbound']['es-cl'] = "Salida";
$text['label-outbound']['es-mx'] = "Salida"; //copied from es-cl
$text['label-outbound']['fr-ca'] = "Sortant"; //copied from fr-fr
$text['label-outbound']['fr-fr'] = "Sortant";
$text['label-outbound']['he-il'] = "";
$text['label-outbound']['it-it'] = "In Uscita";
$text['label-outbound']['nl-nl'] = "";
$text['label-outbound']['pl-pl'] = "Wychodzące";
$text['label-outbound']['pt-br'] = "Saída"; //copied from pt-pt
$text['label-outbound']['pt-pt'] = "Saída";
$text['label-outbound']['ro-ro'] = "";
$text['label-outbound']['ru-ru'] = "Исходящие";
$text['label-outbound']['sv-se'] = "Utgående";
$text['label-outbound']['uk-ua'] = "";
$text['label-destination']['en-us'] = "Destination";
$text['label-destination']['en-gb'] = "Destination";
$text['label-destination']['ar-eg'] = "";
$text['label-destination']['de-at'] = "Ziel"; //copied from de-de
$text['label-destination']['de-ch'] = "Ziel"; //copied from de-de
$text['label-destination']['de-de'] = "Ziel";
$text['label-destination']['es-cl'] = "Destino";
$text['label-destination']['es-mx'] = "Destino"; //copied from es-cl
$text['label-destination']['fr-ca'] = "Destination"; //copied from fr-fr
$text['label-destination']['fr-fr'] = "Destination";
$text['label-destination']['he-il'] = "";
$text['label-destination']['it-it'] = "Destinazione";
$text['label-destination']['nl-nl'] = "";
$text['label-destination']['pl-pl'] = "Numer docelowy";
$text['label-destination']['pt-br'] = "Número de destino";