Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb540e047b | ||
|
|
10f1d7a2b2 | ||
|
|
6603eaab05 | ||
|
|
9fc3541382 | ||
|
|
2fb79825ea | ||
|
|
72094f870f | ||
|
|
7b401b39a0 | ||
|
|
0bfd1fb885 | ||
|
|
e3c330017b | ||
|
|
950b764485 | ||
|
|
9f0d14efd2 | ||
|
|
641e026474 | ||
|
|
ba64113e51 | ||
|
|
bbf902a104 | ||
|
|
3a23176948 | ||
|
|
22959fb2bc | ||
|
|
7b4fa99857 | ||
|
|
f16b7851d6 | ||
|
|
283253ac17 | ||
|
|
a8dc026574 | ||
|
|
87e481d285 | ||
|
|
4eb8d5c53f | ||
|
|
a579f82192 | ||
|
|
7b47ee638c | ||
|
|
3835477219 | ||
|
|
eae6c0aa92 | ||
|
|
ae6b922736 | ||
|
|
baeb2fbae9 | ||
|
|
3cdae74fde | ||
|
|
d419a459f7 | ||
|
|
98f20b78f2 | ||
|
|
10926f1721 | ||
|
|
b853b7253c | ||
|
|
070eef4334 | ||
|
|
ff6a9c4247 | ||
|
|
2d2fc2c787 | ||
|
|
e5df85049d | ||
|
|
f2d4c4d990 | ||
|
|
dff02c733c | ||
|
|
63863a8839 | ||
|
|
7411592da8 | ||
|
|
c370b5097f | ||
|
|
efd22e1b68 | ||
|
|
6c2266f099 | ||
|
|
3e9a030380 | ||
|
|
db9778c87a | ||
|
|
5c63d07d0c | ||
|
|
ac16421c0c | ||
|
|
2d45fb0cca | ||
|
|
ef7a71cab4 | ||
|
|
f4b445cad3 | ||
|
|
5fae9183e1 | ||
|
|
c0a5ed67a5 | ||
|
|
d5a4f263c3 | ||
|
|
829444f962 | ||
|
|
56d1eabda9 | ||
|
|
f92e5c7543 | ||
|
|
93cf491c2e | ||
|
|
732c08ca2b | ||
|
|
e46cd9a48e | ||
|
|
46b14657bc | ||
|
|
28b20fc174 | ||
|
|
77aee41478 | ||
|
|
cb9067debc | ||
|
|
efd77c36be | ||
|
|
b2a49aaddf | ||
|
|
c99753bddc | ||
|
|
fa3292a766 | ||
|
|
061c819a78 | ||
|
|
c236b72ea7 | ||
|
|
d52bcd79fb | ||
|
|
f7d56f40a1 | ||
|
|
1d353f6248 | ||
|
|
20dceb8aca | ||
|
|
ebeef3a9cc | ||
|
|
fc0b617b4e | ||
|
|
c179800bb6 | ||
|
|
1fbffe797d | ||
|
|
391a056f8e | ||
|
|
688be0fe52 | ||
|
|
bf4f8269b1 | ||
|
|
fecea0d123 | ||
|
|
872278e6cb | ||
|
|
8a7385c3cc | ||
|
|
29e10444b6 | ||
|
|
7b3362241d | ||
|
|
c26c4b3316 | ||
|
|
48771882e1 | ||
|
|
667056829c | ||
|
|
fe00529fb1 | ||
|
|
27e709f32d | ||
|
|
18047f2611 | ||
|
|
b4019239ba | ||
|
|
2bfbce7ec8 | ||
|
|
884290378d | ||
|
|
3f495272a6 | ||
|
|
03447bb335 | ||
|
|
f68487d7bd | ||
|
|
884be60f99 | ||
|
|
fe68eadaf7 | ||
|
|
8880a42a1a | ||
|
|
f7760858da | ||
|
|
819e391f23 | ||
|
|
fee4e876d3 | ||
|
|
bf7a5f17fa | ||
|
|
250650789a | ||
|
|
d3b23f7dfc | ||
|
|
039e776a67 | ||
|
|
e2284ba408 | ||
|
|
352f6c4ca5 | ||
|
|
d5e798a2d1 | ||
|
|
5dc38ccc24 | ||
|
|
af1bb175a8 | ||
|
|
96afdfb809 | ||
|
|
86b17a986f | ||
|
|
654c1a4762 | ||
|
|
e58b19c643 | ||
|
|
517f7fb6da | ||
|
|
88187232d4 | ||
|
|
7eca3bd4e0 | ||
|
|
f414d866e5 | ||
|
|
3eebd937e3 | ||
|
|
2760559529 | ||
|
|
8a6a1a4277 | ||
|
|
b773a6db26 | ||
|
|
d45ceabe19 | ||
|
|
af75971b63 | ||
|
|
df8470fe06 | ||
|
|
906356002e | ||
|
|
ca38f4a529 | ||
|
|
c923f11d36 | ||
|
|
ae293c932e | ||
|
|
aa7ed46939 | ||
|
|
bc80ed0435 | ||
|
|
b5ed79277c | ||
|
|
0e9c4e7751 | ||
|
|
f66d0af99f | ||
|
|
33b2b48d2a | ||
|
|
44c0065f0d | ||
|
|
3112a5a170 | ||
|
|
13c601b88b | ||
|
|
641bff350f | ||
|
|
3315b12146 | ||
|
|
17777e7c42 | ||
|
|
e935a67feb | ||
|
|
e4765042e9 | ||
|
|
fa24fc8716 | ||
|
|
a1fe9379ec | ||
|
|
186828f63e | ||
|
|
9c53fdb3ef | ||
|
|
7e47bb6446 | ||
|
|
154bf5ba83 | ||
|
|
615743970f | ||
|
|
48e745e6d6 | ||
|
|
2a8b1ff602 | ||
|
|
79d149b688 | ||
|
|
9b1b38fab6 | ||
|
|
30acee4dff | ||
|
|
d85528b195 | ||
|
|
0a90bd9472 | ||
|
|
5e7e2e0778 | ||
|
|
e7879e8b2f | ||
|
|
249f0f4b45 | ||
|
|
d45f89d5fe | ||
|
|
9fb41cb357 | ||
|
|
99e0dfac48 | ||
|
|
b6d49aed5e | ||
|
|
0d913c2b47 | ||
|
|
4d03f5f356 | ||
|
|
d5c7f53be3 | ||
|
|
b96f15fe4e | ||
|
|
0e5cd1d932 | ||
|
|
6980ba6a4a | ||
|
|
d3acbd3289 | ||
|
|
2348767ab9 | ||
|
|
472069555c | ||
|
|
a25dad50bf | ||
|
|
54a83d5725 | ||
|
|
9c04d93b56 | ||
|
|
04196328ef | ||
|
|
66978fae79 | ||
|
|
b2827775dc | ||
|
|
b445fd24a8 | ||
|
|
50d6e4e2ff | ||
|
|
b0429f15b5 | ||
|
|
b9ee3c816f | ||
|
|
9dcfbb5234 | ||
|
|
8547f2ac32 | ||
|
|
42aa667a26 | ||
|
|
14e1b6c668 | ||
|
|
7809b63e72 | ||
|
|
3dd0f69b03 | ||
|
|
72ead8b3b1 | ||
|
|
209cfbc524 | ||
|
|
4b37db4fba | ||
|
|
fd17546365 | ||
|
|
17e0ab3181 | ||
|
|
f60b25175d | ||
|
|
130e415bc9 | ||
|
|
aa12c13056 | ||
|
|
59659ddb7a | ||
|
|
f47509143a | ||
|
|
8a3d4a2488 | ||
|
|
0ffb43d2a9 | ||
|
|
f43c639ecc | ||
|
|
251b808558 | ||
|
|
3d52bba57d | ||
|
|
1633a2730d | ||
|
|
0ed5657ec6 | ||
|
|
b887eb4c82 | ||
|
|
29b08aa753 | ||
|
|
213de55ccc | ||
|
|
b75f73f28a | ||
|
|
8147223696 | ||
|
|
cdd04a39ee | ||
|
|
e0b10228e0 | ||
|
|
6162768599 | ||
|
|
a10ce2d162 | ||
|
|
687e02569d | ||
|
|
f52649f2fd | ||
|
|
65ba2caa57 | ||
|
|
7887489078 | ||
|
|
aa21a1c4a5 | ||
|
|
3266c14409 | ||
|
|
500e42c2ac | ||
|
|
95a12e2fcd | ||
|
|
760c44b7b0 | ||
|
|
5d9720c983 | ||
|
|
cb3b0e6f06 | ||
|
|
5343cfd641 | ||
|
|
5a1f8feeec | ||
|
|
c0fdf6d9ad | ||
|
|
7f559315a2 | ||
|
|
53b701c398 | ||
|
|
89a5f06bb7 | ||
|
|
639516828b | ||
|
|
26c4168cab | ||
|
|
cd34ed0527 | ||
|
|
69e258e8ae | ||
|
|
928dd3ecfa | ||
|
|
b61e746b1e |
@@ -129,10 +129,12 @@
|
||||
unset($prep_statement);
|
||||
|
||||
//rename the file
|
||||
rename($xml_dir.'/acl.conf.xml', $xml_dir.'/acl.conf');
|
||||
if (file_exists($xml_dir.'/acl.conf.xml')) {
|
||||
rename($xml_dir.'/acl.conf.xml', $xml_dir.'/acl.conf');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
+34
-23
@@ -1,27 +1,38 @@
|
||||
<?php
|
||||
|
||||
//application details
|
||||
$apps[$x]['name'] = "Adminer";
|
||||
$apps[$x]['uuid'] = "214b9f02-547b-d49d-f4e9-02987d9581c5";
|
||||
$apps[$x]['category'] = "System";
|
||||
$apps[$x]['subcategory'] = "";
|
||||
$apps[$x]['version'] = "3.2.2";
|
||||
$apps[$x]['license'] = "http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0";
|
||||
$apps[$x]['url'] = "http://www.adminer.org/";
|
||||
$apps[$x]['description']['en-us'] = "Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP. Adminer is available for MySQL, PostgreSQL, SQLite, MS SQL and Oracle.";
|
||||
$apps[$x]['description']['es-cl'] = "Adminer (anteriormente phpMinAdmin) es una herramienta completa para la gestión de bases de datos escrita en PHP. Adminer está disponible para MySQL, PostgreSQL, SQLite, MS SQL y Oracle)";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "Adminer (précédemment phpMinAdmin) est un outil gestion de base de données complet écrite en php. Adminer est disponible pour MySQL, PostgreSQL, SQLite, MS SQL et Oracle.";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "Adminer (anteriormente phpMinAdmin) é uma ferramenta completa para gestão de bases de dados escrita em PHP. O Adminer está disponível para MySQL, PostgreSQL, SQLite, MS SQL e Oracle.";
|
||||
$apps[$x]['description']['pt-br'] = "";
|
||||
//application details
|
||||
$apps[$x]['name'] = "Adminer";
|
||||
$apps[$x]['uuid'] = "214b9f02-547b-d49d-f4e9-02987d9581c5";
|
||||
$apps[$x]['category'] = "System";
|
||||
$apps[$x]['subcategory'] = "";
|
||||
$apps[$x]['version'] = "3.2.2";
|
||||
$apps[$x]['license'] = "http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0";
|
||||
$apps[$x]['url'] = "http://www.adminer.org/";
|
||||
$apps[$x]['description']['en-us'] = "Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP. Adminer is available for MySQL, PostgreSQL, SQLite, MS SQL and Oracle.";
|
||||
$apps[$x]['description']['es-cl'] = "Adminer (anteriormente phpMinAdmin) es una herramienta completa para la gestión de bases de datos escrita en PHP. Adminer está disponible para MySQL, PostgreSQL, SQLite, MS SQL y Oracle)";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "Adminer (précédemment phpMinAdmin) est un outil gestion de base de données complet écrite en php. Adminer est disponible pour MySQL, PostgreSQL, SQLite, MS SQL et Oracle.";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "Adminer (anteriormente phpMinAdmin) é uma ferramenta completa para gestão de bases de dados escrita em PHP. O Adminer está disponível para MySQL, PostgreSQL, SQLite, MS SQL e Oracle.";
|
||||
$apps[$x]['description']['pt-br'] = "";
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = "adminer";
|
||||
$apps[$x]['permissions'][0]['menu']['uuid'] = "1f59d07b-b4f7-4f9e-bde9-312cf491d66e";
|
||||
$apps[$x]['permissions'][0]['groups'][] = "superadmin";
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = "adminer";
|
||||
$apps[$x]['permissions'][0]['menu']['uuid'] = "1f59d07b-b4f7-4f9e-bde9-312cf491d66e";
|
||||
$apps[$x]['permissions'][0]['groups'][] = "superadmin";
|
||||
|
||||
?>
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'e34b276a-1b64-4d11-9470-ae3ea977c47e';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'adminer';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'auto_login';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set whether to auto-login to Adminer, or require a username and password.';
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
@@ -27,39 +27,6 @@
|
||||
//proccess this only one time
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'adminer';
|
||||
$array[$x]['default_setting_subcategory'] = 'auto_login';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set whether to auto-login to Adminer, or require a username and password.';
|
||||
$x++;
|
||||
|
||||
//iterate and add each, if necessary
|
||||
foreach ($array as $index => $default_settings) {
|
||||
//add the default setting
|
||||
$sql = "select count(*) as num_rows from v_default_settings ";
|
||||
$sql .= "where default_setting_category = '".$default_settings['default_setting_category']."' ";
|
||||
$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";
|
||||
$sql .= "and default_setting_name = '".$default_settings['default_setting_name']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($array[$index]);
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -631,8 +631,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if (permission_exists('call_center_tier_add')) {
|
||||
//get agents
|
||||
$sql = "select agent_name from v_call_center_agents where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
foreach($assigned_agents as $assigned_agent) {
|
||||
$sql .= "and agent_name <> '".$assigned_agent."' ";
|
||||
if ($assigned_agents){
|
||||
foreach($assigned_agents as $assigned_agent) {
|
||||
$sql .= "and agent_name <> '".$assigned_agent."' ";
|
||||
}
|
||||
}
|
||||
$sql .= "order by agent_name asc";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -965,4 +967,4 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
+55
-34
@@ -1,38 +1,59 @@
|
||||
<?php
|
||||
|
||||
//application details
|
||||
$apps[$x]['name'] = "Calls";
|
||||
$apps[$x]['uuid'] = "19806921-e8ed-dcff-b325-dd3e5da4959d";
|
||||
$apps[$x]['category'] = "Switch";;
|
||||
$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'] = "Call Forward, Follow Me and Do Not Disturb.";
|
||||
$apps[$x]['description']['es-cl'] = "Reenvio de llamada, Sígueme y No Molestar.";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "Renvoi d'appel, Follow Me et ne pas deranger.";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "Desvio de Chamadas, Seguir-me e Não Perturbar.";
|
||||
$apps[$x]['description']['pt-br'] = "Desvio de chamadas, Siga-me e Não perturbe (DND).";
|
||||
//application details
|
||||
$apps[$x]['name'] = "Calls";
|
||||
$apps[$x]['uuid'] = "19806921-e8ed-dcff-b325-dd3e5da4959d";
|
||||
$apps[$x]['category'] = "Switch";
|
||||
$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'] = "Call Forward, Follow Me and Do Not Disturb.";
|
||||
$apps[$x]['description']['es-cl'] = "Reenvio de llamada, Sígueme y No Molestar.";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "Renvoi d'appel, Follow Me et ne pas deranger.";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "Desvio de Chamadas, Seguir-me e Não Perturbar.";
|
||||
$apps[$x]['description']['pt-br'] = "Desvio de chamadas, Siga-me e Não perturbe (DND).";
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][$y]['name'] = "follow_me";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_forward";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "do_not_disturb";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
//permission details
|
||||
$apps[$x]['permissions'][$y]['name'] = "follow_me";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "call_forward";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "do_not_disturb";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
|
||||
?>
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '4fedc226-caca-4ebf-b4eb-31de93e5bed3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'follow_me';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'max_destinations';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_order'] = '0';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the maximum number of Follow Me Destinations.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'ce105d64-2d1b-4d19-ae34-ccb818cc9c6e';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'follow_me';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'timeout';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '30';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_order'] = '0';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default Follow Me Timeout value.';
|
||||
$y++;
|
||||
|
||||
?>
|
||||
|
||||
@@ -43,6 +43,7 @@ include "root.php";
|
||||
public $outbound_caller_id_name;
|
||||
public $outbound_caller_id_number;
|
||||
private $extension;
|
||||
private $number_alias;
|
||||
private $toll_allow;
|
||||
|
||||
public $destination_data_1;
|
||||
@@ -248,6 +249,7 @@ include "root.php";
|
||||
$this->extension = $row["extension"];
|
||||
$this->accountcode = $row["accountcode"];
|
||||
$this->toll_allow = $row["toll_allow"];
|
||||
$this->number_alias = $row["number_alias"];
|
||||
$this->outbound_caller_id_name = $row["outbound_caller_id_name"];
|
||||
$this->outbound_caller_id_number = $row["outbound_caller_id_number"];
|
||||
}
|
||||
@@ -266,150 +268,171 @@ include "root.php";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//add follow me
|
||||
if (strlen($follow_me_uuid) == 0) {
|
||||
$this->add();
|
||||
//set the extension dial string
|
||||
$sql = "select * from v_follow_me_destinations ";
|
||||
$sql .= "where follow_me_uuid = '".$this->follow_me_uuid."' ";
|
||||
$sql .= "order by follow_me_order asc ";
|
||||
$prep_statement_2 = $db->prepare(check_sql($sql));
|
||||
$prep_statement_2->execute();
|
||||
$result = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
|
||||
$dial_string = "{";
|
||||
if ($this->follow_me_ignore_busy != 'true') {
|
||||
$dial_string .= "fail_on_single_reject=USER_BUSY,";
|
||||
}
|
||||
$dial_string .= "instant_ringback=true,";
|
||||
$dial_string .= "ignore_early_media=true";
|
||||
$dial_string .= ",domain_uuid=".$_SESSION['domain_uuid'];
|
||||
$dial_string .= ",sip_invite_domain=".$_SESSION['domain_name'];
|
||||
$dial_string .= ",domain_name=".$_SESSION['domain_name'];
|
||||
$dial_string .= ",domain=".$_SESSION['domain_name'];
|
||||
$dial_string .= ",extension_uuid=".$this->extension_uuid;
|
||||
$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua";
|
||||
|
||||
$dial_string_caller_id_name = "\${effective_caller_id_name}";
|
||||
$dial_string_caller_id_number = "\${effective_caller_id_number}";
|
||||
|
||||
if (strlen($this->follow_me_caller_id_uuid) > 0){
|
||||
$sql_caller = "select destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->follow_me_caller_id_uuid'";
|
||||
$prep_statement_caller = $db->prepare($sql_caller);
|
||||
if ($prep_statement_caller) {
|
||||
$prep_statement_caller->execute();
|
||||
$row_caller = $prep_statement_caller->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$caller_id_number = $row_caller['destination_caller_id_number'];
|
||||
if(strlen($caller_id_number) == 0){
|
||||
$caller_id_number = $row_caller['destination_number'];
|
||||
}
|
||||
$caller_id_name = $row_caller['destination_caller_id_name'];
|
||||
if(strlen($caller_id_name) == 0){
|
||||
$caller_id_name = $row_caller['destination_description'];
|
||||
}
|
||||
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
$dial_string_caller_id_name = $caller_id_name;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
$dial_string_caller_id_number = $caller_id_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set the extension dial string
|
||||
$sql = "select * from v_follow_me_destinations ";
|
||||
$sql .= "where follow_me_uuid = '".$this->follow_me_uuid."' ";
|
||||
$sql .= "order by follow_me_order asc ";
|
||||
$prep_statement_2 = $db->prepare(check_sql($sql));
|
||||
$prep_statement_2->execute();
|
||||
$result = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
|
||||
$dial_string = "{";
|
||||
if ($this->follow_me_ignore_busy != 'true') {
|
||||
$dial_string .= "fail_on_single_reject=USER_BUSY,";
|
||||
}
|
||||
$dial_string .= "instant_ringback=true,";
|
||||
$dial_string .= "ignore_early_media=true";
|
||||
$dial_string .= ",domain_uuid=".$_SESSION['domain_uuid'];
|
||||
$dial_string .= ",sip_invite_domain=".$_SESSION['domain_name'];
|
||||
$dial_string .= ",domain_name=".$_SESSION['domain_name'];
|
||||
$dial_string .= ",domain=".$_SESSION['domain_name'];
|
||||
$dial_string .= ",extension_uuid=".$this->extension_uuid;
|
||||
$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua";
|
||||
if (strlen($this->cid_name_prefix) > 0) {
|
||||
$dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix."$dial_string_caller_id_name";
|
||||
}
|
||||
else {
|
||||
$dial_string .= ",origination_caller_id_name=$dial_string_caller_id_name";
|
||||
}
|
||||
|
||||
$dial_string_caller_id_name = "\${effective_caller_id_name}";
|
||||
$dial_string_caller_id_number = "\${effective_caller_id_number}";
|
||||
if (strlen($this->cid_number_prefix) > 0) {
|
||||
//$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."";
|
||||
$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."$dial_string_caller_id_number";
|
||||
}
|
||||
else {
|
||||
$dial_string .= ",origination_caller_id_number=$dial_string_caller_id_number";
|
||||
}
|
||||
|
||||
if (strlen($this->follow_me_caller_id_uuid) > 0){
|
||||
$sql_caller = "select destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '$this->domain_uuid' and destination_type = 'inbound' and destination_uuid = '$this->follow_me_caller_id_uuid'";
|
||||
$prep_statement_caller = $db->prepare($sql_caller);
|
||||
if ($prep_statement_caller) {
|
||||
$prep_statement_caller->execute();
|
||||
$row_caller = $prep_statement_caller->fetch(PDO::FETCH_ASSOC);
|
||||
if (strlen($this->accountcode) == 0) {
|
||||
$dial_string .= ",sip_h_X-accountcode=\${accountcode}";
|
||||
}
|
||||
else {
|
||||
$dial_string .= ",sip_h_X-accountcode=".$this->accountcode;
|
||||
$dial_string .= ",accountcode=".$this->accountcode;
|
||||
}
|
||||
|
||||
$caller_id_number = $row_caller['destination_caller_id_number'];
|
||||
if(strlen($caller_id_number) == 0){
|
||||
$caller_id_number = $row_caller['destination_number'];
|
||||
}
|
||||
$caller_id_name = $row_caller['destination_caller_id_name'];
|
||||
if(strlen($caller_id_name) == 0){
|
||||
$caller_id_name = $row_caller['destination_description'];
|
||||
}
|
||||
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
$dial_string_caller_id_name = $caller_id_name;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
$dial_string_caller_id_number = $caller_id_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($this->cid_name_prefix) > 0) {
|
||||
$dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix."$dial_string_caller_id_name";
|
||||
}
|
||||
else {
|
||||
$dial_string .= ",origination_caller_id_name=$dial_string_caller_id_name";
|
||||
}
|
||||
|
||||
if (strlen($this->cid_number_prefix) > 0) {
|
||||
//$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."";
|
||||
$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."$dial_string_caller_id_number";
|
||||
}
|
||||
else {
|
||||
$dial_string .= ",origination_caller_id_number=$dial_string_caller_id_number";
|
||||
}
|
||||
|
||||
if (strlen($this->accountcode) > 0) {
|
||||
$dial_string .= ",sip_h_X-accountcode=".$this->accountcode;
|
||||
$dial_string .= ",accountcode=".$this->accountcode;
|
||||
}
|
||||
if ($this->toll_allow != '') {
|
||||
$dial_string .= ",toll_allow='".$this->toll_allow."'";
|
||||
$dial_string .= "}";
|
||||
$x = 0;
|
||||
if (is_array($result)) foreach ($result as &$row) {
|
||||
if ($x > 0) {
|
||||
$dial_string .= ",";
|
||||
}
|
||||
|
||||
$dial_string .= "}";
|
||||
$x = 0;
|
||||
if (is_array($result)) foreach ($result as &$row) {
|
||||
if ($x > 0) {
|
||||
$dial_string .= ",";
|
||||
}
|
||||
if (($presence_id = extension_presence_id($row["follow_me_destination"])) !== false) {
|
||||
//set the dial string
|
||||
// using here `sofia_contact` instead of `user/` allows add registered device
|
||||
// so you can make follow me for extension `100` like `100` and avoid recusion
|
||||
// but it ignores DND/CallForwad settings
|
||||
if (strlen($_SESSION['domain']['dial_string']['text']) == 0) {
|
||||
$dial_string .= "[";
|
||||
$dial_string .= "outbound_caller_id_number=$dial_string_caller_id_number,";
|
||||
$dial_string .= "presence_id=".$presence_id."@".$_SESSION['domain_name'].',';
|
||||
if ($row["follow_me_prompt"] == "1") {
|
||||
$dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true,";
|
||||
}
|
||||
$dial_string .= "leg_delay_start=".$row["follow_me_delay"].",";
|
||||
$dial_string .= "leg_timeout=".$row["follow_me_timeout"]."]";
|
||||
$dial_string .= "\${sofia_contact(".$row["follow_me_destination"]."@".$_SESSION['domain_name'].")}";
|
||||
}
|
||||
if (extension_exists($row["follow_me_destination"])) {
|
||||
//set the dial string
|
||||
if (strlen($_SESSION['domain']['dial_string']['text']) == 0) {
|
||||
$dial_string .= "[";
|
||||
$dial_string .= "outbound_caller_id_number=$dial_string_caller_id_number,";
|
||||
$dial_string .= "presence_id=".$row["follow_me_destination"]."@".$_SESSION['domain_name'].",";
|
||||
if ($row["follow_me_prompt"] == "1") {
|
||||
$dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true,";
|
||||
}
|
||||
$dial_string .= "leg_delay_start=".$row["follow_me_delay"].",";
|
||||
$dial_string .= "leg_timeout=".$row["follow_me_timeout"]."]";
|
||||
$dial_string .= "\${sofia_contact(".$row["follow_me_destination"]."@".$_SESSION['domain_name'].")}";
|
||||
else {
|
||||
//get the session dial string
|
||||
$dial_string_template = $_SESSION['domain']['dial_string']['text'];
|
||||
|
||||
//replace the variables with the values
|
||||
$dial_string_template = str_replace("sip_invite_domain=\${domain_name},", "", $dial_string_template);
|
||||
$dial_string_template = str_replace("presence_id=\${dialed_user}@\${dialed_domain}", "", $dial_string_template);
|
||||
$dial_string_template = str_replace("\${dialed_user}", $row["follow_me_destination"], $dial_string_template);
|
||||
$dial_string_template = str_replace("\${dialed_domain}", $_SESSION['domain_name'], $dial_string_template);
|
||||
$dial_string_template = str_replace("\${call_timeout}", $row["follow_me_timeout"], $dial_string_template);
|
||||
$dial_string_template = str_replace("\${leg_timeout}", $row["follow_me_timeout"], $dial_string_template);
|
||||
|
||||
//seperate the variables from the bridge statement
|
||||
preg_match_all('/{((?:[^{}]|(?R))*)}/', $dial_string_template, $matches, PREG_PATTERN_ORDER);
|
||||
$dial_string_variables = $matches[1][0];
|
||||
$dial_string_bridge = $matches[1][1];
|
||||
|
||||
//add to the dial string
|
||||
$dial_string .= "[";
|
||||
$dial_string .= $dial_string_variables;
|
||||
if ($row["follow_me_prompt"] == "1") {
|
||||
$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true";
|
||||
}
|
||||
$dial_string .= "]";
|
||||
$dial_string .= $dial_string_bridge;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$presence_id = extension_presence_id($this->extension, $this->number_alias);
|
||||
$dial_string .= "[";
|
||||
if ($_SESSION['cdr']['follow_me_fix']['boolean'] == "true"){
|
||||
$dial_string .= "outbound_caller_id_name=".$this->outbound_caller_id_name;
|
||||
$dial_string .= ",outbound_caller_id_number=".$this->outbound_caller_id_number;
|
||||
$dial_string .= ",origination_caller_id_name=".$this->outbound_caller_id_name;
|
||||
$dial_string .= ",origination_caller_id_number=".$this->outbound_caller_id_number;
|
||||
}
|
||||
else{
|
||||
$dial_string .= "outbound_caller_id_number=$dial_string_caller_id_number";
|
||||
}
|
||||
$dial_string .= ",presence_id=".$presence_id."@".$_SESSION['domain_name'];
|
||||
if ($row["follow_me_prompt"] == "1") {
|
||||
$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true,";
|
||||
}
|
||||
$dial_string .= ",leg_delay_start=".$row["follow_me_delay"];
|
||||
$dial_string .= ",leg_timeout=".$row["follow_me_timeout"]."]";
|
||||
if (is_numeric($row["follow_me_destination"])) {
|
||||
if ($_SESSION['domain']['bridge']['text'] == "outbound" || $_SESSION['domain']['bridge']['text'] == "bridge") {
|
||||
$bridge = outbound_route_to_bridge ($_SESSION['domain_uuid'], $row["follow_me_destination"]);
|
||||
$dial_string .= $bridge[0];
|
||||
}
|
||||
elseif ($_SESSION['domain']['bridge']['text'] == "loopback") {
|
||||
$dial_string .= "loopback/".$row["follow_me_destination"]."/".$_SESSION['domain_name'];
|
||||
}
|
||||
elseif ($_SESSION['domain']['bridge']['text'] == "lcr") {
|
||||
$dial_string .= "lcr/".$_SESSION['lcr']['profile']['text']."/".$_SESSION['domain_name']."/".$row["follow_me_destination"];
|
||||
}
|
||||
else {
|
||||
$replace_value = $row["follow_me_destination"];
|
||||
if ($row["follow_me_prompt"] == "1") {
|
||||
$replace_value .= "[group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true]";
|
||||
}
|
||||
$local_dial_string = $_SESSION['domain']['dial_string']['text'];
|
||||
$local_dial_string = str_replace("\${dialed_user}", $replace_value, $local_dial_string);
|
||||
$local_dial_string = str_replace("\${dialed_domain}", $_SESSION['domain_name'], $local_dial_string);
|
||||
$local_dial_string = str_replace("\${call_timeout}", $row["follow_me_timeout"], $local_dial_string);
|
||||
$local_dial_string = str_replace("\${leg_timeout}", $row["follow_me_timeout"], $local_dial_string);
|
||||
$dial_string .= $local_dial_string;
|
||||
$dial_string .= "loopback/".$row["follow_me_destination"]."/".$_SESSION['domain_name'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$dial_string .= "[";
|
||||
if ($_SESSION['cdr']['follow_me_fix']['boolean'] == "true"){
|
||||
$dial_string .= "outbound_caller_id_name=".$this->outbound_caller_id_name;
|
||||
$dial_string .= ",outbound_caller_id_number=".$this->outbound_caller_id_number;
|
||||
$dial_string .= ",origination_caller_id_name=".$this->outbound_caller_id_name;
|
||||
$dial_string .= ",origination_caller_id_number=".$this->outbound_caller_id_number;
|
||||
}
|
||||
else{
|
||||
$dial_string .= "outbound_caller_id_number=$dial_string_caller_id_number";
|
||||
}
|
||||
$dial_string .= ",presence_id=".$this->extension."@".$_SESSION['domain_name'];
|
||||
if ($row["follow_me_prompt"] == "1") {
|
||||
$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua,confirm=true,";
|
||||
}
|
||||
$dial_string .= ",leg_delay_start=".$row["follow_me_delay"];
|
||||
$dial_string .= ",leg_timeout=".$row["follow_me_timeout"]."]";
|
||||
if (is_numeric($row["follow_me_destination"])) {
|
||||
if ($_SESSION['domain']['bridge']['text'] == "outbound" || $_SESSION['domain']['bridge']['text'] == "bridge") {
|
||||
$bridge = outbound_route_to_bridge ($_SESSION['domain_uuid'], $row["follow_me_destination"]);
|
||||
$dial_string .= $bridge[0];
|
||||
}
|
||||
elseif ($_SESSION['domain']['bridge']['text'] == "loopback") {
|
||||
$dial_string .= "loopback/".$row["follow_me_destination"]."/".$_SESSION['domain_name'];
|
||||
}
|
||||
elseif ($_SESSION['domain']['bridge']['text'] == "lcr") {
|
||||
$dial_string .= "lcr/".$_SESSION['lcr']['profile']['text']."/".$_SESSION['domain_name']."/".$row["follow_me_destination"];
|
||||
}
|
||||
else {
|
||||
$dial_string .= "loopback/".$row["follow_me_destination"]."/".$_SESSION['domain_name'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$dial_string .= $row["follow_me_destination"];
|
||||
}
|
||||
$dial_string .= $row["follow_me_destination"];
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
$this->dial_string = $dial_string;
|
||||
$x++;
|
||||
}
|
||||
$dial_string = str_replace(",]", "]", $dial_string);
|
||||
$this->dial_string = $dial_string;
|
||||
|
||||
$sql = "update v_follow_me set ";
|
||||
$sql .= "dial_string = '".$this->dial_string."' ";
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
$xml_string = file_get_contents($xml_file);
|
||||
}
|
||||
elseif (file_exists($xml_file_alt)) {
|
||||
$xml_string = file_get_contents(xml_file_alt);
|
||||
$xml_string = file_get_contents($xml_file_alt);
|
||||
}
|
||||
$xml_object = simplexml_load_string($xml_string);
|
||||
$json = json_encode($xml_object);
|
||||
@@ -128,4 +128,4 @@
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
$xml_string = file_get_contents($xml_file);
|
||||
}
|
||||
elseif (file_exists($xml_file_alt)) {
|
||||
$xml_string = file_get_contents(xml_file_alt);
|
||||
$xml_string = file_get_contents($xml_file_alt);
|
||||
}
|
||||
$xml_object = simplexml_load_string($xml_string);
|
||||
$json = json_encode($xml_object);
|
||||
|
||||
@@ -445,6 +445,10 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the extension.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "phone_speed_dial";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the speed dial.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "phone_description";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
|
||||
|
||||
@@ -879,6 +879,17 @@ $text['label-phone_tools']['sv-se'] = "Verktyg";
|
||||
$text['label-phone_tools']['de-at'] = "Funktionen";
|
||||
$text['label-phone_tools']['he'] = "כלים";
|
||||
|
||||
$text['label-phone_speed_dial']['en-us'] = "Speed Dial";
|
||||
$text['label-phone_speed_dial']['es-cl'] = "";
|
||||
$text['label-phone_speed_dial']['pt-pt'] = "";
|
||||
$text['label-phone_speed_dial']['fr-fr'] = "";
|
||||
$text['label-phone_speed_dial']['pt-br'] = "";
|
||||
$text['label-phone_speed_dial']['pl'] = "";
|
||||
$text['label-phone_speed_dial']['uk'] = "";
|
||||
$text['label-phone_speed_dial']['sv-se'] = "";
|
||||
$text['label-phone_speed_dial']['de-at'] = "";
|
||||
$text['label-phone_speed_dial']['he'] = "";
|
||||
|
||||
$text['label-phone_numbers']['en-us'] = "Numbers";
|
||||
$text['label-phone_numbers']['es-cl'] = "Números";
|
||||
$text['label-phone_numbers']['pt-pt'] = "Números";
|
||||
@@ -2019,6 +2030,17 @@ $text['description-phone_primary']['sv-se'] = "Sätt som primärt Nummer för de
|
||||
$text['description-phone_primary']['de-at'] = "Als primäre Nummer für diesen Kontakt setzen.";
|
||||
$text['description-phone_primary']['he'] = "";
|
||||
|
||||
$text['description-phone_speed_dial']['en-us'] = "Enter the speed dial number.";
|
||||
$text['description-phone_speed_dial']['es-cl'] = "";
|
||||
$text['description-phone_speed_dial']['pt-pt'] = "";
|
||||
$text['description-phone_speed_dial']['fr-fr'] = "";
|
||||
$text['description-phone_speed_dial']['pt-br'] = "";
|
||||
$text['description-phone_speed_dial']['pl'] = "";
|
||||
$text['description-phone_speed_dial']['uk'] = "";
|
||||
$text['description-phone_speed_dial']['sv-se'] = "";
|
||||
$text['description-phone_speed_dial']['de-at'] = "";
|
||||
$text['description-phone_speed_dial']['he'] = "";
|
||||
|
||||
$text['description-phone_number']['en-us'] = "Enter the phone number.";
|
||||
$text['description-phone_number']['es-cl'] = "Ingrese el número de teléfono.";
|
||||
$text['description-phone_number']['pt-pt'] = "Introduza o número de telefone";
|
||||
|
||||
@@ -17,23 +17,27 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('contact_phone_edit') || permission_exists('contact_phone_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('contact_phone_edit') || permission_exists('contact_phone_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -48,9 +52,10 @@ else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
//get the uuid
|
||||
if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$contact_uuid = check_str($_GET["contact_uuid"]);
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
@@ -60,6 +65,7 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$phone_type_text = check_str($_POST["phone_type_text"]);
|
||||
$phone_label = check_str($_POST["phone_label"]);
|
||||
$phone_label_custom = check_str($_POST["phone_label_custom"]);
|
||||
$phone_speed_dial = check_str($_POST["phone_speed_dial"]);
|
||||
$phone_number = check_str($_POST["phone_number"]);
|
||||
$phone_extension = check_str($_POST["phone_extension"]);
|
||||
$phone_primary = check_str($_POST["phone_primary"]);
|
||||
@@ -128,6 +134,7 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$sql .= "phone_type_video, ";
|
||||
$sql .= "phone_type_text, ";
|
||||
$sql .= "phone_label, ";
|
||||
$sql .= "phone_speed_dial, ";
|
||||
$sql .= "phone_number, ";
|
||||
$sql .= "phone_extension, ";
|
||||
$sql .= "phone_primary, ";
|
||||
@@ -143,6 +150,7 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$sql .= (($phone_type_video) ? 1 : 'null').", ";
|
||||
$sql .= (($phone_type_text) ? 1 : 'null').", ";
|
||||
$sql .= "'".$phone_label."', ";
|
||||
$sql .= "'".$phone_speed_dial."', ";
|
||||
$sql .= "'".$phone_number."', ";
|
||||
$sql .= "'".$phone_extension."', ";
|
||||
$sql .= (($phone_primary) ? 1 : 0).", ";
|
||||
@@ -164,6 +172,7 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$sql .= "phone_type_video = ".(($phone_type_video) ? 1 : 'null').", ";
|
||||
$sql .= "phone_type_text = ".(($phone_type_text) ? 1 : 'null').", ";
|
||||
$sql .= "phone_label = '".$phone_label."', ";
|
||||
$sql .= "phone_speed_dial = '".$phone_speed_dial."', ";
|
||||
$sql .= "phone_number = '".$phone_number."', ";
|
||||
$sql .= "phone_extension = '".$phone_extension."', ";
|
||||
$sql .= "phone_primary = ".(($phone_primary) ? 1 : 0).", ";
|
||||
@@ -195,6 +204,7 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
$phone_type_video = $row["phone_type_video"];
|
||||
$phone_type_text = $row["phone_type_text"];
|
||||
$phone_label = $row["phone_label"];
|
||||
$phone_speed_dial = $row["phone_speed_dial"];
|
||||
$phone_number = $row["phone_number"];
|
||||
$phone_extension = $row["phone_extension"];
|
||||
$phone_primary = $row["phone_primary"];
|
||||
@@ -297,6 +307,17 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-phone_speed_dial']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='phone_speed_dial' maxlength='255' min='0' step='1' value=\"$phone_speed_dial\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-phone_speed_dial']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-phone_number']."\n";
|
||||
@@ -360,4 +381,5 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
||||
@@ -272,9 +272,13 @@
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
//if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
//require_once "app/provision/provision_write.php";
|
||||
//}
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//set the message
|
||||
if (!isset($_SESSION['message'])) {
|
||||
|
||||
@@ -71,11 +71,17 @@ else {
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
require_once "app/provision/provision_write.php";
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//set the message and redirect the user
|
||||
$_SESSION["message"] = $text['message-delete'];
|
||||
header("Location: devices.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -312,7 +312,11 @@
|
||||
|
||||
//write the provision files
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
require_once "app/provision/provision_write.php";
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//set the message
|
||||
|
||||
@@ -66,11 +66,17 @@ else {
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
require_once "app/provision/provision_write.php";
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//set the message and redirect the user
|
||||
$_SESSION["message"] = $text['message-delete'];
|
||||
header("Location: device_profiles.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -141,7 +141,11 @@
|
||||
|
||||
//write the provision files
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
require_once "app/provision/provision_write.php";
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//set the message
|
||||
|
||||
@@ -198,8 +198,8 @@
|
||||
$sql .= "where device_vendor_function_uuid = '$device_vendor_function_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$device_vendor_functions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($device_vendor_functions as &$row) {
|
||||
//$label = $row["label"];
|
||||
$name = $row["name"];
|
||||
$value = $row["value"];
|
||||
@@ -217,15 +217,13 @@
|
||||
$sql .= " v_groups as g ";
|
||||
$sql .= "where ";
|
||||
$sql .= " fg.group_uuid = g.group_uuid ";
|
||||
//$sql .= " and fg.device_vendor_uuid = :device_vendor_uuid ";
|
||||
$sql .= " and fg.device_vendor_uuid = '$device_vendor_uuid' ";
|
||||
//$sql .= " and fg.device_vendor_function_uuid = :device_vendor_function_uuid ";
|
||||
$sql .= " and fg.device_vendor_function_uuid = '$device_vendor_function_uuid' ";
|
||||
$sql .= " and fg.device_vendor_uuid = :device_vendor_uuid ";
|
||||
//$sql .= " and fg.device_vendor_uuid = '$device_vendor_uuid' ";
|
||||
$sql .= " and fg.device_vendor_function_uuid = :device_vendor_function_uuid ";
|
||||
//$sql .= " and fg.device_vendor_function_uuid = '$device_vendor_function_uuid' ";
|
||||
$sql .= "order by ";
|
||||
$sql .= " g.domain_uuid desc, ";
|
||||
$sql .= " g.group_name asc ";
|
||||
//echo $sql;
|
||||
//exit;
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->bindParam(':device_vendor_uuid', $device_vendor_uuid);
|
||||
$prep_statement->bindParam(':device_vendor_function_uuid', $device_vendor_function_uuid);
|
||||
@@ -234,9 +232,11 @@
|
||||
unset($sql, $prep_statement);
|
||||
|
||||
//set the assigned_groups array
|
||||
foreach($menu_item_groups as $field) {
|
||||
if (strlen($field['group_name']) > 0) {
|
||||
$assigned_groups[] = $field['group_uuid'];
|
||||
if (is_array($menu_item_groups)) {
|
||||
foreach($menu_item_groups as $field) {
|
||||
if (strlen($field['group_name']) > 0) {
|
||||
$assigned_groups[] = $field['group_uuid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
<?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-2017
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
@@ -121,10 +145,10 @@
|
||||
$sql .= " v_groups as g ";
|
||||
$sql .= "where ";
|
||||
$sql .= " fg.group_uuid = g.group_uuid ";
|
||||
//$sql .= " and fg.device_vendor_uuid = :device_vendor_uuid ";
|
||||
$sql .= " and fg.device_vendor_uuid = '$device_vendor_uuid' ";
|
||||
//$sql .= " and fg.device_vendor_function_uuid = :device_vendor_function_uuid ";
|
||||
$sql .= " and fg.device_vendor_function_uuid = '".$row['device_vendor_function_uuid']."' ";
|
||||
$sql .= " and fg.device_vendor_uuid = :device_vendor_uuid ";
|
||||
//$sql .= " and fg.device_vendor_uuid = '$device_vendor_uuid' ";
|
||||
$sql .= " and fg.device_vendor_function_uuid = :device_vendor_function_uuid ";
|
||||
//$sql .= " and fg.device_vendor_function_uuid = '".$row['device_vendor_function_uuid']."' ";
|
||||
$sql .= "order by ";
|
||||
$sql .= " g.domain_uuid desc, ";
|
||||
$sql .= " g.group_name asc ";
|
||||
|
||||
@@ -68,6 +68,16 @@
|
||||
$dialplan_context = check_str($_REQUEST["dialplan_context"]);
|
||||
$app_uuid = check_str($_REQUEST["app_uuid"]);
|
||||
|
||||
//make sure all dialplans with context of public have the inbound route app_uuid
|
||||
if ($app_uuid == 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4') {
|
||||
$sql = "update v_dialplans set ";
|
||||
$sql .= "app_uuid = 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4' ";
|
||||
$sql .= "where dialplan_context = 'public' ";
|
||||
$sql .= "and app_uuid is null; ";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//includes
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<context name="{v_context}">
|
||||
<extension name="speed_dial" number="*0[ext]" continue="false" app_uuid="1a4a2611-01e3-4582-982b-4ada4d314ea3" enabled="true">
|
||||
<condition field="destination_number" expression="^\*0(.*)$">
|
||||
<action application="lua" data="app.lua speed_dial $1"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</context>
|
||||
@@ -1,5 +1,6 @@
|
||||
<context name="{v_context}">
|
||||
<extension name="extension-to-voicemail" number="[ext]" continue="false" app_uuid="8a2e7b81-996c-4d6b-87df-b879b972a572">
|
||||
<condition field="${user_exists}" expression="^true$" />
|
||||
<condition field="username" expression="^${caller_id_number}$" />
|
||||
<condition field="destination_number" expression="^${caller_id_number}$">
|
||||
<action application="answer"/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<action application="set" data="park_lot=$2" inline="true"/>
|
||||
</condition>
|
||||
<condition field="destination_number" expression="^(park\+)?(\*59[0-9][0-9])$"/>
|
||||
<condition field="${cond ${sip_h_Referred-By} == 0 ? false : true}" expression="true" break="never">
|
||||
<condition field="${cond ${sip_h_Referred-By} == '' ? false : true}" expression="true" break="never">
|
||||
<action application="set" data="park_in_use=${regex ${valet_info park@${domain_name}}|${park_lot}}" inline="true"/>
|
||||
</condition>
|
||||
<condition field="${park_in_use}" expression="true" break="never">
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<context name="{v_context}">
|
||||
<extension name="do-not-disturb" number="*78,*79" continue="false" app_uuid="df32d982-e39e-4ae5-a46d-aed1893873f2" enabled="true">
|
||||
<extension name="do-not-disturb" number="*77,*78,*79" continue="false" app_uuid="df32d982-e39e-4ae5-a46d-aed1893873f2" enabled="true">
|
||||
<condition field="destination_number" expression="^\*77$" break="on-true">
|
||||
<action application="set" data="enabled=toggle"/>
|
||||
<action application="lua" data="do_not_disturb.lua"/>
|
||||
</condition>
|
||||
<condition field="destination_number" expression="^\*78$|\*363$" break="on-true">
|
||||
<action application="set" data="enabled=true"/>
|
||||
<action application="lua" data="do_not_disturb.lua"/>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
|
||||
<action application="hash" data="insert/${domain_name}-last_dial/${called_party_call_group}/${uuid}"/>
|
||||
<action application="set" data="api_hangup_hook=lua app.lua hangup"/>
|
||||
<action application="export" data="domain_name=${context}"/>
|
||||
<!-- standard method -->
|
||||
<action application="bridge" data="user/${destination_number}@${domain_name}"/>
|
||||
<!-- sofia contact -->
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -26,17 +26,21 @@
|
||||
|
||||
//make sure that enum uses sofia internal in the enum.conf.xml file
|
||||
if ($domains_processed == 1) {
|
||||
$switch_conf_dir = $_SESSION['switch']['conf']['dir'];
|
||||
$file_contents = file_get_contents($switch_conf_dir."/autoload_configs/enum.conf.xml");
|
||||
$file_contents_new = str_replace("service=\"E2U+SIP\" regex=\"sip:(.*)\" replace=\"sofia/\${use_profile}/\$1", "service=\"E2U+SIP\" regex=\"sip:(.*)\" replace=\"sofia/internal/\$1", $file_contents);
|
||||
if ($file_contents != $file_contents_new) {
|
||||
$fout = fopen($switch_conf_dir."/autoload_configs/enum.conf.xml","w");
|
||||
fwrite($fout, $file_contents_new);
|
||||
fclose($fout);
|
||||
if ($display_type == "text") {
|
||||
echo " enum.conf.xml: updated\n";
|
||||
if (is_array($_SESSION['switch']['conf'])) {
|
||||
$switch_conf_dir = $_SESSION['switch']['conf']['dir'];
|
||||
if (file_exists($switch_conf_dir."/autoload_configs/enum.conf.xml")) {
|
||||
$file_contents = file_get_contents($switch_conf_dir."/autoload_configs/enum.conf.xml");
|
||||
$file_contents_new = str_replace("service=\"E2U+SIP\" regex=\"sip:(.*)\" replace=\"sofia/\${use_profile}/\$1", "service=\"E2U+SIP\" regex=\"sip:(.*)\" replace=\"sofia/internal/\$1", $file_contents);
|
||||
if ($file_contents != $file_contents_new) {
|
||||
$fout = fopen($switch_conf_dir."/autoload_configs/enum.conf.xml","w");
|
||||
fwrite($fout, $file_contents_new);
|
||||
fclose($fout);
|
||||
if ($display_type == "text") {
|
||||
echo " enum.conf.xml: updated\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
+155
-104
@@ -1,109 +1,160 @@
|
||||
<?php
|
||||
|
||||
//application details
|
||||
$apps[$x]['name'] = "Edit";
|
||||
$apps[$x]['uuid'] = "17e628ee-ccfa-49c0-29ca-9894a0384b9b";
|
||||
$apps[$x]['category'] = "Switch";;
|
||||
$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'] = "Script Editor can be used to edit lua, javascript or other scripts.";
|
||||
$apps[$x]['description']['es-cl'] = "Editor de scripts. Puede ser utilizado para editar archivos lua, javascript, etc.";
|
||||
$apps[$x]['description']['es-mx'] = "";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "L'éditeur permet de modifier les scripts lua, javascript ou autres.";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "Editor de script pode ser usado para editar lua, javascript ou outros scripts.";
|
||||
$apps[$x]['description']['pt-br'] = "";
|
||||
//application details
|
||||
$apps[$x]['name'] = "Edit";
|
||||
$apps[$x]['uuid'] = "17e628ee-ccfa-49c0-29ca-9894a0384b9b";
|
||||
$apps[$x]['category'] = "Switch";
|
||||
$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'] = "Script Editor can be used to edit lua, javascript or other scripts.";
|
||||
$apps[$x]['description']['es-cl'] = "Editor de scripts. Puede ser utilizado para editar archivos lua, javascript, etc.";
|
||||
$apps[$x]['description']['es-mx'] = "";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "L'éditeur permet de modifier les scripts lua, javascript ou autres.";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "Editor de script pode ser usado para editar lua, javascript ou outros scripts.";
|
||||
$apps[$x]['description']['pt-br'] = "";
|
||||
|
||||
//permission details
|
||||
$y = 0;
|
||||
$apps[$x]['permissions'][$y]['name'] = "script_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "f1905fec-0577-daef-6045-59d09b7d3f94";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "script_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "provision_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "57773542-a565-1a29-605d-6535da1a0870";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "provision_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "xml_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "16013877-606a-2a05-7d6a-c1b215839131";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "xml_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "php_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "eae1f2d6-789b-807c-cc26-44501e848693";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "php_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "grammar_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "c3db739e-89f9-0fa2-44ce-0f4c2ff43b1a";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "grammar_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_view";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_add";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_edit";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_delete";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
//permission details
|
||||
$y = 0;
|
||||
$apps[$x]['permissions'][$y]['name'] = "script_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "f1905fec-0577-daef-6045-59d09b7d3f94";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "script_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "provision_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "57773542-a565-1a29-605d-6535da1a0870";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "provision_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "xml_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "16013877-606a-2a05-7d6a-c1b215839131";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "xml_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "php_editor_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "eae1f2d6-789b-807c-cc26-44501e848693";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "php_editor_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "grammar_view";
|
||||
$apps[$x]['permissions'][$y]['menu']['uuid'] = "c3db739e-89f9-0fa2-44ce-0f4c2ff43b1a";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "grammar_save";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_view";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_add";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_edit";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "clip_delete";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = "v_clips";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_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";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_name";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_folder";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_text_start";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_text_end";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_order";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_desc";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '2e217303-53ff-4dda-b74e-7f07738d83c2';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'editor';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'font_size';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '14px';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default text size for Editor.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8701cdca-64a1-4ff4-85a1-a09b1389ce92';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'editor';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'indent_guides';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default visibility of indent guides for Editor.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '5669f8cf-f0a0-4d9c-ad75-caf239e9f5cd';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'editor';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'invisibles';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default state of invisible characters for Editor.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7122cb30-d557-4001-af94-d8d21f964a63';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'editor';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'line_numbers';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default visibility of line numbers for Editor.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '62cfc1ac-6566-45ba-8c7d-f4234ab1b31e';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'editor';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'live_previews';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable or disable live previewing of syntax, text size and theme changes.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7b403afd-e4d6-4e96-8c8f-2cf5d6187191';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'editor';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'theme';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'Cobalt';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default theme.';
|
||||
$y++;
|
||||
|
||||
?>
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = "v_clips";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_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";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_name";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_folder";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_text_start";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_text_end";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_order";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "clip_desc";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<?php
|
||||
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of editor settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'editor';
|
||||
$array[$x]['default_setting_subcategory'] = 'font_size';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '14px';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set the default text size for Editor.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'editor';
|
||||
$array[$x]['default_setting_subcategory'] = 'indent_guides';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'false';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set the default visibility of indent guides for Editor.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'editor';
|
||||
$array[$x]['default_setting_subcategory'] = 'invisibles';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'false';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set the default state of invisible characters for Editor.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'editor';
|
||||
$array[$x]['default_setting_subcategory'] = 'line_numbers';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'false';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set the default visibility of line numbers for Editor.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'editor';
|
||||
$array[$x]['default_setting_subcategory'] = 'live_previews';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'false';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Enable or disable live previewing of syntax, text size and theme changes.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'editor';
|
||||
$array[$x]['default_setting_subcategory'] = 'theme';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'Cobalt';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set the default theme.';
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'editor' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$x = 0;
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
$missing[$x] = $setting;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($row);
|
||||
$message = $orm->message;
|
||||
unset($orm);
|
||||
//print_r($message);
|
||||
}
|
||||
unset($missing);
|
||||
|
||||
//unset the array variable
|
||||
unset($array);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
+45
-31
@@ -1,39 +1,53 @@
|
||||
<?php
|
||||
if (PHP_SAPI === 'cli') {
|
||||
$argument1 = $argv[1];
|
||||
} else {
|
||||
die();
|
||||
}
|
||||
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
$sql = "select email from v_emails";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
if ($result_count > 0) {
|
||||
foreach($result as $row) {
|
||||
$msg = $row['email'];
|
||||
|
||||
require_once "secure/v_mailto.php";
|
||||
if ($mailer_error == '') {
|
||||
$_SESSION["message"] = $text['message-message_resent'];
|
||||
if (permission_exists('emails_all') && $_REQUEST['showall'] == 'true') {
|
||||
header("Location: email_delete.php?id=".$email_uuid."&showall=true");
|
||||
} else {
|
||||
header("Location: email_delete.php?id=".$email_uuid);
|
||||
}
|
||||
}
|
||||
|
||||
//restrict to command line only
|
||||
if(defined('STDIN')) {
|
||||
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
|
||||
preg_match("/^(.*)\/app\/.*$/", $document_root, $matches);
|
||||
$document_root = $matches[1];
|
||||
set_include_path($document_root);
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/classes/text.php";
|
||||
$_SERVER["DOCUMENT_ROOT"] = $document_root;
|
||||
$format = 'text'; //html, text
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
}
|
||||
else {
|
||||
die('access denied');
|
||||
}
|
||||
}
|
||||
unset ($prep_statement, $sql, $result, $result_count);
|
||||
|
||||
//get the failed emails
|
||||
$sql = "select email_uuid, email from v_emails";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$emails = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
|
||||
//process the emails
|
||||
if (is_array($emails)) {
|
||||
foreach($emails as $row) {
|
||||
$email_uuid = $row['email_uuid'];
|
||||
$msg = $row['email'];
|
||||
|
||||
require_once "secure/v_mailto.php";
|
||||
if ($mailer_error == '') {
|
||||
//get the message
|
||||
$_SESSION["message"] = $text['message-message_resent'];
|
||||
|
||||
exit;
|
||||
//delete the email
|
||||
$sql = "delete from v_emails ";
|
||||
$sql .= "where email_uuid = '".$email_uuid."' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql, $prep_statement);
|
||||
}
|
||||
unset($mailer_error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
unset ($prep_statement, $sql, $emails);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,22 +17,26 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('exec_sql')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('exec_sql')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -120,8 +124,7 @@ if (count($_POST)>0) {
|
||||
if ($table_name != '') { $sql_array[] = "select * from ".$table_name; }
|
||||
$show_query = (sizeof($sql_array) > 1) ? true : false;
|
||||
|
||||
reset($sql_array);
|
||||
foreach($sql_array as $sql_index => $sql) {
|
||||
if (is_array($sql_array)) foreach($sql_array as $sql_index => $sql) {
|
||||
$sql = trim($sql);
|
||||
|
||||
if (sizeof($sql_array) > 1 || $show_query) {
|
||||
@@ -147,20 +150,25 @@ if (count($_POST)>0) {
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
$x = 0;
|
||||
foreach ($result[0] as $key => $value) {
|
||||
echo "<th>".$key."</th>";
|
||||
$column_array[$x++] = $key;
|
||||
}
|
||||
|
||||
$x = 1;
|
||||
foreach ($result as &$row) {
|
||||
if ($x++ > 1000) { break; }
|
||||
echo "<tr>\n";
|
||||
foreach ($column_array as $column_index => $column) {
|
||||
echo "<td class='".$row_style[$c]."' ".(($column_index == 0) ? "style='border-left: none;'" : null).">".$row[$column]." </td>";
|
||||
if (is_array($result[0])) {
|
||||
foreach ($result[0] as $key => $value) {
|
||||
echo "<th>".$key."</th>";
|
||||
$column_array[$x++] = $key;
|
||||
}
|
||||
}
|
||||
$x = 1;
|
||||
if (is_array($result)) {
|
||||
foreach ($result as &$row) {
|
||||
if ($x++ > 1000) { break; }
|
||||
echo "<tr>\n";
|
||||
if (is_array($column_array)) {
|
||||
foreach ($column_array as $column_index => $column) {
|
||||
echo "<td class='".$row_style[$c]."' ".(($column_index == 0) ? "style='border-left: none;'" : null).">".$row[$column]." </td>";
|
||||
}
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$c = ($c == 0) ? 1 : 0;
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$c = ($c == 0) ? 1 : 0;
|
||||
}
|
||||
echo "</table>\n";
|
||||
echo "<br>\n";
|
||||
@@ -193,31 +201,36 @@ if (count($_POST)>0) {
|
||||
}
|
||||
|
||||
$x = 0;
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$column_array[$x++] = $key;
|
||||
if (is_array($result[0])) {
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$column_array[$x++] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
$column_array_count = count($column_array);
|
||||
|
||||
foreach ($result as &$row) {
|
||||
if (is_array($result)) foreach ($result as &$row) {
|
||||
echo "insert into ".$table_name." (";
|
||||
$x = 1;
|
||||
foreach ($column_array as $column) {
|
||||
if ($column != "menuid" && $column != "menuparentid") {
|
||||
$columns[] = $column;
|
||||
if (is_array($column_array)) {
|
||||
foreach ($column_array as $column) {
|
||||
if ($column != "menuid" && $column != "menuparentid") {
|
||||
$columns[] = $column;
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
if (is_array($columns) && sizeof($columns) > 0) {
|
||||
echo implode(', ', $columns);
|
||||
}
|
||||
echo ") values (";
|
||||
$x = 1;
|
||||
foreach ($column_array as $column) {
|
||||
if ($column != "menuid" && $column != "menuparentid") {
|
||||
$values[] = ($row[$column] != '') ? "'".check_str($row[$column])."'" : 'null';
|
||||
if (is_array($column_array)) {
|
||||
foreach ($column_array as $column) {
|
||||
if ($column != "menuid" && $column != "menuparentid") {
|
||||
$values[] = ($row[$column] != '') ? "'".check_str($row[$column])."'" : 'null';
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
if (is_array($values) && sizeof($values) > 0) {
|
||||
echo implode(', ', $values);
|
||||
@@ -253,18 +266,22 @@ if (count($_POST)>0) {
|
||||
}
|
||||
|
||||
$x = 0;
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$column_array[$x++] = $key;
|
||||
if (is_array($result[0])) {
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$column_array[$x++] = $key;
|
||||
}
|
||||
}
|
||||
//column names
|
||||
echo '"'.implode('","', $column_array).'"'."\r\n";
|
||||
//column values
|
||||
foreach ($result as &$row) {
|
||||
$x = 1;
|
||||
foreach ($column_array as $column) {
|
||||
echo '"'.check_str($row[$column]).'"'.(($x++ < count($column_array)) ? ',' : null);
|
||||
if (is_array($result)) {
|
||||
foreach ($result as &$row) {
|
||||
$x = 1;
|
||||
foreach ($column_array as $column) {
|
||||
echo '"'.check_str($row[$column]).'"'.(($x++ < count($column_array)) ? ',' : null);
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "number_alias";
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "extension_toll";
|
||||
|
||||
@@ -1598,4 +1598,4 @@ $text['button-call_routing']['ro'] = "rutare de apel";
|
||||
$text['button-call_routing']['ar-eg'] = "توجيه الدعوة";
|
||||
$text['button-call_routing']['he'] = "ניתוב שיחות";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,23 +17,27 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
if (permission_exists('extension_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('extension_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -47,7 +51,16 @@ else {
|
||||
$number_alias_new = check_str($_REQUEST["alias"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// skip the copy if the domain extension already exists
|
||||
$extension = new extension;
|
||||
if ($extension->exists($_SESSION['domain_uuid'], $extension_new)) {
|
||||
$_SESSION['message_mood'] = 'negative';
|
||||
$_SESSION["message"] = $text['message-duplicate'];
|
||||
header("Location: extensions.php");
|
||||
return;
|
||||
}
|
||||
|
||||
//get the v_extensions data
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
@@ -228,4 +241,4 @@ else {
|
||||
header("Location: extensions.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -334,15 +334,13 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
//set the default user context
|
||||
if (permission_exists("extension_user_context")) {
|
||||
//allow a user assigned to super admin to change the user_context
|
||||
}
|
||||
else {
|
||||
//if the user_context was not set then set the default value
|
||||
if (strlen($user_context) == 0) {
|
||||
$user_context = $_SESSION['domain_name'];
|
||||
}
|
||||
}
|
||||
if (permission_exists("extension_user_context")) {
|
||||
//allow a user assigned to super admin to change the user_context
|
||||
}
|
||||
else {
|
||||
//if the user_context was not set then set the default value
|
||||
$user_context = $_SESSION['domain_name'];
|
||||
}
|
||||
|
||||
//prevent users from bypassing extension limit by using range
|
||||
if ($_SESSION['limit']['extensions']['numeric'] != '') {
|
||||
@@ -675,7 +673,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
$sql .= "call_group = '$call_group', ";
|
||||
$sql .= "call_screen_enabled = '$call_screen_enabled', ";
|
||||
$sql .= "user_record = '$user_record', ";
|
||||
if (permission_exists('extension_user_record')) {
|
||||
$sql .= "user_record = '$user_record', ";
|
||||
}
|
||||
$sql .= "hold_music = '$hold_music', ";
|
||||
$sql .= "auth_acl = '$auth_acl', ";
|
||||
$sql .= "cidr = '$cidr', ";
|
||||
@@ -771,9 +771,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
require_once "app/provision/provision_write.php";
|
||||
$ext = new extension;
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
@@ -936,19 +939,21 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
unset($sql, $prep_statement);
|
||||
|
||||
//get assigned users
|
||||
$sql = "SELECT u.username, e.user_uuid FROM v_extension_users as e, v_users as u ";
|
||||
$sql .= "where e.user_uuid = u.user_uuid ";
|
||||
$sql .= "and u.user_enabled = 'true' ";
|
||||
$sql .= "and e.domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and e.extension_uuid = '".$extension_uuid."' ";
|
||||
$sql .= "order by u.username asc ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$assigned_users = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach($assigned_users as $field) {
|
||||
$assigned_user_uuids[] = $field['user_uuid'];
|
||||
if (is_uuid($extension_uuid)) {
|
||||
$sql = "SELECT u.username, e.user_uuid FROM v_extension_users as e, v_users as u ";
|
||||
$sql .= "where e.user_uuid = u.user_uuid ";
|
||||
$sql .= "and u.user_enabled = 'true' ";
|
||||
$sql .= "and e.domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and e.extension_uuid = '".$extension_uuid."' ";
|
||||
$sql .= "order by u.username asc ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$assigned_users = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach($assigned_users as $field) {
|
||||
$assigned_user_uuids[] = $field['user_uuid'];
|
||||
}
|
||||
unset($sql, $prep_statement);
|
||||
}
|
||||
unset($sql, $prep_statement);
|
||||
|
||||
//get the users
|
||||
$sql = "SELECT * FROM v_users ";
|
||||
@@ -1801,8 +1806,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</td>\n";
|
||||
echo "<td width=\"70%\" class='vtable' align='left'>\n";
|
||||
require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
|
||||
$options = '';
|
||||
$moh = new switch_music_on_hold;
|
||||
echo $moh->select('hold_music', $hold_music);
|
||||
echo $moh->select('hold_music', $hold_music, $options);
|
||||
echo " <br />\n";
|
||||
echo $text['description-hold_music']."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010 - 2014
|
||||
Copyright (C) 2010 - 2016
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -72,8 +72,16 @@ if (!class_exists('extension')) {
|
||||
public $description;
|
||||
|
||||
public function __construct() {
|
||||
require_once "resources/classes/database.php";
|
||||
$this->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3';
|
||||
//connect to the database if not connected
|
||||
if (!$this->db) {
|
||||
require_once "resources/classes/database.php";
|
||||
$database = new database;
|
||||
$database->connect();
|
||||
$this->db = $database->db;
|
||||
}
|
||||
|
||||
//set the application id
|
||||
$this->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3';
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
@@ -82,6 +90,24 @@ if (!class_exists('extension')) {
|
||||
}
|
||||
}
|
||||
|
||||
public function exists($domain_uuid, $extension) {
|
||||
$sql = "select extension_uuid from v_extensions ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and (extension = :extension or number_alias = :extension) ";
|
||||
$sql .= "and enabled = 'true' ";
|
||||
$prep_statement = $this->db->prepare($sql);
|
||||
$prep_statement->bindParam(':domain_uuid', $domain_uuid);
|
||||
$prep_statement->bindParam(':extension', $extension);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
if ($result && count($result) > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function get_domain_uuid() {
|
||||
return $this->domain_uuid;
|
||||
}
|
||||
@@ -174,7 +200,7 @@ if (!class_exists('extension')) {
|
||||
//write the xml files
|
||||
$sql = "SELECT * FROM v_extensions AS e, v_voicemails AS v ";
|
||||
$sql .= "WHERE e.domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "AND AND COALESCE(NULLIF(e.number_alias,''),e.extension) = CAST(v.voicemail_id as VARCHAR) ";
|
||||
$sql .= "AND COALESCE(NULLIF(e.number_alias,''),e.extension) = CAST(v.voicemail_id as VARCHAR) ";
|
||||
$sql .= "ORDER BY e.call_group ASC ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
|
||||
+167
-2
@@ -154,6 +154,169 @@
|
||||
$apps[$x]['permissions'][$y]['name'] = 'fax_active_all';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '6840bdb0-eb9d-45bd-a79a-ccb64d08fd97';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'allowed_extension';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '.pdf';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7031d8ec-4610-4696-b5b4-9b5f89f2bff1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'allowed_extension';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '.tif';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c3c4487d-62f1-48d1-9fda-048fca830fb9';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'allowed_extension';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '.tiff';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'cec88775-8aaf-4667-a04d-414b3274e545';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'cover_logo';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Path to image/logo file displayed in the header of the cover sheet.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '6aba55ae-ced9-4853-81d0-33667be763e5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'cover_font';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'times';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Font used to generate cover page. Can be full path to .ttf file or font name alredy installed.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '549f8854-2377-448f-892c-58a85ac83a56';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'cover_footer';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "The information contained in this facsimile is intended for the sole confidential use of the recipient(s) designated above, and may contain confidential and legally privileged information. If you are not the intended recipient, you are hereby notified that the review, disclosure, dissemination, distribution, copying, duplication in any form, and taking of any action in regards to the contents of this document - except with respect to its direct delivery to the intended recipient - is strictly prohibited. Please notify the sender immediately and destroy this cover sheet and all attachments. If stored or viewed electronically, please permanently delete it from your system.";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Notice displayed in the footer of the cover sheet.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'e907df99-6b3a-4864-bd11-681888f20289';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'cover_header';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Default information displayed beneath the logo in the header of the cover sheet.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8338a404-3966-416e-b4f9-a1ac36c37bd1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'page_size';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'letter';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default page size of new faxes.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '9fd6cb5f-5824-4cbb-89b2-53066649272e';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'resolution';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'normal';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default transmission quality of new faxes.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '63e55b19-8bf2-4aaa-b7df-a514c62ecfcc';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'variable';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'fax_enable_t38=true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable T.38';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '0f07d24a-296a-4798-8478-e6ef1a59f54f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'variable';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'fax_enable_t38_request=false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Send a T38 reinvite when a fax tone is detected.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7681e5d8-1462-420b-9276-acf4b2156982';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'variable';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'ignore_early_media=true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Ignore ringing to improve fax success rate.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '80eee263-a22c-4ec9-9df1-397908a274f6';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'keep_local';
|
||||
$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'] = 'Keep the file after sending or receiving the fax.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '63d2cb3c-708a-43c2-b233-a3f4e3367224';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_mode';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'queue';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd2977fe1-ee7e-4403-b44f-8d86aeb5f310';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_retry_limit';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Number of attempts to send fax (count only calls with answer)';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '6ca1712b-5a53-4c54-ba53-b2046c89280d';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_retry_interval';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '15';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Delay before we make next call after answered call';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '2c5640d0-493f-4426-b76d-04e378c86d76';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_no_answer_retry_limit';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Number of unanswered attempts in sequence';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '03820df1-f242-4358-950f-ede87f502e9a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_no_answer_retry_interval';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '30';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Delay before we make next call after no answered call';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '9ed2e73c-6b82-4a79-83db-b7588f78c675';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_no_answer_limit';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Giveup reach the destination after this number of sequences';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c97457b7-da9a-44a6-a4a4-442dbf5fa4fa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'fax';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'send_no_answer_interval';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '300';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Delay before next call sequence';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
@@ -507,7 +670,9 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_date";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "date";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "timestamp";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "date";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "timestamp";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_epoch";
|
||||
@@ -589,4 +754,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
|
||||
$z++;
|
||||
?>
|
||||
?>
|
||||
|
||||
+1
-170
@@ -2,175 +2,6 @@
|
||||
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'allowed_extension';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = '.pdf';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'allowed_extension';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = '.tif';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'allowed_extension';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = '.tiff';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'cover_logo';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Path to image/logo file displayed in the header of the cover sheet.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'cover_font';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'times';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Font used to generate cover page. Can be full path to .ttf file or font name alredy installed.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'cover_footer';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = "The information contained in this facsimile is intended for the sole confidential use of the recipient(s) designated above, and may contain confidential and legally privileged information. If you are not the intended recipient, you are hereby notified that the review, disclosure, dissemination, distribution, copying, duplication in any form, and taking of any action in regards to the contents of this document - except with respect to its direct delivery to the intended recipient - is strictly prohibited. Please notify the sender immediately and destroy this cover sheet and all attachments. If stored or viewed electronically, please permanently delete it from your system.";
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Notice displayed in the footer of the cover sheet.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'cover_header';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Default information displayed beneath the logo in the header of the cover sheet.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'page_size';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'letter';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the default page size of new faxes.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'resolution';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'normal';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the default transmission quality of new faxes.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'variable';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'fax_enable_t38=true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable T.38';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'variable';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'fax_enable_t38_request=false';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Send a T38 reinvite when a fax tone is detected.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'keep_local';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Keep the file after sending or receiving the fax.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_mode';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'queue';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_retry_limit';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '5';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Number of attempts to send fax (count only calls with answer)';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_retry_interval';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '15';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Delay before we make next call after answered call';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_no_answer_retry_limit';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '3';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Number of unanswered attempts in sequence';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_no_answer_retry_interval';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '30';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Delay before we make next call after no answered call';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_no_answer_limit';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '3';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Giveup reach the destination after this number of sequences';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'fax';
|
||||
$array[$x]['default_setting_subcategory'] = 'send_no_answer_interval';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '300';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Delay before next call sequence';
|
||||
$x++;
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$x = 0;
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
$missing[$x] = $setting;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($row);
|
||||
$message = $orm->message;
|
||||
unset($orm);
|
||||
}
|
||||
unset($missing);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -11,10 +11,8 @@ else {
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//pre-populate the form
|
||||
if (isset($_REQUEST["id"]) && isset($_REQUEST["fax_uuid"])) {
|
||||
|
||||
+59
-18
@@ -346,6 +346,11 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
$fax_name = str_replace("+", "_", $fax_name);
|
||||
$fax_name = str_replace("=", "_", $fax_name);
|
||||
|
||||
|
||||
$attachment_file_name = $_files['name'][$index];
|
||||
rename($dir_fax_temp.'/'.$attachment_file_name, $dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension);
|
||||
unset($attachment_file_name);
|
||||
|
||||
if (!$included) {
|
||||
//move uploaded file
|
||||
move_uploaded_file($_files['tmp_name'][$index], $dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension);
|
||||
@@ -354,7 +359,9 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
//convert uploaded file to pdf, if necessary
|
||||
if ($fax_file_extension != "pdf" && $fax_file_extension != "tif") {
|
||||
chdir($dir_fax_temp);
|
||||
exec("libreoffice --headless --convert-to pdf --outdir ".$dir_fax_temp." ".$dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension);
|
||||
if ($IS_WINDOWS) { $command = ''; } else { $command = 'export HOME=/tmp && '; }
|
||||
$command .= "libreoffice --headless --convert-to pdf --outdir ".$dir_fax_temp." ".$dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension;
|
||||
exec($command);
|
||||
@unlink($dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension);
|
||||
}
|
||||
|
||||
@@ -530,19 +537,51 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
}
|
||||
|
||||
//message
|
||||
$pdf -> Rect($x + 0.5, $y + 3.4, 7.5, 6.25, 'D');
|
||||
if ($fax_message != '') {
|
||||
$pdf -> SetAutoPageBreak(true, 0.6);
|
||||
$pdf -> SetTopMargin(0.6);
|
||||
$pdf -> SetFont($pdf_font, "", 12);
|
||||
$pdf -> SetXY($x + 0.75, $y + 3.65);
|
||||
$pdf -> MultiCell(7, 5.75, $fax_message, 0, 'L', false);
|
||||
$pdf -> MultiCell(7, 5.40, $fax_message, 0, 'L', false);
|
||||
}
|
||||
|
||||
$pages = $pdf -> getNumPages();
|
||||
|
||||
if($pages > 1) {
|
||||
# save ynew for last page
|
||||
$yn = $pdf -> GetY();
|
||||
|
||||
# First page
|
||||
$pdf -> setPage(1, 0);
|
||||
$pdf -> Rect($x + 0.5, $y + 3.4, 7.5, $page_height - 3.9, 'D');
|
||||
|
||||
# 2nd to N-th page
|
||||
for ($n = 2; $n < $pages; $n++) {
|
||||
$pdf -> setPage($n, 0);
|
||||
$pdf -> Rect($x + 0.5, $y + 0.5, 7.5, $page_height - 1, 'D');
|
||||
}
|
||||
|
||||
#Last page
|
||||
$pdf -> setPage($pages, 0);
|
||||
$pdf -> Rect($x + 0.5, 0.5, 7.5, $yn, 'D');
|
||||
$y = $yn;
|
||||
unset($yn);
|
||||
}
|
||||
else {
|
||||
$pdf -> Rect($x + 0.5, $y + 3.4, 7.5, 6.25, 'D');
|
||||
$y = $pdf -> GetY();
|
||||
}
|
||||
|
||||
//footer
|
||||
if ($fax_footer != '') {
|
||||
$pdf -> SetAutoPageBreak(true, 0.6);
|
||||
$pdf -> SetTopMargin(0.6);
|
||||
$pdf -> SetFont("helvetica", "", 8);
|
||||
$pdf -> SetXY($x + 0.5, $y + 9.9);
|
||||
$pdf -> SetXY($x + 0.5, $y + 0.6);
|
||||
$pdf -> MultiCell(7.5, 0.75, $fax_footer, 0, 'C', false);
|
||||
}
|
||||
$pdf -> SetAutoPageBreak(false);
|
||||
$pdf -> SetTopMargin(0);
|
||||
|
||||
// save cover pdf
|
||||
$pdf -> Output($dir_fax_temp.'/'.$fax_instance_uuid.'_cover.pdf', "F"); // Display [I]nline, Save to [F]ile, [D]ownload
|
||||
@@ -686,19 +725,18 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
|
||||
//send the fax
|
||||
$fax_file = $dir_fax_temp."/".$fax_instance_uuid.".tif";
|
||||
$common_dial_string = "for_fax=1,";
|
||||
$common_dial_string .= "accountcode='" . $fax_accountcode . "',";
|
||||
$common_dial_string .= "sip_h_X-accountcode='" . $fax_accountcode . "',";
|
||||
$common_dial_string .= "domain_uuid=" . $_SESSION["domain_uuid"] . ",";
|
||||
$common_dial_string .= "domain_name=" . $_SESSION["domain_name"] . ",";
|
||||
$common_dial_string .= "origination_caller_id_name='" . $fax_caller_id_name . "',";
|
||||
$common_dial_string .= "origination_caller_id_number='" . $fax_caller_id_number . "',";
|
||||
$common_dial_string .= "fax_ident='" . $fax_caller_id_number . "',";
|
||||
$common_dial_string .= "fax_header='" . $fax_caller_id_name . "',";
|
||||
$common_dial_string .= "fax_file='" . $fax_file . "',";
|
||||
$dial_string = "for_fax=1,";
|
||||
$dial_string .= "accountcode='" . $fax_accountcode . "',";
|
||||
$dial_string .= "sip_h_X-accountcode='" . $fax_accountcode . "',";
|
||||
$dial_string .= "domain_uuid=" . $_SESSION["domain_uuid"] . ",";
|
||||
$dial_string .= "domain_name=" . $_SESSION["domain_name"] . ",";
|
||||
$dial_string .= "origination_caller_id_name='" . $fax_caller_id_name . "',";
|
||||
$dial_string .= "origination_caller_id_number='" . $fax_caller_id_number . "',";
|
||||
$dial_string .= "fax_ident='" . $fax_caller_id_number . "',";
|
||||
$dial_string .= "fax_header='" . $fax_caller_id_name . "',";
|
||||
$dial_string .= "fax_file='" . $fax_file . "',";
|
||||
|
||||
foreach ($fax_numbers as $fax_number) {
|
||||
$dial_string = $common_dial_string;
|
||||
|
||||
fax_split_dtmf($fax_number, $fax_dtmf);
|
||||
|
||||
@@ -708,16 +746,19 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
if (count($route_array) == 0) {
|
||||
//send the internal call to the registered extension
|
||||
$fax_uri = "user/".$fax_number."@".$_SESSION['domain_name'];
|
||||
$t38 = "";
|
||||
$fax_variables = "";
|
||||
}
|
||||
else {
|
||||
//send the external call
|
||||
$fax_uri = $route_array[0];
|
||||
$t38 = "fax_enable_t38=true,fax_enable_t38_request=true,";
|
||||
$fax_variables = "";
|
||||
foreach($_SESSION['fax']['variable'] as $variable) {
|
||||
$fax_variables .= $variable.",";
|
||||
}
|
||||
}
|
||||
|
||||
if ($fax_send_mode != 'queue') {
|
||||
$dial_string .= $t38;
|
||||
$dial_string .= $fax_variables;
|
||||
$dial_string .= "mailto_address='" . $mailto_address . "',";
|
||||
$dial_string .= "mailfrom_address='" . $mailfrom_address . "',";
|
||||
$dial_string .= "fax_uri=" . $fax_uri . ",";
|
||||
|
||||
@@ -63,8 +63,9 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "follow_me_ignore_busy";
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "follow_me_cid_name_prefix";
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
@@ -178,4 +179,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "";
|
||||
$z++;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
+14
-10
@@ -23,16 +23,20 @@
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('gateway_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('gateway_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//application details
|
||||
$apps[$x]['name'] = "IVR Menu";
|
||||
$apps[$x]['uuid'] = "a5788e9b-58bc-bd1b-df59-fff5d51253ab";
|
||||
$apps[$x]['category'] = "Switch";;
|
||||
$apps[$x]['category'] = "Switch";
|
||||
$apps[$x]['subcategory'] = "";
|
||||
$apps[$x]['version'] = "";
|
||||
$apps[$x]['license'] = "Mozilla Public License 1.1";
|
||||
@@ -32,7 +32,7 @@
|
||||
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
|
||||
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
|
||||
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name}";
|
||||
//if ($_SESSION['ivr menu']['application']['text'] != "lua") {
|
||||
//if ($_SESSION['ivr_menu']['application']['text'] != "lua") {
|
||||
// $y++;
|
||||
// $apps[$x]['destinations'][$y]['type'] = "sql";
|
||||
// $apps[$x]['destinations'][$y]['label'] = "ivr_menus_sub";
|
||||
@@ -85,6 +85,25 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'ce17d7af-650a-49c0-b3e4-3bb8c1dad566';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'ivr_menu';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'option_add_rows';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '74376817-89de-49e1-bddd-868a8ebb49ec';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'ivr_menu';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'option_edit_rows';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
@@ -294,4 +313,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2010
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -26,19 +26,7 @@
|
||||
|
||||
//process this only one time
|
||||
if ($domains_processed == 1) {
|
||||
//set the sip_profiles directory for older installs
|
||||
if (isset($_SESSION['switch']['gateways']['dir'])) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->uuid($_SESSION['switch']['gateways']['uuid']);
|
||||
$array['default_setting_category'] = 'switch';
|
||||
$array['default_setting_subcategory'] = 'sip_profiles';
|
||||
$array['default_setting_name'] = 'dir';
|
||||
//$array['default_setting_value'] = '';
|
||||
//$array['default_setting_enabled'] = 'true';
|
||||
$orm->save($array);
|
||||
unset($array);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -297,20 +297,20 @@
|
||||
|
||||
//add an empty row to the options array
|
||||
if (count($ivr_menu_options) == 0) {
|
||||
$count = 5;
|
||||
$x = 0;
|
||||
$rows = $_SESSION['ivr_menu']['option_add_rows']['numeric'];
|
||||
$id = 0;
|
||||
}
|
||||
if (count($ivr_menu_options) > 0) {
|
||||
$count = 1;
|
||||
$x = '';
|
||||
$rows = $_SESSION['ivr_menu']['option_edit_rows']['numeric'];
|
||||
$id = count($ivr_menu_options)+1;
|
||||
}
|
||||
while ($x < $count) {
|
||||
$ivr_menu_options[$x]['ivr_menu_option_digits'] = '';
|
||||
$ivr_menu_options[$x]['ivr_menu_option_action'] = '';
|
||||
$ivr_menu_options[$x]['ivr_menu_option_param'] = '';
|
||||
$ivr_menu_options[$x]['ivr_menu_option_order'] = '';
|
||||
$ivr_menu_options[$x]['ivr_menu_option_description'] = '';
|
||||
$x++;
|
||||
for ($x = 0; $x < $rows; $x++) {
|
||||
$ivr_menu_options[$id]['ivr_menu_option_digits'] = '';
|
||||
$ivr_menu_options[$id]['ivr_menu_option_action'] = '';
|
||||
$ivr_menu_options[$id]['ivr_menu_option_param'] = '';
|
||||
$ivr_menu_options[$id]['ivr_menu_option_order'] = '';
|
||||
$ivr_menu_options[$id]['ivr_menu_option_description'] = '';
|
||||
$id++;
|
||||
}
|
||||
|
||||
//set the defaults
|
||||
|
||||
@@ -450,6 +450,13 @@ include "root.php";
|
||||
//echo "</pre>\n";
|
||||
//exit;
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p->add("dialplan_add", 'temp');
|
||||
$p->add("dialplan_detail_add", 'temp');
|
||||
$p->add("dialplan_edit", 'temp');
|
||||
$p->add("dialplan_detail_edit", 'temp');
|
||||
|
||||
//save the dialplan
|
||||
$orm = new orm;
|
||||
$orm->name('dialplans');
|
||||
@@ -465,6 +472,12 @@ include "root.php";
|
||||
//echo "</pre>\n";
|
||||
//exit;
|
||||
|
||||
//remove the temporary permission
|
||||
$p->delete("dialplan_add", 'temp');
|
||||
$p->delete("dialplan_detail_add", 'temp');
|
||||
$p->delete("dialplan_edit", 'temp');
|
||||
$p->delete("dialplan_detail_edit", 'temp');
|
||||
|
||||
//synchronize the xml config
|
||||
save_dialplan_xml();
|
||||
|
||||
|
||||
@@ -27,93 +27,99 @@
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//set the directory
|
||||
$xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs';
|
||||
$xml_file = $xml_dir."/local_stream.conf";
|
||||
if (is_array($_SESSION["switch"]["conf"])) {
|
||||
$xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs';
|
||||
$xml_file = $xml_dir."/local_stream.conf";
|
||||
}
|
||||
|
||||
//rename the file
|
||||
if (file_exists($xml_dir.'/local_stream.conf.xml')) {
|
||||
rename($xml_dir.'/local_stream.conf', $xml_dir.'/'.$xml_file);
|
||||
}
|
||||
if (file_exists($xml_dir.'/local_stream.conf.xml.noload')) {
|
||||
rename($xml_dir.'/local_stream.conf', $xml_dir.'/'.$xml_file);
|
||||
if (is_array($_SESSION["switch"]["conf"])) {
|
||||
if (file_exists($xml_dir.'/local_stream.conf.xml')) {
|
||||
rename($xml_dir.'/local_stream.conf', $xml_dir.'/'.$xml_file);
|
||||
}
|
||||
if (file_exists($xml_dir.'/local_stream.conf.xml.noload')) {
|
||||
rename($xml_dir.'/local_stream.conf', $xml_dir.'/'.$xml_file);
|
||||
}
|
||||
}
|
||||
|
||||
//add the music_on_hold list to the database
|
||||
$sql = "select count(*) as num_rows from v_music_on_hold; ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
|
||||
//set the alternate directory
|
||||
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/local_stream.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);
|
||||
}
|
||||
$xml_object = simplexml_load_string($xml_string);
|
||||
$json = json_encode($xml_object);
|
||||
$conf_array = json_decode($json, true);
|
||||
|
||||
//process the array
|
||||
foreach ($conf_array['directory'] as $row) {
|
||||
//get the data from the array
|
||||
$stream_name = $row['@attributes']['name'];
|
||||
$stream_path = $row['@attributes']['path'];
|
||||
foreach ($row['param'] as $p) {
|
||||
$name = $p['@attributes']['name'];
|
||||
$name = str_replace("-", "_", $name);
|
||||
$$name = $p['@attributes']['value'];
|
||||
$attributes[] = $name;
|
||||
}
|
||||
|
||||
//strip the domain name and rate from the name
|
||||
$array = explode('/', $stream_name);
|
||||
if (count($array) == 3) { $stream_name = $array[1]; }
|
||||
if (count($array) == 2) { $stream_name = $array[0]; }
|
||||
|
||||
//insert the data into the database
|
||||
$music_on_hold_uuid = uuid();
|
||||
$sql = "insert into v_music_on_hold ";
|
||||
$sql .= "(";
|
||||
$sql .= "music_on_hold_uuid, ";
|
||||
$sql .= "music_on_hold_name, ";
|
||||
if (isset($rate)) $sql .= "music_on_hold_rate, ";
|
||||
if (isset($shuffle)) $sql .= "music_on_hold_shuffle, ";
|
||||
if (isset($timer_name)) $sql .= "music_on_hold_timer_name, ";
|
||||
if (isset($chime_list)) $sql .= "music_on_hold_chime_list, ";
|
||||
if (isset($chime_freq)) $sql .= "music_on_hold_chime_freq, ";
|
||||
if (isset($chime_max)) $sql .= "music_on_hold_chime_max, ";
|
||||
$sql .= "music_on_hold_path ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "( ";
|
||||
$sql .= "'".$music_on_hold_uuid."', ";
|
||||
$sql .= "'".check_str($stream_name)."', ";
|
||||
if (isset($rate)) $sql .= "'".check_str($rate)."', ";
|
||||
if (isset($shuffle)) $sql .= "'".check_str($shuffle)."', ";
|
||||
if (isset($timer_name)) $sql .= "'".check_str($timer_name)."', ";
|
||||
if (isset($chime_list)) $sql .= "'".check_str($chime_list)."', ";
|
||||
if (isset($chime_max)) $sql .= "'".check_str($chime_max)."', ";
|
||||
$sql .= "'".check_str($stream_path)."' ";
|
||||
$sql .= ");";
|
||||
//echo $sql."\n";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//unset the attribute variables
|
||||
foreach ($attributes as $value) {
|
||||
unset($$value);
|
||||
}
|
||||
}
|
||||
if (is_array($_SESSION["switch"]["conf"])) {
|
||||
$sql = "select count(music_on_hold_uuid) as num_rows from v_music_on_hold; ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
|
||||
} //if num_rows
|
||||
} //if prep_statement
|
||||
//set the alternate directory
|
||||
$xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/local_stream.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);
|
||||
}
|
||||
$xml_object = simplexml_load_string($xml_string);
|
||||
$json = json_encode($xml_object);
|
||||
$conf_array = json_decode($json, true);
|
||||
|
||||
//process the array
|
||||
foreach ($conf_array['directory'] as $row) {
|
||||
//get the data from the array
|
||||
$stream_name = $row['@attributes']['name'];
|
||||
$stream_path = $row['@attributes']['path'];
|
||||
foreach ($row['param'] as $p) {
|
||||
$name = $p['@attributes']['name'];
|
||||
$name = str_replace("-", "_", $name);
|
||||
$$name = $p['@attributes']['value'];
|
||||
$attributes[] = $name;
|
||||
}
|
||||
|
||||
//strip the domain name and rate from the name
|
||||
$array = explode('/', $stream_name);
|
||||
if (count($array) == 3) { $stream_name = $array[1]; }
|
||||
if (count($array) == 2) { $stream_name = $array[0]; }
|
||||
|
||||
//insert the data into the database
|
||||
$music_on_hold_uuid = uuid();
|
||||
$sql = "insert into v_music_on_hold ";
|
||||
$sql .= "(";
|
||||
$sql .= "music_on_hold_uuid, ";
|
||||
$sql .= "music_on_hold_name, ";
|
||||
if (isset($rate)) $sql .= "music_on_hold_rate, ";
|
||||
if (isset($shuffle)) $sql .= "music_on_hold_shuffle, ";
|
||||
if (isset($timer_name)) $sql .= "music_on_hold_timer_name, ";
|
||||
if (isset($chime_list)) $sql .= "music_on_hold_chime_list, ";
|
||||
if (isset($chime_freq)) $sql .= "music_on_hold_chime_freq, ";
|
||||
if (isset($chime_max)) $sql .= "music_on_hold_chime_max, ";
|
||||
$sql .= "music_on_hold_path ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "( ";
|
||||
$sql .= "'".$music_on_hold_uuid."', ";
|
||||
$sql .= "'".check_str($stream_name)."', ";
|
||||
if (isset($rate)) $sql .= "'".check_str($rate)."', ";
|
||||
if (isset($shuffle)) $sql .= "'".check_str($shuffle)."', ";
|
||||
if (isset($timer_name)) $sql .= "'".check_str($timer_name)."', ";
|
||||
if (isset($chime_list)) $sql .= "'".check_str($chime_list)."', ";
|
||||
if (isset($chime_max)) $sql .= "'".check_str($chime_max)."', ";
|
||||
$sql .= "'".check_str($stream_path)."' ";
|
||||
$sql .= ");";
|
||||
//echo $sql."\n";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//unset the attribute variables
|
||||
foreach ($attributes as $value) {
|
||||
unset($$value);
|
||||
}
|
||||
}
|
||||
|
||||
} //if num_rows
|
||||
} //if prep_statement
|
||||
} //if is_array
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -24,17 +24,20 @@
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
if (permission_exists('operator_panel_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
//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;
|
||||
@@ -42,33 +45,38 @@ else {
|
||||
|
||||
//set user status
|
||||
if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') {
|
||||
$user_status = check_str($_REQUEST['status']);
|
||||
//sql update
|
||||
$sql = "update v_users set ";
|
||||
$sql .= "user_status = '".$user_status."' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and user_uuid = '".$_SESSION['user']['user_uuid']."' ";
|
||||
if (permission_exists("user_account_setting_edit")) {
|
||||
$count = $db->exec(check_sql($sql));
|
||||
}
|
||||
//update the status
|
||||
$user_status = check_str($_REQUEST['status']);
|
||||
$sql = "update v_users set ";
|
||||
$sql .= "user_status = '".$user_status."' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and user_uuid = '".$_SESSION['user']['user_uuid']."' ";
|
||||
if (permission_exists("user_account_setting_edit")) {
|
||||
$count = $db->exec(check_sql($sql));
|
||||
}
|
||||
|
||||
//if call center app is installed then update the user_status
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/call_centers')) {
|
||||
//update the user_status
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
$switch_cmd .= "callcenter_config agent set status ".$_SESSION['user']['username']."@".$_SESSION['domain_name']." '".$user_status."'";
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
//if call center app is installed then update the user_status
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/call_centers')) {
|
||||
//update the user_status
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
$switch_cmd .= "callcenter_config agent set status ".$_SESSION['user']['username']."@".$_SESSION['domain_name']." '".$user_status."'";
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
|
||||
//update the user state
|
||||
$cmd = "api callcenter_config agent set state ".$_SESSION['user']['username']."@".$_SESSION['domain_name']." Waiting";
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
}
|
||||
//update the user state
|
||||
$cmd = "api callcenter_config agent set state ".$_SESSION['user']['username']."@".$_SESSION['domain_name']." Waiting";
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
}
|
||||
|
||||
exit;
|
||||
//stop execution
|
||||
exit;
|
||||
}
|
||||
|
||||
$document['title'] = $text['title-operator_panel'];
|
||||
require_once "resources/header.php";
|
||||
//set the title
|
||||
$document['title'] = $text['title-operator_panel'];
|
||||
|
||||
//include the header
|
||||
require_once "resources/header.php";
|
||||
|
||||
?>
|
||||
|
||||
<!-- virtual_drag function holding elements -->
|
||||
@@ -427,11 +435,15 @@ require_once "resources/header.php";
|
||||
</style>
|
||||
|
||||
<?php
|
||||
|
||||
//create simple array of users own extensions
|
||||
unset($_SESSION['user']['extensions']);
|
||||
foreach ($_SESSION['user']['extension'] as $assigned_extensions) {
|
||||
$_SESSION['user']['extensions'][] = $assigned_extensions['user'];
|
||||
if (is_array($_SESSION['user']['extension'])) {
|
||||
foreach ($_SESSION['user']['extension'] as $assigned_extensions) {
|
||||
$_SESSION['user']['extensions'][] = $assigned_extensions['user'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id='ajax_reponse'></div>
|
||||
@@ -439,5 +451,6 @@ foreach ($_SESSION['user']['extension'] as $assigned_extensions) {
|
||||
<br><br>
|
||||
|
||||
<?php
|
||||
require_once "resources/footer.php";
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
?>
|
||||
|
||||
@@ -17,46 +17,56 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "./resources/functions/get_call_activity.php";
|
||||
if (permission_exists('operator_panel_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "./resources/functions/get_call_activity.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();
|
||||
|
||||
$activity = get_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; }
|
||||
//get the call activity
|
||||
$activity = get_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'];
|
||||
}
|
||||
}
|
||||
else if ($fields['call_group'] != '') {
|
||||
$groups[] = $fields['call_group'];
|
||||
if (is_array($groups)) {
|
||||
$groups = array_unique($groups);
|
||||
sort($groups);
|
||||
}
|
||||
}
|
||||
if (is_array($groups)) {
|
||||
$groups = array_unique($groups);
|
||||
sort($groups);
|
||||
}
|
||||
|
||||
//prevent warnings
|
||||
if (!is_array($_SESSION['user']['extensions'])) {
|
||||
$_SESSION['user']['extensions'] = array();
|
||||
}
|
||||
|
||||
|
||||
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
|
||||
|
||||
|
||||
+284
-10
@@ -1,19 +1,293 @@
|
||||
<?php
|
||||
|
||||
//application details
|
||||
//$apps[$x]['name'] = "Provision";
|
||||
//$apps[$x]['uuid'] = "abf28ead-92ef-3de6-ebbb-023fbc2b6dd3";
|
||||
//$apps[$x]['category'] = "Switch";;
|
||||
//$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'] = "Writes the provisioning files from templates.";
|
||||
//$apps[$x]['description']['fr-fr'] = "Ecrit les fichiers de provisioning à partir des modèles.";
|
||||
$apps[$x]['name'] = "Provision";
|
||||
$apps[$x]['uuid'] = "abf28ead-92ef-3de6-ebbb-023fbc2b6dd3";
|
||||
$apps[$x]['category'] = "Switch";;
|
||||
$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'] = "Writes the provisioning files from templates.";
|
||||
$apps[$x]['description']['fr-fr'] = "Ecrit les fichiers de provisioning à partir des modèles.";
|
||||
|
||||
//permission details
|
||||
//$apps[$x]['permissions'][0]['name'] = "zzz";
|
||||
//$apps[$x]['permissions'][0]['groups'][] = "admin";
|
||||
//$apps[$x]['permissions'][0]['groups'][] = "superadmin";
|
||||
|
||||
?>
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '931f9369-9aac-4620-8d4b-7d2bf642b1d2';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'enabled';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '3790e46b-ef9e-4cdc-bfd2-6b3708751843';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'auto_insert_enabled';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '27b7ccfd-58d7-409c-80ff-cca014349d70';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'http_auth_type';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'digest';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c6a5b05b-210d-484f-bbb6-c1dd2223992e';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'http_auth_username';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'ed380d7d-b3b8-40b4-8528-f10d521ddef0';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'http_auth_password';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd376fe0f-fb89-4418-8fb4-590e4cac483f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'cidr';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'a5323190-b733-49c1-99c4-396ab8950bb8';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin_name';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'ae3f809e-81af-4ed4-82f7-275251210d3a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin_password';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'cd2173be-aa43-4fd2-9c75-02f49c199485';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'path';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '559cd2d6-8ca0-4e6e-ae9d-565c8eed898d';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'voicemail_number';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '*97';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'a9dc7f4a-0a19-40cb-829a-093bf81d00db';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'line_sip_port';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '5060';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '472300e4-267a-4f0d-83ab-04d2017c7d0f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'line_sip_transport';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'tcp';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '5bc38b86-089f-44cb-9fff-38be38c497e8';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'line_register_expires';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '80';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '1752b247-873b-4d41-9846-b9df93efe8df';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'polycom_gmt_offset';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '3600 * GMT offset';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '098b2abd-3af3-4104-8fba-fabf9573f925';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'polycom_digitmap';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '[*]xxxx|[2-9]11|0T|011xxx.T|[0-1][2-9]xxxxxxxxx|[2-9]xxxxxxxxx|[1-9]xxT|**x.T';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '5aa7f396-d742-48f1-b53f-c609b9a6759a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'daylight_savings_start_month';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7d742914-9c55-4cee-a295-c19501389f41';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'daylight_savings_start_day';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '13';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7b444c2f-bed7-4da5-8cf3-4cc79df8625f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'daylight_savings_start_time';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '2';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'f8e7b78b-1b84-42da-9e14-ec03dbb67c52';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'daylight_savings_stop_month';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '11';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '6f4a9657-e130-4003-bc96-22a1312d76f4';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'daylight_savings_stop_day';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '6';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd3e72ae2-b887-443d-8523-96726343bb55';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'daylight_savings_stop_time';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '2';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '931d6cc7-ca82-4813-ae92-7015e0c2ea1b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'http_domain_filter';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'fc2fa8cd-b14e-48e3-99bd-7c01c9d6208d';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'yealink_time_zone';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '-6';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Time zone ranges from -11 to +12';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7f4a1607-4cbe-49f5-8cd2-6d599b89bd9b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'yealink_time_format';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '0-12 Hour, 1-24 Hour';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '166b27d1-1860-4154-88d3-5e15781e7bbb';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'yealink_date_format';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '0-WWW MMM DD (default), 1-DD-MMM-YY, 2-YYYY-MM-DD, 3-DD/MM/YYYY, 4-MM/DD/YY, 5-DD MMM YYYY, 6-WWW DD MMM';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '05bcbb47-06f6-4c81-a1c9-cdf2982d60a7';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'yealink_rport';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Send the response back to the source it came from.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '70894b7b-2edd-41ad-8526-060589df4e11';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'yealink_session_timer';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'SIP Session Timers';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'aa200d6f-c048-4203-9838-8dd05fa31bd5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'yealink_retransmission';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'boolean';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Retransmission';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '6c4430f6-3713-4c8b-9da3-eaf1705d7dc3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'contact_users';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c5196771-f408-40b3-81c7-b4ce525620c3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'contact_groups';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8854358d-c6a4-4eeb-b21b-37ced80a4fbb';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'contact_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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'allow extensions to be provisioned as contacts as $extensions in provision templates';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd157078e-b363-4f34-a6d4-8a86990a40b7';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'number_as_presence_id';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$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'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '48dd60fe-d7de-417c-85c4-2d2d897a709c';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'ntp_server_primary';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'pool.ntp.org';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7bcc3c26-ac55-4934-be9f-e0edfbc7193b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'ntp_server_secondary';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '2.us.pool.ntp.org';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
|
||||
?>
|
||||
|
||||
+18
-315
@@ -24,329 +24,32 @@
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//normalize the mac address
|
||||
//process this code online once
|
||||
if ($domains_processed == 1) {
|
||||
//normalize the mac address
|
||||
$sql = "select device_uuid, device_mac_address ";
|
||||
$sql .= "from v_devices ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and (device_mac_address like '%-%' or device_mac_address like '%:%') ";
|
||||
$sql .= "where (device_mac_address like '%-%' or device_mac_address like '%:%') ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach($result as $row) {
|
||||
$device_uuid = $row["device_uuid"];
|
||||
$device_mac_address = $row["device_mac_address"];
|
||||
$device_mac_address = strtolower($device_mac_address);
|
||||
$device_mac_address = preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address);
|
||||
if (is_array($result)) {
|
||||
foreach($result as $row) {
|
||||
$device_uuid = $row["device_uuid"];
|
||||
$device_mac_address = $row["device_mac_address"];
|
||||
$device_mac_address = strtolower($device_mac_address);
|
||||
$device_mac_address = preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address);
|
||||
|
||||
$sql = "update v_devices set ";
|
||||
$sql .= "device_mac_address = '".$device_mac_address."' ";
|
||||
$sql .= "where device_uuid = '".$device_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
$sql = "update v_devices set ";
|
||||
$sql .= "device_mac_address = '".$device_mac_address."' ";
|
||||
$sql .= "where device_uuid = '".$device_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
}
|
||||
}
|
||||
|
||||
//process this code online once
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'enabled';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'auto_insert_enabled';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'http_auth_type';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'digest';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'http_auth_username';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'http_auth_password';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'cidr';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin_name';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin_password';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'path';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'voicemail_number';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '*97';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'line_sip_port';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '5060';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'line_sip_transport';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'tcp';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'line_register_expires';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '80';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'polycom_gmt_offset';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '3600 * GMT offset';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'polycom_digitmap';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '[*]xxxx|[2-9]11|0T|011xxx.T|[0-1][2-9]xxxxxxxxx|[2-9]xxxxxxxxx|[1-9]xxT|**x.T';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'daylight_savings_start_month';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '3';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'daylight_savings_start_day';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '13';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'daylight_savings_start_time';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '2';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'daylight_savings_stop_month';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '11';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'daylight_savings_stop_day';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '6';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'daylight_savings_stop_time';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '2';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'http_domain_filter';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'false';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'yealink_time_zone';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '-6';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Time zone ranges from -11 to +12';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'yealink_time_format';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '1';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '0-12 Hour, 1-24 Hour';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'yealink_date_format';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '3';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '0-WWW MMM DD (default), 1-DD-MMM-YY, 2-YYYY-MM-DD, 3-DD/MM/YYYY, 4-MM/DD/YY, 5-DD MMM YYYY, 6-WWW DD MMM';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'contact_users';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'contact_groups';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'contact_extensions';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'allow extensions to be provisioned as contacts as $extensions in provision templates';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'ntp_server_primary';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'pool.ntp.org';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'ntp_server_secondary';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '2.us.pool.ntp.org';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'provision' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$x = 0;
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
$missing[$x] = $setting;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($row);
|
||||
$message = $orm->message;
|
||||
unset($orm);
|
||||
//print_r($message);
|
||||
}
|
||||
unset($missing);
|
||||
|
||||
//move the dynamic provision variables that from v_vars table to v_default_settings
|
||||
if (count($_SESSION['provision']) == 0) {
|
||||
$sql = "select * from v_vars ";
|
||||
$sql .= "where var_cat = 'Provision' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
//set the variable
|
||||
$var_name = check_str($row['var_name']);
|
||||
//remove the 'v_' prefix from the variable name
|
||||
if (substr($var_name, 0, 2) == "v_") {
|
||||
$var_name = substr($var_name, 2);
|
||||
}
|
||||
//add the provision variable to the default settings table
|
||||
$sql = "insert into v_default_settings ";
|
||||
$sql .= "(";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
$sql .= "default_setting_subcategory, ";
|
||||
$sql .= "default_setting_name, ";
|
||||
$sql .= "default_setting_value, ";
|
||||
$sql .= "default_setting_enabled, ";
|
||||
$sql .= "default_setting_description ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'provision', ";
|
||||
$sql .= "'".$var_name."', ";
|
||||
$sql .= "'var', ";
|
||||
$sql .= "'".check_str($row['var_value'])."', ";
|
||||
$sql .= "'".check_str($row['var_enabled'])."', ";
|
||||
$sql .= "'".check_str($row['var_description'])."' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement);
|
||||
//delete the provision variables from system -> variables
|
||||
//$sql = "delete from v_vars ";
|
||||
//$sql .= "where var_cat = 'Provision' ";
|
||||
//echo $sql ."\n";
|
||||
//$db->exec(check_sql($sql));
|
||||
//echo "$var_name $var_value \n";
|
||||
}
|
||||
|
||||
//unset the array variable
|
||||
unset($array);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -54,10 +54,8 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
||||
}
|
||||
|
||||
// Escence make request based on UserID for Memory keys
|
||||
/*
|
||||
The file name is fixed to `Account1_Extern.xml`.
|
||||
(Account1 is the first account you register)
|
||||
*/
|
||||
// The file name is fixed to `Account1_Extern.xml`.
|
||||
// (Account1 is the first account you register)
|
||||
if(empty($mac) && !empty($ext)){
|
||||
$domain_array = explode(":", $_SERVER["HTTP_HOST"]);
|
||||
$domain_name = $domain_array[0];
|
||||
@@ -84,7 +82,7 @@ The file name is fixed to `Account1_Extern.xml`.
|
||||
}
|
||||
|
||||
//prepare the mac address
|
||||
if (isset($_REQUEST['mac'])) {
|
||||
if (isset($mac)) {
|
||||
//normalize the mac address to lower case
|
||||
$mac = strtolower($mac);
|
||||
//replace all non hexadecimal values and validate the mac address
|
||||
|
||||
@@ -281,6 +281,8 @@ include "root.php";
|
||||
foreach($_SESSION['provision'] as $key=>$val) {
|
||||
if (strlen($val['var']) > 0) { $value = $val['var']; }
|
||||
if (strlen($val['text']) > 0) { $value = $val['text']; }
|
||||
if (strlen($val['boolean']) > 0) { $value = $val['boolean']; }
|
||||
if (strlen($val['numeric']) > 0) { $value = $val['numeric']; }
|
||||
if (strlen($value) > 0) { $provision[$key] = $value; }
|
||||
unset($value);
|
||||
}
|
||||
@@ -670,7 +672,7 @@ include "root.php";
|
||||
$sql .= "WHEN 'programmable' THEN 3 ";
|
||||
$sql .= "WHEN 'expansion' THEN 4 ";
|
||||
$sql .= "ELSE 100 END, ";
|
||||
if ($db_type == "mysql") {
|
||||
if ($GLOBALS['db_type'] == "mysql") {
|
||||
$sql .= "device_key_id ASC, ";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -17,29 +17,29 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//if the recordings directory doesn't exist then create it
|
||||
if (strlen($_SESSION['switch']['recordings']['dir']."/".$domain_name) > 0) {
|
||||
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { event_socket_mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name,02770,true); }
|
||||
}
|
||||
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//if the recordings directory doesn't exist then create it
|
||||
if (is_array($_SESSION['switch']['recordings']) && strlen($_SESSION['switch']['recordings']['dir']."/".$domain_name) > 0) {
|
||||
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { event_socket_mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name,02770,true); }
|
||||
}
|
||||
|
||||
//if base64, populate from existing recording files, then remove
|
||||
if ($_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
||||
if (is_array($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
||||
//get recordings without base64 in db
|
||||
$sql = "select recording_uuid, domain_uuid, recording_filename ";
|
||||
$sql .= "from v_recordings where recording_base64 is null or recording_base64 = '' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
if (count($result) > 0) {
|
||||
if (is_array($result)) {
|
||||
foreach ($result as &$row) {
|
||||
$recording_uuid = $row['recording_uuid'];
|
||||
$recording_domain_uuid = $row['domain_uuid'];
|
||||
@@ -64,7 +64,7 @@ if ($domains_processed == 1) {
|
||||
unset($sql, $prep_statement, $result, $row);
|
||||
}
|
||||
//if not base64, decode to local files, remove base64 data from db
|
||||
else if ($_SESSION['recordings']['storage_type']['text'] != 'base64') {
|
||||
else if (is_array($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] != 'base64') {
|
||||
//get recordings with base64 in db
|
||||
$sql = "select recording_uuid, domain_uuid, recording_filename, recording_base64 ";
|
||||
$sql .= "from v_recordings where recording_base64 is not null ";
|
||||
@@ -99,4 +99,4 @@ if ($domains_processed == 1) {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
<?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-2016
|
||||
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('recording_play')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
$filename = base64_decode($_GET['filename']);
|
||||
$type = $_GET['type']; //moh //rec
|
||||
|
||||
//show the content
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
||||
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align='center'>
|
||||
<b>file: <?php echo $filename ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center'>
|
||||
<?php
|
||||
// detect browser
|
||||
$user_agent = http_user_agent();
|
||||
$browser_name = $user_agent['name'];
|
||||
|
||||
$file_ext = substr($filename, -3);
|
||||
if ($file_ext == "wav") {
|
||||
//HTML5 method
|
||||
if ($browser_name == "Google Chrome" || $browser_name == "Mozilla Firefox") {
|
||||
echo "<audio src=\"recordings.php?a=download&type=".$type."&filename=".base64_encode($filename)."\" autoplay=\"true\" ></audio>";
|
||||
}
|
||||
else {
|
||||
echo "<audio src=\"http://localhost:8000/mod/recordings/recordings.php?a=download&type=".$type."&filename=".base64_encode($filename)."\" autoplay=\"autoplay\"></audio>";
|
||||
echo "<embed src=\"recordings.php?a=download&type=".$type."&filename=".base64_encode($filename)."\" autostart=\"true\" width=\"300\" height=\"90\" name=\"sound_".$filename."\" enablejavascript=\"true\">\n";
|
||||
}
|
||||
}
|
||||
if ($file_ext == "mp3") {
|
||||
echo "<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"17\" data=\"slim.swf?autoplay=true&song_title=".urlencode($filename)."&song_url=recordings.php?a=download&type=".$type."&filename=".base64_encode($filename)."\">\n";
|
||||
echo "<param name=\"movie\" value=\"slim.swf?autoplay=true&song_url=recordings.php?a=download&type=".$type."&filename=".base64_encode($filename)."\" />\n";
|
||||
echo "<param name=\"quality\" value=\"high\"/>\n";
|
||||
echo "<param name=\"bgcolor\" value=\"#E6E6E6\"/>\n";
|
||||
echo "</object>\n";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -17,16 +17,18 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
James Rose <james.o.rose@gmail.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -49,7 +51,8 @@ require_once "resources/check_auth.php";
|
||||
if ($_GET['a'] == "download" && (permission_exists('recording_play') || permission_exists('recording_download'))) {
|
||||
session_cache_limiter('public');
|
||||
if ($_GET['type'] = "rec") {
|
||||
$path = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'];
|
||||
//set the path for the directory
|
||||
$path = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'];
|
||||
|
||||
//if from recordings, get recording details from db
|
||||
$recording_uuid = check_str($_GET['id']); //recordings
|
||||
@@ -125,11 +128,21 @@ require_once "resources/check_auth.php";
|
||||
//upload the recording
|
||||
if (permission_exists('recording_upload')) {
|
||||
if ($_POST['submit'] == $text['button-upload'] && $_POST['type'] == 'rec' && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
|
||||
$recording_filename = str_replace(" ", "_", $_FILES['ulfile']['name']);
|
||||
$recording_filename = str_replace("'", "", $recording_filename);
|
||||
move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename);
|
||||
|
||||
$_SESSION['message'] = $text['message-uploaded'].": ".htmlentities($recording_filename);
|
||||
//remove special characters
|
||||
$recording_filename = str_replace(" ", "_", $_FILES['ulfile']['name']);
|
||||
$recording_filename = str_replace("'", "", $recording_filename);
|
||||
|
||||
//make sure the destination directory exists
|
||||
if (!is_dir($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'])) {
|
||||
event_socket_mkdir($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name']);
|
||||
}
|
||||
|
||||
//move the uploaded files
|
||||
move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename);
|
||||
|
||||
//set the message
|
||||
$_SESSION['message'] = $text['message-uploaded'].": ".htmlentities($recording_filename);
|
||||
|
||||
//set the file name to be inserted as the recording description
|
||||
$recording_description = base64_encode($_FILES['ulfile']['name']);
|
||||
@@ -348,12 +361,14 @@ require_once "resources/check_auth.php";
|
||||
if (file_exists($file_name)) {
|
||||
$file_size = filesize($file_name);
|
||||
$file_size = byte_convert($file_size);
|
||||
$file_date = date("M d, Y H:i:s", filemtime($file_name));
|
||||
}
|
||||
else {
|
||||
$file_size = '';
|
||||
$file_date = '';
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center; white-space: nowrap;'>".$file_size."</td>\n";
|
||||
$file_date = date("M d, Y H:i:s", filemtime($file_name));
|
||||
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".$file_date."</td>\n";
|
||||
}
|
||||
else {
|
||||
@@ -479,4 +494,4 @@ function range_download($file) {
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -37,17 +37,26 @@ function get_registrations($sip_profile_name) {
|
||||
$registrations[$x]['mwi-account'] = $row->{'mwi-account'} ?: " ";
|
||||
$registrations[$x]['status'] = $row->{'status'} ?: " ";
|
||||
$registrations[$x]['ping-time'] = $row->{'ping-time'} ?: " ";
|
||||
|
||||
|
||||
//get network-ip to url or blank
|
||||
if(isset($row->{'network-ip'})) {
|
||||
$registrations[$x]['network-ip'] = "<a href='http://".$row->{'network-ip'}."' target='_blank'>".$row->{'network-ip'}."</a>";
|
||||
$registrations[$x]['network-ip'] = "<a href='http://".$row->{'network-ip'}."' target='_blank'>".$row->{'network-ip'}."</a>";
|
||||
}else{
|
||||
$registrations[$x]['network-ip'] = " ";
|
||||
}
|
||||
//get the LAN IP address if it exists replace the external ip
|
||||
$call_id_array = explode('@', $row->{'call-id'});
|
||||
if (isset($call_id_array[1])) {
|
||||
$registrations[$x]['lan-ip'] = "<a href='http://".$call_id_array[1]."' target='_blank'>".$call_id_array[1]."</a>";
|
||||
$agent = $row->{'agent'};
|
||||
$lan_ip = $call_id_array[1];
|
||||
if (false !== stripos($agent, 'grandstream')) {
|
||||
$lan_ip = str_ireplace(
|
||||
array('A','B','C','D','E','F','G','H','I','J'),
|
||||
array('0','1','2','3','4','5','6','7','8','9'),
|
||||
$lan_ip
|
||||
);
|
||||
}
|
||||
$registrations[$x]['lan-ip'] = "<a href='http://".$lan_ip."' target='_blank'>".$lan_ip."</a>";
|
||||
}else{
|
||||
$registrations[$x]['lan-ip'] = " ";
|
||||
}
|
||||
@@ -61,7 +70,7 @@ function get_registrations($sip_profile_name) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//increment the array id
|
||||
$x++;
|
||||
}
|
||||
@@ -70,5 +79,5 @@ function get_registrations($sip_profile_name) {
|
||||
//return the registrations array
|
||||
return $registrations;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -97,6 +97,25 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '745d8fdc-57bc-4f43-97d7-508fda8f70a8';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'ring_group';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'destination_add_rows';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'ddf306c9-6f58-40f7-910e-2f27dc33fa57';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'ring_group';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'destination_edit_rows';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
|
||||
@@ -17,26 +17,16 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2008-2014 All Rights Reserved.
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
include "resources/classes/template.php";
|
||||
if (if_group("admin") || if_group("superadmin")) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//output template to string for header processing
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $domain_uuid;
|
||||
$response = $prov->write();
|
||||
//process this only one time
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -72,6 +72,13 @@ else {
|
||||
$sql .= "and ring_group_uuid = '".$id."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//delete the ring group users
|
||||
$sql = "delete from v_ring_group_users ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and ring_group_uuid = '".$id."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//delete the dialplan details
|
||||
$sql = "delete from v_dialplan_details ";
|
||||
|
||||
@@ -25,17 +25,21 @@
|
||||
James Rose <james.o.rose@gmail.com>
|
||||
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/classes/ringbacks.php";
|
||||
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/classes/ringbacks.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -420,18 +424,24 @@ else {
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$ring_group_destinations = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$x = count($ring_group_destinations);
|
||||
$limit = $x + 1;
|
||||
}
|
||||
|
||||
while($x < $limit) {
|
||||
$ring_group_destinations[$x]['destination_number'] = '';
|
||||
$ring_group_destinations[$x]['destination_delay'] = '';
|
||||
$ring_group_destinations[$x]['destination_timeout'] = '';
|
||||
$ring_group_destinations[$x]['destination_prompt'] = '';
|
||||
$x++;
|
||||
//add an empty row to the options array
|
||||
if (count($ring_group_destinations) == 0) {
|
||||
$rows = $_SESSION['ring_group']['destination_add_rows']['numeric'];
|
||||
$id = 0;
|
||||
}
|
||||
if (count($ring_group_destinations) > 0) {
|
||||
$rows = $_SESSION['ring_group']['destination_edit_rows']['numeric'];
|
||||
$id = count($ring_group_destinations)+1;
|
||||
}
|
||||
for ($x = 0; $x < $rows; $x++) {
|
||||
$ring_group_destinations[$id]['destination_number'] = '';
|
||||
$ring_group_destinations[$id]['destination_delay'] = '';
|
||||
$ring_group_destinations[$id]['destination_timeout'] = '';
|
||||
$ring_group_destinations[$id]['destination_prompt'] = '';
|
||||
$id++;
|
||||
}
|
||||
unset($limit);
|
||||
|
||||
//get the ring group users
|
||||
if (strlen($ring_group_uuid) > 0) {
|
||||
|
||||
@@ -93,7 +93,7 @@ if (!class_exists('scripts')) {
|
||||
* Copy the switch scripts from the web directory to the switch directory
|
||||
*/
|
||||
public function copy_files() {
|
||||
if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
if (is_array($_SESSION['switch']['scripts'])) {
|
||||
$dst_dir = $_SESSION['switch']['scripts']['dir'];
|
||||
if(strlen($dst_dir) == 0) {
|
||||
throw new Exception("Cannot copy scripts the 'script_dir' is empty");
|
||||
@@ -122,7 +122,7 @@ if (!class_exists('scripts')) {
|
||||
* Writes the config.lua
|
||||
*/
|
||||
public function write_config() {
|
||||
if (is_dir($_SESSION['switch']['scripts']['dir'])) {
|
||||
if (is_array($_SESSION['switch']['scripts'])) {
|
||||
|
||||
//replace the backslash with a forward slash
|
||||
$this->db_path = str_replace("\\", "/", $this->db_path);
|
||||
@@ -143,13 +143,15 @@ if (!class_exists('scripts')) {
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$this->dsn_name = $row["database_name"];
|
||||
$this->dsn_username = $row["database_username"];
|
||||
$this->dsn_password = $row["database_password"];
|
||||
break; //limit to 1 row
|
||||
if (is_array($result)) {
|
||||
foreach ($result as &$row) {
|
||||
$this->dsn_name = $row["database_name"];
|
||||
$this->dsn_username = $row["database_username"];
|
||||
$this->dsn_password = $row["database_password"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
else {
|
||||
$odbc_num_rows = '0';
|
||||
@@ -252,11 +254,13 @@ if (!class_exists('scripts')) {
|
||||
}
|
||||
$tmp .= "--set defaults\n";
|
||||
$tmp .= " expire = {}\n";
|
||||
$tmp .= " expire.default = \"3600\";\n";
|
||||
$tmp .= " expire.directory = \"3600\";\n";
|
||||
$tmp .= " expire.dialplan = \"3600\";\n";
|
||||
$tmp .= " expire.languages = \"3600\";\n";
|
||||
$tmp .= " expire.sofia = \"3600\";\n";
|
||||
$tmp .= " expire.acl = \"3600\";\n";
|
||||
$tmp .= " expire.ivr = \"3600\";\n";
|
||||
$tmp .= "\n";
|
||||
$tmp .= "--set xml_handler\n";
|
||||
$tmp .= " xml_handler = {}\n";
|
||||
|
||||
@@ -58,6 +58,19 @@
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_delete";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'sip_profile_domain_view';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'sip_profile_domain_add';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'sip_profile_domain_edit';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'sip_profile_domain_delete';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
@@ -89,6 +102,36 @@
|
||||
|
||||
$y = 1; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_sip_profile_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'sip_profile_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'] = 'primary';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'sip_profile_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_sip_profile';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'sip_profile_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'sip_profile_domain_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the name.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'sip_profile_domain_alias';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enable or disable the alias.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'sip_profile_domain_parse';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enable or disable the parsing.';
|
||||
$z++;
|
||||
|
||||
$y = 2; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = "v_sip_profile_settings";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "sip_profile_setting_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
|
||||
@@ -119,4 +162,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
|
||||
$z++;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2014
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -100,6 +100,32 @@
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//get the domain, alias and parse values and set as variables
|
||||
$sip_profile_domain_name = $sip_profile['domains']['domain']['@attributes']['name'];
|
||||
$sip_profile_domain_alias = $sip_profile['domains']['domain']['@attributes']['alias'];
|
||||
$sip_profile_domain_parse = $sip_profile['domains']['domain']['@attributes']['parse'];
|
||||
|
||||
//add the sip profile domains name, alias and parse
|
||||
$sip_profile_domain_uuid = uuid();
|
||||
$sql = "insert into v_sip_profile_domains";
|
||||
$sql .= "(";
|
||||
$sql .= "sip_profile_domain_uuid, ";
|
||||
$sql .= "sip_profile_uuid, ";
|
||||
$sql .= "sip_profile_domain_name, ";
|
||||
$sql .= "sip_profile_domain_alias, ";
|
||||
$sql .= "sip_profile_domain_parse ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "( ";
|
||||
$sql .= "'".$sip_profile_domain_uuid."', ";
|
||||
$sql .= "'".$sip_profile_uuid."', ";
|
||||
$sql .= "'".check_str($sip_profile_domain_name)."', ";
|
||||
$sql .= "'".check_str($sip_profile_domain_alias)."', ";
|
||||
$sql .= "'".check_str($sip_profile_domain_parse)."' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//add the sip profile settings
|
||||
foreach ($sip_profile['settings']['param'] as $row) {
|
||||
//get the name and value pair
|
||||
@@ -142,6 +168,85 @@
|
||||
}
|
||||
unset($prep_statement);
|
||||
}
|
||||
|
||||
//upgrade - add missing sip profiles domain settings
|
||||
$sql = "select count(*) as num_rows from v_sip_profile_domains ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
if (file_exists('/usr/share/examples/fusionpbx/resources/templates/conf/sip_profiles')) {
|
||||
$sip_profile_dir = '/usr/share/examples/fusionpbx/resources/templates/conf/sip_profiles/*.xml.noload';
|
||||
}
|
||||
elseif (file_exists('/usr/local/share/fusionpbx/resources/templates/conf/sip_profiles')) {
|
||||
$sip_profile_dir = '/usr/local/share/fusionpbx/resources/templates/conf/sip_profiles/*.xml.noload';
|
||||
}
|
||||
else {
|
||||
$sip_profile_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/conf/sip_profiles/*.xml.noload';
|
||||
}
|
||||
$db->beginTransaction();
|
||||
$xml_files = glob($sip_profile_dir);
|
||||
foreach ($xml_files as &$xml_file) {
|
||||
//load the sip profile xml and save it into an array
|
||||
$sip_profile_xml = file_get_contents($xml_file);
|
||||
$xml = simplexml_load_string($sip_profile_xml);
|
||||
$json = json_encode($xml);
|
||||
$sip_profile = json_decode($json, true);
|
||||
$sip_profile_name = $sip_profile['@attributes']['name'];
|
||||
$sip_profile_enabled = $sip_profile['@attributes']['enabled'];
|
||||
//echo "sip profile name: ".$sip_profile_name."\n";
|
||||
|
||||
//get the domain, alias and parse values and set as variables
|
||||
$sip_profile_domain_name = $sip_profile['domains']['domain']['@attributes']['name'];
|
||||
$sip_profile_domain_alias = $sip_profile['domains']['domain']['@attributes']['alias'];
|
||||
$sip_profile_domain_parse = $sip_profile['domains']['domain']['@attributes']['parse'];
|
||||
|
||||
//get the sip_profile_uuid using the sip profile name
|
||||
$sql = "select sip_profile_uuid from v_sip_profiles ";
|
||||
$sql .= "where sip_profile_name = '$sip_profile_name' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$sip_profile_uuid = $result[0]["sip_profile_uuid"];
|
||||
unset ($prep_statement);
|
||||
|
||||
//add the sip profile domains name, alias and parse
|
||||
if ($sip_profile_uuid) {
|
||||
$sip_profile_domain_uuid = uuid();
|
||||
$sql = "insert into v_sip_profile_domains";
|
||||
$sql .= "(";
|
||||
$sql .= "sip_profile_domain_uuid, ";
|
||||
$sql .= "sip_profile_uuid, ";
|
||||
$sql .= "sip_profile_domain_name, ";
|
||||
$sql .= "sip_profile_domain_alias, ";
|
||||
$sql .= "sip_profile_domain_parse ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "( ";
|
||||
$sql .= "'".$sip_profile_domain_uuid."', ";
|
||||
$sql .= "'".$sip_profile_uuid."', ";
|
||||
$sql .= "'".check_str($sip_profile_domain_name)."', ";
|
||||
$sql .= "'".check_str($sip_profile_domain_alias)."', ";
|
||||
$sql .= "'".check_str($sip_profile_domain_parse)."' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//unset the sip_profile_uuid
|
||||
unset($sip_profile_uuid);
|
||||
}
|
||||
$db->commit();
|
||||
|
||||
//save the sip profile xml
|
||||
save_sip_profile_xml();
|
||||
|
||||
//apply settings reminder
|
||||
$_SESSION["reload_xml"] = true;
|
||||
}
|
||||
unset($prep_statement);
|
||||
}
|
||||
}
|
||||
|
||||
//if empty, set sip_profile_enabled = true
|
||||
|
||||
+28
-2
@@ -19,5 +19,31 @@
|
||||
$apps[$x]['description']['fr-ch'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "";
|
||||
$apps[$x]['description']['pt-br'] = "";
|
||||
|
||||
?>
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'e13895b7-ef2f-43ed-8d2a-e739ccffccc2';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'tftp_service_address';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '0.0.0.0';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'the address for the TFTP service to listen for connection on';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '3fe87ea5-9633-4af0-bb5c-a61dbba2772c';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'tftp_service_port';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '69';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'the port for the TFTP service to listen for connection on';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '5e21c189-ac27-42aa-acaf-57c8cdcbbcef';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'provision';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'tftp_service_file_path';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '/tmp';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'the location for static files e.g. firmware';
|
||||
|
||||
?>
|
||||
|
||||
@@ -28,62 +28,5 @@
|
||||
//process this code online once
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'tftp_service_address';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = '0.0.0.0';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'the address for the TFTP service to listen for connection on';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'tftp_service_port';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '69';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'the port for the TFTP service to listen for connection on';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'provision';
|
||||
$array[$x]['default_setting_subcategory'] = 'tftp_service_file_path';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '/tmp';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'the location for static files e.g. firmware';
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "SELECT * FROM v_default_settings ";
|
||||
$sql .= "WHERE default_setting_category = 'provision' AND default_setting_subcategory LIKE 'tftp_service_%'";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$missing = [];
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) $missing[] = $setting;
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($row);
|
||||
$message = $orm->message;
|
||||
unset($orm);
|
||||
//print_r($message);
|
||||
}
|
||||
unset($missing);
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -58,4 +58,147 @@
|
||||
$apps[$x]['permissions'][$y]['name'] = "time_condition_domain";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
//define region presets
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c8cbb0eb-850b-4afd-a918-cceaf8af3957';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'region';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'What region to use by default when choosing Time Conditions';
|
||||
|
||||
//define English holiday presets
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '528ec73e-03bb-4ea1-9ce1-19b81fb3f584';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_england';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_day":{"mday":"1","mon":"1"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'England Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '420b7282-2e49-4d63-9eb3-48b3b96bc184';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_england';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"may_day":{"mon":"5","mday":"1-7","wday":"2"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'England Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c9ab6e93-63e0-4098-9290-7a721e813450';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_england';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"spring_bank_holiday":{"mon":"5","mday":"25-31","wday":"2"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'England Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'b7eac3ac-a99d-4fc8-8e3e-682a17a5b463';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_england';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"august_bank_holiday":{"mon":"8","mday":"25-31","wday":"2"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'England Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'cde53fd6-713e-43f9-beed-3cace375de56';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_england';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_day":{"mday":"25","mon":"12"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'England Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '3ddfd3b3-5c2e-45ef-b3ca-7f361ecc0a93';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_england';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"boxing_day":{"mday":"26","mon":"12"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'England Holiday';
|
||||
|
||||
//define USA holiday presets
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '3df036bb-ae96-4735-96da-a32e90b51940';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_day":{"mday":"1","mon":"1"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '7a12b17c-67d9-439e-98fb-70039d27cf21';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"martin_luther_king_jr_day":{"wday":"2","mon":"1","mday":"15-21"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '1ce5c94b-7181-4b33-92b0-2cf4a97f2fa3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"presidents_day":{"wday":"2","mon":"2","mday":"15-21"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '0957bbc4-60e8-44d1-b51d-943de4ee5b2f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"memorial_day":{"mday":"25-31","wday":"2","mon":"5"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '0aa94174-a339-47d6-b6ab-c264b3786074';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"independence_day":{"mday":"4","mon":"7"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'be512c08-029e-49a0-937d-1a62fc029609';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"labor_day":{"wday":"2","mon":"9","mday":"1-7"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '261a0ea4-26a3-4261-95e5-888afd221ca0';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"columbus_day":{"wday":"2","mon":"10","mday":"8-14"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '829d346b-b0ed-4690-8641-8ed01052e303';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"veterans_day":{"mday":"11","mon":"11"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c1fdfebe-3544-4b01-8a83-d0fee8e9a47a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"thanksgiving_day":{"wday":"5-6","mon":"11","mday":"22-28"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '82e3eb39-27a4-4d70-8436-11059d3e51e7';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_usa';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_day":{"mday":"25","mon":"12"}}';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'USA Holiday';
|
||||
|
||||
?>
|
||||
|
||||
@@ -2,116 +2,6 @@
|
||||
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define holiday presets
|
||||
$preset['usa'][] = json_encode(array("new_years_day" => array("mday" => "1", "mon" => "1")));
|
||||
$preset['usa'][] = json_encode(array("martin_luther_king_jr_day" => array("wday" => "2", "mon" => "1", "mday" => "15-21")));
|
||||
$preset['usa'][] = json_encode(array("presidents_day" => array("wday" => "2", "mon" => "2", "mday" => "15-21")));
|
||||
$preset['usa'][] = json_encode(array("memorial_day" => array("mday" => "25-31", "wday" => "2", "mon" => "5")));
|
||||
$preset['usa'][] = json_encode(array("independence_day" => array("mday" => "4", "mon" => "7")));
|
||||
$preset['usa'][] = json_encode(array("labor_day" => array("wday" => "2", "mon" => "9", "mday" => "1-7")));
|
||||
$preset['usa'][] = json_encode(array("columbus_day" => array("wday" => "2", "mon" => "10", "mday" => "8-14")));
|
||||
$preset['usa'][] = json_encode(array("veterans_day" => array("mday" => "11", "mon" => "11")));
|
||||
$preset['usa'][] = json_encode(array("thanksgiving_day" => array("wday" => "5-6", "mon" => "11", "mday" => "22-28")));
|
||||
$preset['usa'][] = json_encode(array("christmas_day" => array("mday" => "25", "mon" => "12")));
|
||||
|
||||
$preset['england'][] = json_encode(array("new_years_day" => array("mday" => "1", "mon" => "1")));
|
||||
$preset['england'][] = json_encode(array("christmas_day" => array("mday" => "25", "mon" => "12")));
|
||||
$preset['england'][] = json_encode(array("boxing_day" => array("mday" => "26", "mon" => "12")));
|
||||
$preset['england'][] = json_encode(array("may_day" => array("mon" => "5", "mday" => "1-7", "wday" => "2")));
|
||||
$preset['england'][] = json_encode(array("spring_bank_holiday" => array("mon" => "5", "mday" => "25-31", "wday" => "2")));
|
||||
$preset['england'][] = json_encode(array("august_bank_holiday" => array("mon" => "8", "mday" => "25-31", "wday" => "2")));
|
||||
|
||||
//iterate and migrate old presets first
|
||||
$sql = "update v_default_settings ";
|
||||
$sql .= "set default_setting_subcategory = 'preset_usa' ";
|
||||
$sql .= ", default_setting_description = 'usa Holiday' ";
|
||||
$sql .= "where default_setting_category = 'time_conditions' ";
|
||||
$sql .= "and default_setting_subcategory = 'preset' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
unset ($prep_statement, $sql);
|
||||
}
|
||||
|
||||
//iterate and add each, if necessary
|
||||
$x = 0;
|
||||
foreach ($preset as $region => $data) {
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'time_conditions' ";
|
||||
$sql .= "and default_setting_subcategory = 'preset_$region' ";
|
||||
$sql .= "and default_setting_name = 'array' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
foreach ($data as $json) {
|
||||
$found = false;
|
||||
$missing[$x]['default_setting_category'] = 'time_conditions';
|
||||
$missing[$x]['default_setting_subcategory'] = "preset_$region";
|
||||
$missing[$x]['default_setting_name'] = 'array';
|
||||
$missing[$x]['default_setting_value'] = $json;
|
||||
$missing[$x]['default_setting_enabled'] = 'true';
|
||||
$missing[$x]['default_setting_description'] = "$region Holiday";
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_value']) == trim($json)) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($row);
|
||||
$message = $orm->message;
|
||||
unset($orm);
|
||||
//print_r($message);
|
||||
}
|
||||
unset($missing);
|
||||
|
||||
$array[$x]['default_setting_category'] = 'time_conditions';
|
||||
$array[$x]['default_setting_subcategory'] = 'region';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'usa';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'What region to use by default when choosing Time Conditions';
|
||||
$x++;
|
||||
|
||||
//iterate and add each, if necessary
|
||||
foreach ($array as $index => $default_settings) {
|
||||
|
||||
//add the default setting
|
||||
$sql = "select count(*) as num_rows from v_default_settings ";
|
||||
$sql .= "where default_setting_category = '".$default_settings['default_setting_category']."' ";
|
||||
$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";
|
||||
$sql .= "and default_setting_name = '".$default_settings['default_setting_name']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($array[$index]);
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//unset the array variable
|
||||
unset($array);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -296,10 +296,10 @@
|
||||
if ($cond_var == 'time-of-day') {
|
||||
$cond_var = 'minute-of-day';
|
||||
$array_cond_start = explode(':', $cond_start);
|
||||
$cond_start = ($array_cond_start[0] * 60) + $array_cond_start[1] + 1;
|
||||
$cond_start = ($array_cond_start[0] * 60) + $array_cond_start[1];
|
||||
if ($cond_stop != '') {
|
||||
$array_cond_stop = explode(':', $cond_stop);
|
||||
$cond_stop = ($array_cond_stop[0] * 60) + $array_cond_stop[1] + 1;
|
||||
$cond_stop = ($array_cond_stop[0] * 60) + $array_cond_stop[1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -758,7 +758,7 @@
|
||||
|
||||
case 'time-of-day': //time of day
|
||||
for (h = 0; h <= 23; h++) {
|
||||
for (m = 0; m <= 55; m += 5) {
|
||||
for (m = 0; m <= 59; m += 1) {
|
||||
sel_start.options[sel_start.options.length] = new Option(((h != 0) ? ((h >= 12) ? ((h == 12) ? h : (h - 12)) + ':' + pad(m, 2) + ' PM' : h + ':' + pad(m, 2) + ' AM') : '12:' + pad(m, 2) + ' AM'), pad(h, 2) + ':' + pad(m, 2));
|
||||
sel_stop.options[sel_stop.options.length] = new Option(((h != 0) ? ((h >= 12) ? ((h == 12) ? h : (h - 12)) + ':' + pad(m, 2) + ' PM' : h + ':' + pad(m, 2) + ' AM') : '12:' + pad(m, 2) + ' AM'), pad(h, 2) + ':' + pad(m, 2));
|
||||
}
|
||||
@@ -960,8 +960,6 @@ if ($action == 'update') {
|
||||
//convert minute-of-day to time-of-day values
|
||||
if ($cond_var == 'minute-of-day') {
|
||||
$cond_var = 'time-of-day';
|
||||
--$cond_val_start;
|
||||
--$cond_val_stop;
|
||||
$cond_val_start = number_pad(floor($cond_val_start / 60),2).":".number_pad(fmod($cond_val_start, 60),2);
|
||||
if ($cond_val_stop != '') {
|
||||
$cond_val_stop = number_pad(floor($cond_val_stop / 60),2).":".number_pad(fmod($cond_val_stop, 60),2);
|
||||
|
||||
@@ -259,7 +259,6 @@ EOD;
|
||||
//migrate old ringtones
|
||||
$sql = "update v_vars ";
|
||||
$sql .= "set var_cat = 'Ringtones' ";
|
||||
$sql .= "set var_description = 'TWlncmF0ZWQgZnJvbSBEZWZhdWx0cw==' ";
|
||||
$sql .= "where var_name like '%-ring' ";
|
||||
$sql .= "and var_cat = 'Defaults' ";
|
||||
$sql .= "and var_description = '' ";
|
||||
@@ -372,4 +371,4 @@ EOD;
|
||||
//save the vars.xml file
|
||||
save_var_xml();
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
+19
-15
@@ -17,22 +17,26 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('var_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('var_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -110,9 +114,9 @@ else {
|
||||
if ($result_count > 0) {
|
||||
$prev_var_cat = '';
|
||||
foreach($result as $row) {
|
||||
$var_value = $row[var_value];
|
||||
$var_value = $row['var_value'];
|
||||
$var_value = substr($var_value, 0, 50);
|
||||
if ($prev_var_cat != $row[var_cat]) {
|
||||
if ($prev_var_cat != $row['var_cat']) {
|
||||
$c=0;
|
||||
if (strlen($prev_var_cat) > 0) {
|
||||
echo "<tr>\n";
|
||||
@@ -166,7 +170,7 @@ else {
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$prev_var_cat = $row[var_cat];
|
||||
$prev_var_cat = $row['var_cat'];
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
@@ -194,4 +198,4 @@ else {
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -64,6 +64,66 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "admin";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "user";
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = "voicemail_sms_edit";
|
||||
$y++;
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '1cf61dea-42b5-4799-b9fa-f2c3bd29e933';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'voicemail_file';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'attach';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Define whether to attach voicemail files to email notifications, or only include a link.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '4723fe3b-e7ec-409e-a4a8-15ae274253fb';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'keep_local';
|
||||
$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'] = 'Define whether to keep voicemail files on the local system after sending attached via email.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '9a4879c0-87ac-42e5-99f2-2ca2c77dbd98';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'storage_type';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'base64';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Define which storage type (base_64 stores in the database).';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '690a36a8-b6d3-47ea-8780-1af609c1966c';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'message_max_length';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '300';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Maximum length of a voicemail (in seconds).';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'bfe802b1-fcad-41a3-9da2-6b0efdb0c05f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_length';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '8';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'The default length of characters in a voicemail password.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'b127ca03-c682-4d71-b412-4e50f1aca339';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'greeting_max_length';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '90';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Maximum length of a voicemail greeting (in seconds).';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'dd09f9d8-6662-4270-9dac-b87191b77012';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'display_domain_name';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable display of @domain_name after voicemail_id when rendering emails.';
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
@@ -95,10 +155,18 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the greeting id.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_alternate_greet_id";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Used to provide an alternate id for the voicemail announcement.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_mail_to";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the email address to send voicemail to.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_sms_to";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the sms did to send voicemail to.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_attach_file";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Choose whether to attach the file to the email.";
|
||||
@@ -184,6 +252,10 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Voicemail file encoded in base64.";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "message_transcription";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Voicemail transcription.";
|
||||
$z++;
|
||||
|
||||
$y = 2; //table array index
|
||||
$z = 0; //field array index
|
||||
@@ -264,4 +336,5 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
|
||||
?>
|
||||
|
||||
@@ -52,8 +52,25 @@
|
||||
if (strlen($this->domain_uuid) == 0) {
|
||||
$this->domain_uuid = $_SESSION['domain_uuid'];
|
||||
}
|
||||
}
|
||||
|
||||
//get the voicemail_id
|
||||
public function __destruct() {
|
||||
foreach ($this as $key => $value) {
|
||||
unset($this->$key);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_voicemail_id() {
|
||||
|
||||
//check if for valid input
|
||||
if (is_uuid($this->voicemail_uuid) && is_uuid($this->domain_uuid) ) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//get the voicemail id if it isn't set already
|
||||
if (!isset($this->voicemail_id)) {
|
||||
$sql = "select voicemail_id from v_voicemails ";
|
||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||
@@ -68,14 +85,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
foreach ($this as $key => $value) {
|
||||
unset($this->$key);
|
||||
}
|
||||
}
|
||||
|
||||
public function voicemails() {
|
||||
|
||||
//check if for valid input
|
||||
if (is_uuid($this->domain_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//set the voicemail id and voicemail uuid arrays
|
||||
if (isset($_SESSION['user']['extension'])) foreach ($_SESSION['user']['extension'] as $index => $row) {
|
||||
if (strlen($row['number_alias']) > 0) {
|
||||
@@ -102,12 +121,14 @@
|
||||
else {
|
||||
//ensure that the requested voicemail box is assigned to this user
|
||||
$found = false;
|
||||
if (is_array($voicemail_uuids)) foreach($voicemail_uuids as $row) {
|
||||
if ($voicemail_uuid == $row['voicemail_uuid']) {
|
||||
$sql .= "and voicemail_uuid = '".$row['voicemail_uuid']."' ";
|
||||
$found = true;
|
||||
if (is_array($voicemail_uuids)) {
|
||||
foreach($voicemail_uuids as $row) {
|
||||
if ($voicemail_uuid == $row['voicemail_uuid']) {
|
||||
$sql .= "and voicemail_uuid = '".$row['voicemail_uuid']."' ";
|
||||
$found = true;
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
//id requested is not owned by the user return no results
|
||||
if (!$found) {
|
||||
@@ -163,74 +184,100 @@
|
||||
}
|
||||
|
||||
public function voicemail_messages() {
|
||||
$sql = "select * from v_voicemail_messages as m, v_voicemails as v ";
|
||||
$sql .= "where m.domain_uuid = '$this->domain_uuid' ";
|
||||
$sql .= "and m.voicemail_uuid = v.voicemail_uuid ";
|
||||
if (is_array($this->voicemail_id)) {
|
||||
$sql .= "and (";
|
||||
$x = 0;
|
||||
if (is_array($this->voicemail_id)) foreach($this->voicemail_id as $row) {
|
||||
if ($x > 0) {
|
||||
$sql .= "or ";
|
||||
}
|
||||
$sql .= "v.voicemail_id = '".$row['voicemail_id']."' ";
|
||||
$x++;
|
||||
}
|
||||
$sql .= ") ";
|
||||
}
|
||||
else {
|
||||
$sql .= "and v.voicemail_id = '$this->voicemail_id' ";
|
||||
}
|
||||
if (strlen($this->order_by) == 0) {
|
||||
$sql .= "order by v.voicemail_id, m.created_epoch desc ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by v.voicemail_id, m.$this->order_by $this->order ";
|
||||
}
|
||||
//$sql .= "limit $this->rows_per_page offset $this->offset ";
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
$result_count = count($result);
|
||||
unset ($prep_statement, $sql);
|
||||
if ($result_count > 0) {
|
||||
if (is_array($result)) foreach($result as &$row) {
|
||||
//set the greeting directory
|
||||
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
|
||||
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.wav')) {
|
||||
$row['file_path'] = $path.'/msg_'.$row['voicemail_message_uuid'].'.wav';
|
||||
}
|
||||
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.mp3')) {
|
||||
$row['file_path'] = $path.'/msg_'.$row['voicemail_message_uuid'].'.mp3';
|
||||
}
|
||||
$row['file_size'] = filesize($row['file_path']);
|
||||
$row['file_size_label'] = byte_convert($row['file_size']);
|
||||
$row['file_ext'] = substr($row['file_path'], -3);
|
||||
|
||||
$message_length = $row['message_length'];
|
||||
if ($message_length < 60 ) {
|
||||
$message_length = $message_length. " sec";
|
||||
}
|
||||
else {
|
||||
$message_length = round(($message_length/60), 2). " min";
|
||||
}
|
||||
$row['message_length_label'] = $message_length;
|
||||
$row['created_date'] = date("j M Y g:i a",$row['created_epoch']);
|
||||
//check if for valid input
|
||||
if (is_numeric($this->voicemail_id) && is_uuid($this->domain_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//get the message from the database
|
||||
$sql = "select * from v_voicemail_messages as m, v_voicemails as v ";
|
||||
$sql .= "where m.domain_uuid = '$this->domain_uuid' ";
|
||||
$sql .= "and m.voicemail_uuid = v.voicemail_uuid ";
|
||||
if (is_array($this->voicemail_id)) {
|
||||
$sql .= "and (";
|
||||
$x = 0;
|
||||
if (is_array($this->voicemail_id)) foreach($this->voicemail_id as $row) {
|
||||
if ($x > 0) {
|
||||
$sql .= "or ";
|
||||
}
|
||||
$sql .= "v.voicemail_id = '".$row['voicemail_id']."' ";
|
||||
$x++;
|
||||
}
|
||||
$sql .= ") ";
|
||||
}
|
||||
else {
|
||||
$sql .= "and v.voicemail_id = '$this->voicemail_id' ";
|
||||
}
|
||||
if (strlen($this->order_by) == 0) {
|
||||
$sql .= "order by v.voicemail_id, m.created_epoch desc ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by v.voicemail_id, m.$this->order_by $this->order ";
|
||||
}
|
||||
//$sql .= "limit $this->rows_per_page offset $this->offset ";
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//update the array with additional information
|
||||
if (is_array($result)) {
|
||||
foreach($result as &$row) {
|
||||
//set the greeting directory
|
||||
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
|
||||
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.wav')) {
|
||||
$row['file_path'] = $path.'/msg_'.$row['voicemail_message_uuid'].'.wav';
|
||||
}
|
||||
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.mp3')) {
|
||||
$row['file_path'] = $path.'/msg_'.$row['voicemail_message_uuid'].'.mp3';
|
||||
}
|
||||
$row['file_size'] = filesize($row['file_path']);
|
||||
$row['file_size_label'] = byte_convert($row['file_size']);
|
||||
$row['file_ext'] = substr($row['file_path'], -3);
|
||||
|
||||
$message_length = $row['message_length'];
|
||||
if ($message_length < 60 ) {
|
||||
$message_length = $message_length. " sec";
|
||||
}
|
||||
else {
|
||||
$message_length = round(($message_length/60), 2). " min";
|
||||
}
|
||||
$row['message_length_label'] = $message_length;
|
||||
$row['created_date'] = date("j M Y g:i a",$row['created_epoch']);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function voicemail_delete() {
|
||||
|
||||
//get the voicemail id
|
||||
$this->get_voicemail_id();
|
||||
|
||||
//check if for valid input
|
||||
if (is_uuid($this->voicemail_uuid)
|
||||
&& is_uuid($this->domain_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//delete voicemail messages
|
||||
$this->message_delete();
|
||||
|
||||
//delete voicemail recordings folder (includes greetings)
|
||||
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
||||
foreach (glob($file_path."/*.*") as $file_name) {
|
||||
unlink($file_name);
|
||||
if (is_numeric($this->voicemail_id)) {
|
||||
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
||||
foreach (glob($file_path."/*.*") as $file_name) {
|
||||
unlink($file_name);
|
||||
}
|
||||
@rmdir($file_path);
|
||||
}
|
||||
@rmdir($file_path);
|
||||
|
||||
//delete voicemail destinations
|
||||
$sql = "delete from v_voicemail_destinations ";
|
||||
@@ -241,12 +288,14 @@
|
||||
unset($sql, $prep_statement);
|
||||
|
||||
//delete voicemail greetings
|
||||
$sql = "delete from v_voicemail_greetings ";
|
||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||
$sql .= "and voicemail_id = '".$this->voicemail_id."' ";
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql, $prep_statement);
|
||||
if (is_numeric($this->voicemail_id)) {
|
||||
$sql = "delete from v_voicemail_greetings ";
|
||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||
$sql .= "and voicemail_id = '".$this->voicemail_id."' ";
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql, $prep_statement);
|
||||
}
|
||||
|
||||
//delete voicemail options
|
||||
$sql = "delete from v_voicemail_options ";
|
||||
@@ -267,21 +316,32 @@
|
||||
|
||||
public function message_count() {
|
||||
|
||||
$sql = "select count(*) as num_rows from v_voicemail_messages ";
|
||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
|
||||
$prep_statement = $this->db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$num_rows = $row['num_rows'];
|
||||
//check if for valid input
|
||||
if (is_uuid($this->voicemail_uuid) && is_uuid($this->domain_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
$num_rows = '0';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $num_rows;
|
||||
|
||||
//get the message count
|
||||
$sql = "select count(*) as num_rows from v_voicemail_messages ";
|
||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
|
||||
$prep_statement = $this->db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$num_rows = $row['num_rows'];
|
||||
}
|
||||
else {
|
||||
$num_rows = '0';
|
||||
}
|
||||
}
|
||||
|
||||
//return the message count
|
||||
return $num_rows;
|
||||
}
|
||||
|
||||
public function message_waiting() {
|
||||
@@ -294,6 +354,20 @@
|
||||
}
|
||||
|
||||
public function message_delete() {
|
||||
|
||||
//get the voicemail id
|
||||
$this->get_voicemail_id();
|
||||
|
||||
//check if for valid input
|
||||
if (is_numeric($this->voicemail_id)
|
||||
&& is_uuid($this->voicemail_uuid)
|
||||
&& is_uuid($this->domain_uuid)
|
||||
&& is_uuid($this->voicemail_message_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//delete the recording
|
||||
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
||||
@@ -328,6 +402,16 @@
|
||||
|
||||
public function message_toggle() {
|
||||
|
||||
//check if for valid input
|
||||
if (is_uuid($this->voicemail_uuid)
|
||||
&& is_uuid($this->domain_uuid)
|
||||
&& is_uuid($this->voicemail_message_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//get message status
|
||||
$sql = "select message_status from v_voicemail_messages ";
|
||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||
@@ -356,6 +440,16 @@
|
||||
|
||||
public function message_saved() {
|
||||
|
||||
//check if for valid input
|
||||
if (is_uuid($this->voicemail_uuid)
|
||||
&& is_uuid($this->domain_uuid)
|
||||
&& is_uuid($this->voicemail_message_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//set the voicemail status to saved
|
||||
$sql = "update v_voicemail_messages set ";
|
||||
$sql .= "message_status = 'saved' ";
|
||||
@@ -372,6 +466,17 @@
|
||||
|
||||
public function message_download() {
|
||||
|
||||
//check if for valid input
|
||||
if (is_numeric($this->voicemail_id)
|
||||
&& is_uuid($this->voicemail_uuid)
|
||||
&& is_uuid($this->domain_uuid)
|
||||
&& is_uuid($this->voicemail_message_uuid)) {
|
||||
//input is valid
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//change the message status
|
||||
$this->message_saved();
|
||||
|
||||
@@ -395,8 +500,8 @@
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
if (count($result) > 0) {
|
||||
if (is_array($result)) foreach($result as &$row) {
|
||||
if (is_array($result)) {
|
||||
foreach($result as &$row) {
|
||||
if ($row['message_base64'] != '') {
|
||||
$message_decoded = base64_decode($row['message_base64']);
|
||||
file_put_contents($path.'/msg_'.$this->voicemail_message_uuid.'.ext', $message_decoded);
|
||||
|
||||
@@ -23,18 +23,22 @@
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]) == "email")) {
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('voicemail_message_view')) {
|
||||
//access granted
|
||||
|
||||
//check permissions
|
||||
if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]) == "email")) {
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('voicemail_message_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -137,6 +141,9 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
|
||||
if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') {
|
||||
echo "<th style='text-align: right;'>".$text['label-message_size']."</th>\n";
|
||||
}
|
||||
if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') {
|
||||
echo "<th>".$text['label-transcription']."</th>\n";
|
||||
}
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo "<td class='list_control_icons' style='width: 25px;'>";
|
||||
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { $('#frm').attr('action', 'voicemail_message_delete.php').submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
|
||||
@@ -177,10 +184,14 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
|
||||
echo "<a id='recording_button_".$row['voicemail_message_uuid']."' onclick=\"recording_play('".$row['voicemail_message_uuid']."');\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</a>";
|
||||
echo "<a href=\"voicemail_messages.php?action=download&t=bin&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['message_length_label']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\" nowrap='nowrap'>".$row['message_length_label']." </td>\n";
|
||||
if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') {
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\" nowrap='nowrap'>".$row['file_size_label']."</td>\n";
|
||||
}
|
||||
if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') {
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['message_transcription']."</td>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo " <td class='list_control_icon' style='width: 25px;'>";
|
||||
echo "<a href='voicemail_message_delete.php?voicemail_messages[".$row['voicemail_uuid']."][]=".$row['voicemail_message_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
|
||||
@@ -246,4 +257,5 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
?>
|
||||
|
||||
?>
|
||||
|
||||
@@ -23,24 +23,34 @@
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('voicemail_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('voicemail_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//retrieve order by
|
||||
//set the variables
|
||||
$order_by = check_str($_GET["order_by"]);
|
||||
$order = check_str($_GET["order"]);
|
||||
$search = check_str($_GET["search"]);
|
||||
|
||||
//sterilize the user data
|
||||
$order_by = preg_replace('/\s+/', '', $order_by);
|
||||
if (!(strtolower($order) == "asc" or strtolower($order) == "desc")) { $order = ''; }
|
||||
if (strlen($search) > 15) { $search = substr($search, 0, 15); }
|
||||
|
||||
//set the voicemail id and voicemail uuid arrays
|
||||
if (isset($_SESSION['user']['extension'])) foreach ($_SESSION['user']['extension'] as $index => $row) {
|
||||
@@ -62,15 +72,15 @@ else {
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) as num_rows from v_voicemails ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql = "SELECT count(*) AS num_rows FROM v_voicemails ";
|
||||
$sql .= "WHERE domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($search) > 0) {
|
||||
$sql .= "and (";
|
||||
$sql .= " voicemail_id like '%".$search."%' ";
|
||||
$sql .= " or voicemail_mail_to like '%".$search."%' ";
|
||||
$sql .= " or voicemail_local_after_email like '%".$search."%' ";
|
||||
$sql .= " or voicemail_enabled like '%".$search."%' ";
|
||||
$sql .= " or voicemail_description like '%".$search."%' ";
|
||||
$sql .= " CAST(voicemail_id AS TEXT) LIKE '%".$search."%' ";
|
||||
$sql .= " OR voicemail_mail_to LIKE '%".$search."%' ";
|
||||
$sql .= " OR voicemail_local_after_email LIKE '%".$search."%' ";
|
||||
$sql .= " OR voicemail_enabled LIKE '%".$search."%' ";
|
||||
$sql .= " OR voicemail_description LIKE '%".$search."%' ";
|
||||
$sql .= ") ";
|
||||
}
|
||||
if (!permission_exists('voicemail_delete')) {
|
||||
@@ -82,14 +92,14 @@ else {
|
||||
$sql .= "voicemail_uuid = '".$row['voicemail_uuid']."' ";
|
||||
}
|
||||
else {
|
||||
$sql .= " or voicemail_uuid = '".$row['voicemail_uuid']."'";
|
||||
$sql .= " OR voicemail_uuid = '".$row['voicemail_uuid']."'";
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
else {
|
||||
$sql .= "and voicemail_uuid is null ";
|
||||
$sql .= "AND voicemail_uuid IS NULL ";
|
||||
}
|
||||
}
|
||||
$prep_statement = $db->prepare($sql);
|
||||
@@ -114,14 +124,14 @@ else {
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = str_replace('count(*) as num_rows', '*', $sql);
|
||||
$sql = str_replace('count(*) AS num_rows', '*', $sql);
|
||||
if (strlen($order_by) > 0) {
|
||||
$sql .= ($order_by == 'voicemail_id') ? "order by voicemail_id ".$order." " : "order by ".$order_by." ".$order." ";
|
||||
$sql .= ($order_by == 'voicemail_id') ? "ORDER BY voicemail_id ".$order." " : "ORDER BY ".$order_by." ".$order." ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by voicemail_id asc ";
|
||||
$sql .= "ORDER BY voicemail_id ASC ";
|
||||
}
|
||||
$sql .= "limit ".$rows_per_page." offset ".$offset." ";
|
||||
$sql .= "LIMIT ".$rows_per_page." OFFSET ".$offset." ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$voicemails = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
@@ -266,4 +276,4 @@ else {
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -61,6 +61,40 @@
|
||||
$apps[$x]['permissions'][$y]['name'] = "xml_cdr_all";
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'dbbadd02-f95d-480b-85d5-2a4113d4cccc';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'cdr';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'format';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'json';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '23335ac0-9466-4d16-af3f-81aa347159b1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'cdr';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'storage';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'db';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'cdb19dda-234b-407a-9eda-e8af74597d4b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'cdr';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'limit';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '800';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'cea53099-96c0-405f-ada6-219d0b398944';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'cdr';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'http_enabled';
|
||||
$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'] = '';
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
@@ -326,4 +360,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Save who hung up or cancelled the leg.";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -39,61 +39,6 @@
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//add CDR settings to default settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'cdr';
|
||||
$array[$x]['default_setting_subcategory'] = 'format';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'json';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'cdr';
|
||||
$array[$x]['default_setting_subcategory'] = 'storage';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'db';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'cdr';
|
||||
$array[$x]['default_setting_subcategory'] = 'limit';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '800';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'cdr';
|
||||
$array[$x]['default_setting_subcategory'] = 'http_enabled';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "where default_setting_category = 'cdr' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
|
||||
$x = 0;
|
||||
if (isset($array)) foreach ($array as $row) {
|
||||
$found = false;
|
||||
foreach ($default_settings as $field) {
|
||||
if ($row['default_setting_subcategory'] == $field['default_setting_subcategory']) {
|
||||
$found = true;
|
||||
$break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
$orm->save($array[$x]);
|
||||
$message = $orm->message;
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -142,6 +142,11 @@ if (!class_exists('xml_cdr')) {
|
||||
$this->fields[] = "hangup_cause";
|
||||
$this->fields[] = "hangup_cause_q850";
|
||||
$this->fields[] = "sip_hangup_disposition";
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$this->fields[] = $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,10 +335,35 @@ if (!class_exists('xml_cdr')) {
|
||||
$domain_name = check_str(urldecode($xml->variables->domain_name));
|
||||
$domain_uuid = check_str(urldecode($xml->variables->domain_uuid));
|
||||
|
||||
//get the domain name from sip_req_host
|
||||
//get the domain name
|
||||
if (strlen($domain_name) == 0) {
|
||||
$domain_name = check_str(urldecode($xml->variables->sip_req_host));
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
$presence_id = check_str(urldecode($xml->variables->presence_id));
|
||||
if (strlen($presence_id) > 0) {
|
||||
$presence_array = explode($presence_id);
|
||||
$domain_name = $presence_array[1];
|
||||
}
|
||||
}
|
||||
|
||||
//dynamic cdr fields
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$fields = explode(",", $field);
|
||||
$field_name = end($fields);
|
||||
$this->fields[] = $field_name;
|
||||
if (count($fields) == 1) {
|
||||
$this->array[$key][$field_name] = urldecode($xml->variables->$fields[0]);
|
||||
}
|
||||
if (count($fields) == 2) {
|
||||
$this->array[$key][$field_name] = urldecode($xml->$fields[0]->$fields[1]);
|
||||
}
|
||||
if (count($fields) == 3) {
|
||||
$this->array[$key][$field_name] = urldecode($xml->$fields[0]->$fields[1]->$fields[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//send the domain name to the cdr log
|
||||
//$this->log("\ndomain_name is `$domain_name`; domain_uuid is '$domain_uuid'\n");
|
||||
@@ -620,19 +650,19 @@ if (!class_exists('xml_cdr')) {
|
||||
$sql_date_range .= " and start_stamp between '".$this->start_stamp_begin.":00.000' and '".$this->start_stamp_end.":59.999' \n";
|
||||
}
|
||||
else {
|
||||
if (strlen($this->start_stamp_begin) > 0) { $sql_date_range .= "and start_stamp >= '".$this->start_stamp_begin.":00.000' \n"; }
|
||||
if (strlen($this->start_stamp_end) > 0) { $sql_date_range .= "and start_stamp <= '".$this->start_stamp_end.":59.999' \n"; }
|
||||
if (strlen($this->start_stamp_begin) > 0) { $sql_date_range .= "AND start_stamp >= '".$this->start_stamp_begin.":00.000' \n"; }
|
||||
if (strlen($this->start_stamp_end) > 0) { $sql_date_range .= "AND start_stamp <= '".$this->start_stamp_end.":59.999' \n"; }
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch ($this->quick_select) {
|
||||
case 1: $sql_date_range .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 week"))."' \n"; break; //last 7 days
|
||||
case 2: $sql_date_range .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 hour"))."' \n"; break; //last hour
|
||||
case 3: $sql_date_range .= "and start_stamp >= '".date('Y-m-d')." "."00:00:00.000' \n"; break; //today
|
||||
case 4: $sql_date_range .= "and start_stamp between '".date('Y-m-d',strtotime("-1 day"))." "."00:00:00.000' and '".date('Y-m-d',strtotime("-1 day"))." "."23:59:59.999' \n"; break; //yesterday
|
||||
case 5: $sql_date_range .= "and start_stamp >= '".date('Y-m-d',strtotime("this week"))." "."00:00:00.000' \n"; break; //this week
|
||||
case 6: $sql_date_range .= "and start_stamp >= '".date('Y-m-')."01 "."00:00:00.000' \n"; break; //this month
|
||||
case 7: $sql_date_range .= "and start_stamp >= '".date('Y-')."01-01 "."00:00:00.000' \n"; break; //this year
|
||||
case 1: $sql_date_range .= "AND start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 week"))."' \n"; break; //last 7 days
|
||||
case 2: $sql_date_range .= "AND start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 hour"))."' \n"; break; //last hour
|
||||
case 3: $sql_date_range .= "AND start_stamp >= '".date('Y-m-d')." "."00:00:00.000' \n"; break; //today
|
||||
case 4: $sql_date_range .= "AND start_stamp between '".date('Y-m-d',strtotime("-1 day"))." "."00:00:00.000' and '".date('Y-m-d',strtotime("-1 day"))." "."23:59:59.999' \n"; break; //yesterday
|
||||
case 5: $sql_date_range .= "AND start_stamp >= '".date('Y-m-d',strtotime("this week"))." "."00:00:00.000' \n"; break; //this week
|
||||
case 6: $sql_date_range .= "AND start_stamp >= '".date('Y-m-')."01 "."00:00:00.000' \n"; break; //this month
|
||||
case 7: $sql_date_range .= "AND start_stamp >= '".date('Y-')."01-01 "."00:00:00.000' \n"; break; //this year
|
||||
}
|
||||
}
|
||||
|
||||
@@ -643,156 +673,228 @@ if (!class_exists('xml_cdr')) {
|
||||
$sql .= "e.extension, \n";
|
||||
$sql .= "e.number_alias, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "and (answer_stamp is not null and bridge_uuid is not null) \n";
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER( \n";
|
||||
$sql .= " WHERE c.domain_uuid = e.domain_uuid \n";
|
||||
$sql .= " AND ((\n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL and ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
$sql .= " AND (\n";
|
||||
$sql .= " c.answer_stamp IS NOT NULL \n";
|
||||
$sql .= " and \n";
|
||||
$sql .= " c.bridge_uuid IS NOT NULL) \n";
|
||||
|
||||
if ($this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||
$sql .= " AND (direction = 'inbound' OR direction = 'local')) \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and direction = 'inbound' \n";
|
||||
$sql .= "AND direction = 'inbound') \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as answered, \n";
|
||||
$sql .= "AS answered, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "and (answer_stamp is not null and bridge_uuid is null) \n";
|
||||
$sql .= "and direction = 'inbound' \n";
|
||||
if (!$this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'outbound') \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as missed, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "and hangup_cause = 'NO_ANSWER' \n";
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR (\n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.answer_stamp IS NULL \n";
|
||||
$sql .= " AND \n";
|
||||
$sql .= " c.bridge_uuid IS NULL) \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||
$sql .= " AND (direction = 'inbound' OR direction = 'outbound'))";
|
||||
} else {
|
||||
$sql .= " AND direction = 'inbound')";
|
||||
}
|
||||
$sql .= "AS missed, \n";
|
||||
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
$sql .= " AND c.hangup_cause = 'NO_ANSWER' \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " AND (direction = 'inbound' OR direction = 'local') \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "AND direction = 'inbound' \n";
|
||||
}
|
||||
$sql .= ") AS no_answer, \n";
|
||||
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
$sql .= " AND \n";
|
||||
$sql .= " c.hangup_cause = 'USER_BUSY' \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " AND (direction = 'inbound' OR direction = 'local')) \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and direction = 'inbound' \n";
|
||||
$sql .= " AND direction = 'inbound') \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as no_answer, \n";
|
||||
$sql .= "AS busy, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "and hangup_cause = 'USER_BUSY' \n";
|
||||
$sql .= "SUM(c.billsec) \n";
|
||||
$sql .= "FILTER ( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||
$sql .= " AND (direction = 'inbound' OR 'direction = 'outbound') \n";
|
||||
}
|
||||
$sql .= " ) / \n";
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER ( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " AND (direction = 'inbound' OR 'direction = 'outbound') \n";
|
||||
}
|
||||
$sql .= " ) AS aloc, \n";
|
||||
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER ( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " AND (direction = 'inbound' OR direction = 'local')) \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and direction = 'inbound' \n";
|
||||
$sql .= " AND direction = 'inbound') \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as busy, \n";
|
||||
$sql .= "AS inbound_calls, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select SUM(billsec) / count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
if (!$this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'outbound') \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as aloc, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "SUM(c.billsec) \n";
|
||||
$sql .= "FILTER ( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||
$sql .= " AND (direction = 'inbound' OR direction = 'local')) \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and direction = 'inbound' \n";
|
||||
$sql .= " AND direction = 'inbound') \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as inbound_calls, \n";
|
||||
$sql .= "AS inbound_duration, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select SUM(billsec) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
if ($this->include_internal) {
|
||||
$sql .= " and (direction = 'inbound' or direction = 'local') \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and direction = 'inbound' \n";
|
||||
}
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as inbound_duration, \n";
|
||||
$sql .= "COUNT(*) \n";
|
||||
$sql .= "FILTER ( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
$sql .= " AND \n";
|
||||
$sql .= " c.direction = 'outbound') \n";
|
||||
$sql .= "AS outbound_calls, \n";
|
||||
|
||||
$sql .= "(\n";
|
||||
$sql .= "select count(*) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "and direction = 'outbound' \n";
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as outbound_calls, \n";
|
||||
|
||||
$sql .= "(";
|
||||
$sql .= "select SUM(billsec) from v_xml_cdr \n";
|
||||
$sql .= "where domain_uuid = e.domain_uuid\n";
|
||||
$sql .= "and (\n";
|
||||
$sql .= " (caller_id_number = e.extension or destination_number = e.extension)\n";
|
||||
$sql .= " or \n";
|
||||
$sql .= " (e.number_alias is not null and (caller_id_number = e.number_alias or destination_number = e.number_alias))\n";
|
||||
$sql .= ")\n";
|
||||
$sql .= "and direction = 'outbound' \n";
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") as outbound_duration, \n";
|
||||
$sql .= "SUM(c.billsec) \n";
|
||||
$sql .= "FILTER ( \n";
|
||||
$sql .= " WHERE (( \n";
|
||||
$sql .= " c.caller_id_number = e.extension \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.extension) \n";
|
||||
$sql .= " OR ( \n";
|
||||
$sql .= " e.number_alias IS NOT NULL \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.caller_id_number = e.number_alias \n";
|
||||
$sql .= " OR \n";
|
||||
$sql .= " c.destination_number = e.number_alias))) \n";
|
||||
$sql .= " AND ( \n";
|
||||
$sql .= " c.direction = 'outbound')) \n";
|
||||
$sql .= "AS outbound_duration, \n";
|
||||
|
||||
$sql .= "e.description \n";
|
||||
$sql .= "FROM v_extensions as e, v_domains as d \n";
|
||||
$sql .= "WHERE d.domain_uuid = e.domain_uuid \n";
|
||||
|
||||
$sql .= "FROM v_extensions AS e, v_domains AS d, \n";
|
||||
$sql .= "( SELECT \n";
|
||||
$sql .= " domain_uuid, \n";
|
||||
$sql .= " caller_id_number, \n";
|
||||
$sql .= " destination_number, \n";
|
||||
$sql .= " answer_stamp, \n";
|
||||
$sql .= " bridge_uuid, \n";
|
||||
$sql .= " direction, \n";
|
||||
$sql .= " start_stamp, \n";
|
||||
$sql .= " hangup_cause, \n";
|
||||
$sql .= " billsec \n";
|
||||
$sql .= " FROM v_xml_cdr \n";
|
||||
$sql .= " WHERE domain_uuid = '".$this->domain_uuid."' \n";
|
||||
$sql .= $sql_date_range;
|
||||
$sql .= ") AS c \n";
|
||||
|
||||
$sql .= "WHERE \n";
|
||||
$sql .= "d.domain_uuid = e.domain_uuid \n";
|
||||
if (!($_GET['showall'] && permission_exists('xml_cdr_all'))) {
|
||||
$sql .= "AND e.domain_uuid = '".$this->domain_uuid."' \n";
|
||||
$sql .= "AND e.domain_uuid = '".$this->domain_uuid."' \n";
|
||||
}
|
||||
$sql .= "ORDER BY extension ASC\n";
|
||||
//echo $sql;
|
||||
$sql .= "GROUP BY e.extension, e.domain_uuid, d.domain_uuid, e.number_alias, e.description \n";
|
||||
$sql .= "ORDER BY extension ASC \n";
|
||||
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$summary = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
|
||||
@@ -239,6 +239,23 @@
|
||||
$database->fields['recording_file'] = $recording_file;
|
||||
}
|
||||
|
||||
//dynamic cdr fields
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$fields = explode(",", $field);
|
||||
$field_name = end($fields);
|
||||
if (count($fields) == 1) {
|
||||
$database->fields[$field_name] = urldecode($xml->variables->$fields[0]);
|
||||
}
|
||||
if (count($fields) == 2) {
|
||||
$database->fields[$field_name] = urldecode($xml->$fields[0]->$fields[1]);
|
||||
}
|
||||
if (count($fields) == 3) {
|
||||
$database->fields[$field_name] = urldecode($xml->$fields[0]->$fields[1]->$fields[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//save to the database in xml format
|
||||
if ($_SESSION['cdr']['format']['text'] == "xml" && $_SESSION['cdr']['storage']['text'] == "db") {
|
||||
$database->fields['xml'] = check_str($xml_string);
|
||||
|
||||
+36
-4
@@ -109,11 +109,20 @@
|
||||
echo " <input type='hidden' name='remote_media_ip' value='".$remote_media_ip."'>\n";
|
||||
echo " <input type='hidden' name='network_addr' value='".$network_addr."'>\n";
|
||||
echo " <input type='hidden' name='bridge_uuid' value='".$bridge_uuid."'>\n";
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = $array[count($array) - 1];
|
||||
if (isset($_REQUEST[$field_name])) {
|
||||
echo " <input type='hidden' name='$field_name' value='".$$field_name."'>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($order_by)) {
|
||||
echo " <input type='hidden' name='order_by' value='".$order_by."'>\n";
|
||||
echo " <input type='hidden' name='order' value='".$order."'>\n";
|
||||
}
|
||||
if (permission_exists('xml_cdr_all' && $_REQUEST['showall'] == 'true')) {
|
||||
if (permission_exists('xml_cdr_all') && $_REQUEST['showall'] == 'true') {
|
||||
echo " <input type='hidden' name='showall' value='true'>\n";
|
||||
}
|
||||
echo " <table cellpadding='0' cellspacing='0' border='0'>\n";
|
||||
@@ -143,7 +152,7 @@
|
||||
echo " <option value='pdf'>PDF</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
if ($paging_controls_mini != '') {
|
||||
if ($result_count == $rows_per_page && $paging_controls_mini != '') {
|
||||
echo " <td style='vertical-align: top; padding-left: 15px;'>".$paging_controls_mini."</td>\n";
|
||||
}
|
||||
echo " </tr>\n";
|
||||
@@ -361,6 +370,17 @@
|
||||
echo "<th>".$text['label-recording']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = $array[count($array) - 1];
|
||||
$field_label = ucwords(str_replace("_", " ", $field_name));
|
||||
$field_label = str_replace("Sip", "SIP", $field_label);
|
||||
if ($field_name != "destination_number") {
|
||||
echo th_order_by($field_name, $field_label, $order_by, $order, null, "style='text-align: right;'", $param);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: center;'", $param);
|
||||
echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'", $param);
|
||||
echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'", $param);
|
||||
@@ -545,6 +565,16 @@
|
||||
echo " <td valign='top' align='center' class='".$row_style[$c]."'> </td>\n";
|
||||
}
|
||||
}
|
||||
//dynamic cdr fields
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = $array[count($array) - 1];
|
||||
if ($field_name != "destination_number") {
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".$row[$field_name] ."</td>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
//start
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".$tmp_start_epoch."</td>\n";
|
||||
//tta (time to answer)
|
||||
@@ -648,7 +678,9 @@
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
echo "<br><br>";
|
||||
echo $paging_controls;
|
||||
if ($result_count == $rows_per_page) {
|
||||
echo $paging_controls;
|
||||
}
|
||||
echo "<br><br>";
|
||||
|
||||
// check or uncheck all checkboxes
|
||||
@@ -668,4 +700,4 @@
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,23 +17,26 @@
|
||||
|
||||
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
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
if (permission_exists('xml_cdr_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//ehceck permissions
|
||||
if (permission_exists('xml_cdr_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -194,10 +197,10 @@ else {
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$context."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
||||
//echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
||||
//echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
||||
//echo " </a>";
|
||||
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/v_recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
||||
//$tmp_file_array = explode("\.",$file);
|
||||
echo $caller_id_name.' ';
|
||||
echo " </a>";
|
||||
@@ -208,7 +211,7 @@ else {
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
||||
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
||||
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
||||
echo $caller_id_number.' ';
|
||||
echo " </a>";
|
||||
}
|
||||
@@ -291,12 +294,12 @@ else {
|
||||
$tmp_name = $value."_1.mp3";
|
||||
}
|
||||
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/v_recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
|
||||
echo " play";
|
||||
echo " </a> ";
|
||||
}
|
||||
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
|
||||
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
|
||||
echo " download";
|
||||
echo " </a>";
|
||||
}
|
||||
@@ -515,4 +518,4 @@ else {
|
||||
|
||||
//get the footer
|
||||
require_once "resources/footer.php";
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -75,6 +75,15 @@
|
||||
$bridge_uuid = check_str($_REQUEST["network_addr"]);
|
||||
$order_by = check_str($_REQUEST["order_by"]);
|
||||
$order = check_str($_REQUEST["order"]);
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
if (isset($_REQUEST[$field_name])) {
|
||||
$$field_name = check_str($_REQUEST[$field_name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strlen(check_str($_REQUEST["mos_comparison"])) > 0) {
|
||||
switch(check_str($_REQUEST["mos_comparison"])) {
|
||||
case 'less': $mos_comparison = "<"; break;
|
||||
@@ -115,6 +124,18 @@
|
||||
$sql_where_ands[] = "destination_number like '".$mod_destination_number."'";
|
||||
}
|
||||
if (strlen($context) > 0) { $sql_where_ands[] = "context like '%".$context."%'"; }
|
||||
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
if (isset($$field_name)) {
|
||||
$$field_name = check_str($_REQUEST[$field_name]);
|
||||
$sql_where_ands[] = "$field_name like '%".$$field_name."%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) { $sql_where_ands[] = "start_stamp BETWEEN '".$start_stamp_begin.":00.000' AND '".$start_stamp_end.":59.999'"; }
|
||||
else {
|
||||
if (strlen($start_stamp_begin) > 0) { $sql_where_ands[] = "start_stamp >= '".$start_stamp_begin.":00.000'"; }
|
||||
@@ -256,6 +277,15 @@
|
||||
$param .= "&bridge_uuid=".$bridge_uuid;
|
||||
$param .= "&mos_comparison=".$mos_comparison;
|
||||
$param .= "&mos_score=".$mos_score;
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
if (isset($$field_name)) {
|
||||
$param .= "&".$field_name."=".$$field_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_GET['showall'] == 'true' && permission_exists('xml_cdr_all')) {
|
||||
$param .= "&showall=true";
|
||||
}
|
||||
@@ -283,7 +313,7 @@
|
||||
if ($rows_per_page > 0) {
|
||||
if ($_SESSION['cdr']['count']['boolean'] == "true") {
|
||||
//get the number of rows in the v_xml_cdr
|
||||
$sql = "select count(*) as num_rows from v_xml_cdr ";
|
||||
$sql = "select count(uuid) as num_rows from v_xml_cdr ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ".$sql_where;
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
@@ -343,7 +373,9 @@
|
||||
$sql .= "(xml IS NOT NULL OR json IS NOT NULL) AS raw_data_exists, ";
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$sql .= $field.", ";
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
$sql .= $field_name.", ";
|
||||
}
|
||||
}
|
||||
$sql .= "accountcode, ";
|
||||
|
||||
+245
-226
@@ -23,245 +23,264 @@
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('xml_cdr_search_advanced')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//include
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('xml_cdr_search_advanced')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//send the header
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/header.php";
|
||||
|
||||
//javascript to toggle input/select boxes
|
||||
echo "<script type='text/javascript'>";
|
||||
echo " function toggle(field) {";
|
||||
echo " if (field == 'source') {";
|
||||
echo " document.getElementById('caller_extension_uuid').selectedIndex = 0;";
|
||||
echo " document.getElementById('caller_id_number').value = '';";
|
||||
echo " $('#caller_extension_uuid').toggle();";
|
||||
echo " $('#caller_id_number').toggle();";
|
||||
echo " if ($('#caller_id_number').is(':visible')) { $('#caller_id_number').focus(); } else { $('#caller_extension_uuid').focus(); }";
|
||||
echo " }";
|
||||
echo " }";
|
||||
echo "</script>";
|
||||
echo "<script type='text/javascript'>";
|
||||
echo " function toggle(field) {";
|
||||
echo " if (field == 'source') {";
|
||||
echo " document.getElementById('caller_extension_uuid').selectedIndex = 0;";
|
||||
echo " document.getElementById('caller_id_number').value = '';";
|
||||
echo " $('#caller_extension_uuid').toggle();";
|
||||
echo " $('#caller_id_number').toggle();";
|
||||
echo " if ($('#caller_id_number').is(':visible')) { $('#caller_id_number').focus(); } else { $('#caller_extension_uuid').focus(); }";
|
||||
echo " }";
|
||||
echo " }";
|
||||
echo "</script>";
|
||||
|
||||
//start the html form
|
||||
if (strlen(check_str($_GET['redirect'])) > 0) {
|
||||
echo "<form method='get' action='" . $_GET['redirect'] . ".php'>\n";
|
||||
} else {
|
||||
echo "<form method='get' action='xml_cdr.php'>\n";
|
||||
}
|
||||
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' nowrap='nowrap' valign='top'><b>Advanced Search</b></td>\n";
|
||||
echo " <td width='70%' align='right' valign='top'>";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='xml_cdr.php'\" value='Back'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='Search'>";
|
||||
echo " <br /><br />";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' style='vertical-align: top;'>\n";
|
||||
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' class='vncell' valign='top' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-direction']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <select name='direction' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($direction == "inbound") {
|
||||
echo " <option value='inbound' selected='selected'>".$text['label-inbound']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='inbound'>".$text['label-inbound']."</option>\n";
|
||||
}
|
||||
if ($direction == "outbound") {
|
||||
echo " <option value='outbound' selected='selected'>".$text['label-outbound']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='outbound'>".$text['label-outbound']."</option>\n";
|
||||
}
|
||||
if ($direction == "local") {
|
||||
echo " <option value='local' selected='selected'>".$text['label-local']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='local'>".$text['label-local']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-caller_id_name']."</td>"; //source name
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='caller_id_name' value='$caller_id_name'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-caller_id_number']."</td>"; //source number
|
||||
echo " <td class='vtable'>";
|
||||
echo " <select class='formfld' name='caller_extension_uuid' id='caller_extension_uuid'>\n";
|
||||
echo " <option value=''></option>";
|
||||
$sql = "select extension_uuid, extension, number_alias from v_extensions ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "order by ";
|
||||
$sql .= "extension asc ";
|
||||
$sql .= ", number_alias asc ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement -> execute();
|
||||
$result_e = $prep_statement -> fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result_e as &$row) {
|
||||
$selected = ($row['extension_uuid'] == $caller_extension_uuid) ? "selected" : null;
|
||||
echo " <option value='".$row['extension_uuid']."' ".$selected.">".((is_numeric($row['extension'])) ? $row['extension'] : $row['number_alias']." (".$row['extension'].")")."</option>";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo " </select>\n";
|
||||
echo " <input type='text' class='formfld' style='display: none;' name='caller_id_number' id='caller_id_number' value='".$caller_id_number."'>\n";
|
||||
echo " <input type='button' id='btn_toggle_source' class='btn' name='' alt='".$text['button-back']."' value='◁' onclick=\"toggle('source');\">\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-destination']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='destination_number' value='$destination_number'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-context']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='context' value='$context'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-start_range']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <div class='row'>\n";
|
||||
echo " <div class='col-sm-12'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='start_stamp_begin' placeholder='".$text['label-from']."' value='$start_stamp_begin'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='start_stamp_end' placeholder='".$text['label-to']."' value='$start_stamp_end'>";
|
||||
echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-answer_range']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <div class='row'>\n";
|
||||
echo " <div class='col-sm-12'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='answer_stamp_begin' placeholder='".$text['label-from']."' value='$answer_stamp_begin'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='answer_stamp_end' placeholder='".$text['label-to']."' value='$answer_stamp_end'>";
|
||||
echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-end_range']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <div class='row'>\n";
|
||||
echo " <div class='col-sm-12'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='end_stamp_begin' placeholder='".$text['label-from']."' value='$end_stamp_begin'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='end_stamp_end' placeholder='".$text['label-to']."' value='$end_stamp_end'>";
|
||||
echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-duration']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='duration' value='$duration'></td>";
|
||||
echo " </tr>";
|
||||
if (permission_exists('xml_cdr_all')) {
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['button-show_all']."</td>";
|
||||
echo " <td class='vtable'>\n";
|
||||
if (permission_exists('xml_cdr_all') && $_REQUEST['showall'] == "true") {
|
||||
echo " <input type='checkbox' class='formfld' name='showall' checked='checked' value='true'>";
|
||||
if (strlen(check_str($_GET['redirect'])) > 0) {
|
||||
echo "<form method='get' action='" . $_GET['redirect'] . ".php'>\n";
|
||||
} else {
|
||||
echo "<form method='get' action='xml_cdr.php'>\n";
|
||||
}
|
||||
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' nowrap='nowrap' valign='top'><b>Advanced Search</b></td>\n";
|
||||
echo " <td width='70%' align='right' valign='top'>";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='xml_cdr.php'\" value='Back'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='Search'>";
|
||||
echo " <br /><br />";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' style='vertical-align: top;'>\n";
|
||||
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' class='vncell' valign='top' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-direction']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <select name='direction' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($direction == "inbound") {
|
||||
echo " <option value='inbound' selected='selected'>".$text['label-inbound']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <input type='checkbox' class='formfld' name='showall' value='true'>";
|
||||
echo " <option value='inbound'>".$text['label-inbound']."</option>\n";
|
||||
}
|
||||
echo " <td>";
|
||||
if ($direction == "outbound") {
|
||||
echo " <option value='outbound' selected='selected'>".$text['label-outbound']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='outbound'>".$text['label-outbound']."</option>\n";
|
||||
}
|
||||
if ($direction == "local") {
|
||||
echo " <option value='local' selected='selected'>".$text['label-local']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='local'>".$text['label-local']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-caller_id_name']."</td>"; //source name
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='caller_id_name' value='$caller_id_name'></td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-caller_id_number']."</td>"; //source number
|
||||
echo " <td class='vtable'>";
|
||||
echo " <select class='formfld' name='caller_extension_uuid' id='caller_extension_uuid'>\n";
|
||||
echo " <option value=''></option>";
|
||||
$sql = "select extension_uuid, extension, number_alias from v_extensions ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "order by ";
|
||||
$sql .= "extension asc ";
|
||||
$sql .= ", number_alias asc ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement -> execute();
|
||||
$result_e = $prep_statement -> fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result_e as &$row) {
|
||||
$selected = ($row['extension_uuid'] == $caller_extension_uuid) ? "selected" : null;
|
||||
echo " <option value='".$row['extension_uuid']."' ".$selected.">".((is_numeric($row['extension'])) ? $row['extension'] : $row['number_alias']." (".$row['extension'].")")."</option>";
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo " </select>\n";
|
||||
echo " <input type='text' class='formfld' style='display: none;' name='caller_id_number' id='caller_id_number' value='".$caller_id_number."'>\n";
|
||||
echo " <input type='button' id='btn_toggle_source' class='btn' name='' alt='".$text['button-back']."' value='◁' onclick=\"toggle('source');\">\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-destination']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='destination_number' value='$destination_number'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-context']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='context' value='$context'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-start_range']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <div class='row'>\n";
|
||||
echo " <div class='col-sm-12'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='start_stamp_begin' placeholder='".$text['label-from']."' value='$start_stamp_begin'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='start_stamp_end' placeholder='".$text['label-to']."' value='$start_stamp_end'>";
|
||||
echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-answer_range']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <div class='row'>\n";
|
||||
echo " <div class='col-sm-12'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='answer_stamp_begin' placeholder='".$text['label-from']."' value='$answer_stamp_begin'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='answer_stamp_end' placeholder='".$text['label-to']."' value='$answer_stamp_end'>";
|
||||
echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-end_range']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <div class='row'>\n";
|
||||
echo " <div class='col-sm-12'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='end_stamp_begin' placeholder='".$text['label-from']."' value='$end_stamp_begin'>";
|
||||
echo " <input type='text' class='formfld datetimepicker' style='min-width: 115px; width: 115px;' name='end_stamp_end' placeholder='".$text['label-to']."' value='$end_stamp_end'>";
|
||||
echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-duration']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='duration' value='$duration'></td>";
|
||||
echo " </tr>";
|
||||
if (permission_exists('xml_cdr_all')) {
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['button-show_all']."</td>";
|
||||
echo " <td class='vtable'>\n";
|
||||
if (permission_exists('xml_cdr_all') && $_REQUEST['showall'] == "true") {
|
||||
echo " <input type='checkbox' class='formfld' name='showall' checked='checked' value='true'>";
|
||||
}
|
||||
else {
|
||||
echo " <input type='checkbox' class='formfld' name='showall' value='true'>";
|
||||
}
|
||||
echo " <td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo " </td>";
|
||||
echo " <td width='50%' style='vertical-align: top;'>\n";
|
||||
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>";
|
||||
echo " <td width='30%' class='vncell'>".$text['label-billsec']."</td>";
|
||||
echo " <td width='70%' class='vtable'><input type='text' class='formfld' name='billsec' value='$billsec'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-hangup_cause']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='hangup_cause' value='$hangup_cause'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-uuid']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='uuid' value='$uuid'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-bridge_uuid']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='bleg_uuid' value='$bridge_uuid'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-accountcode']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='accountcode' value='$accountcode'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-read_codec']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='read_codec' value='$read_codec'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-write_codec']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='write_codec' value='$write_codec'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-remote_media_ip']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='remote_media_ip' value='$remote_media_ip'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-network_addr']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='network_addr' value='$network_addr'></td>";
|
||||
echo " </tr>";
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
$field_label = ucwords(str_replace("_", " ", $field_name));
|
||||
$field_label = str_replace("Sip", "SIP", $field_label);
|
||||
if ($field_name != "destination_number") {
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$field_label."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='".$field_name."' value='".$$field_name."'></td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-mos_score']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <select name='mos_comparison' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
echo " <option value='less'><</option>\n";
|
||||
echo " <option value='greater'>></option>\n";
|
||||
echo " <option value='lessorequal'><=</option>\n";
|
||||
echo " <option value='greaterorequal'>>=</option>\n";
|
||||
echo " <option value='equal'>=</option>\n";
|
||||
echo " <option value='notequal'><></option>\n";
|
||||
echo " </select>\n";
|
||||
echo " <input type='text' class='formfld' name='mos_score' value='$mos_score'>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'><br>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-search']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
echo " </td>";
|
||||
echo " <td width='50%' style='vertical-align: top;'>\n";
|
||||
//include footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>";
|
||||
echo " <td width='30%' class='vncell'>".$text['label-billsec']."</td>";
|
||||
echo " <td width='70%' class='vtable'><input type='text' class='formfld' name='billsec' value='$billsec'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-hangup_cause']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='hangup_cause' value='$hangup_cause'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-uuid']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='uuid' value='$uuid'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-bridge_uuid']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='bleg_uuid' value='$bridge_uuid'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-accountcode']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='accountcode' value='$accountcode'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-read_codec']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='read_codec' value='$read_codec'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-write_codec']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='write_codec' value='$write_codec'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-remote_media_ip']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='remote_media_ip' value='$remote_media_ip'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-network_addr']."</td>";
|
||||
echo " <td class='vtable'><input type='text' class='formfld' name='network_addr' value='$network_addr'></td>";
|
||||
echo " </tr>";
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell'>".$text['label-mos_score']."</td>";
|
||||
echo " <td class='vtable'>";
|
||||
echo " <select name='mos_comparison' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
echo " <option value='less'><</option>\n";
|
||||
echo " <option value='greater'>></option>\n";
|
||||
echo " <option value='lessorequal'><=</option>\n";
|
||||
echo " <option value='greaterorequal'>>=</option>\n";
|
||||
echo " <option value='equal'>=</option>\n";
|
||||
echo " <option value='notequal'><></option>\n";
|
||||
echo " </select>\n";
|
||||
echo " <input type='text' class='formfld' name='mos_score' value='$mos_score'>\n";
|
||||
echo " </td>";
|
||||
echo " </tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'><br>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-search']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -53,6 +53,11 @@ class authentication {
|
||||
$this->get_domain();
|
||||
}
|
||||
|
||||
//set the database as the default plugin
|
||||
if (!isset($_SESSION['authentication']['methods'])) {
|
||||
$_SESSION['authentication']['methods'][] = 'database';
|
||||
}
|
||||
|
||||
//use the authentication plugins
|
||||
foreach ($_SESSION['authentication']['methods'] as $name) {
|
||||
$class_name = "plugin_".$name;
|
||||
@@ -108,20 +113,37 @@ class authentication {
|
||||
if ($_SESSION["user"]["unique"]["text"] != "global") {
|
||||
$username_array = explode("@", check_str($_REQUEST["username"]));
|
||||
if (count($username_array) > 1) {
|
||||
$this->domain_name = $username_array[count($username_array) -1];
|
||||
$_REQUEST["username"] = substr(check_str($_REQUEST["username"]), 0, -(strlen($this->domain_name)+1));
|
||||
//get the domain name
|
||||
$domain_name = $username_array[count($username_array) -1];
|
||||
//check if the domain from the username exists then set the domain_uuid
|
||||
$domain_exists = false;
|
||||
foreach ($_SESSION['domains'] as $row) {
|
||||
if (lower_case($row['domain_name']) == lower_case($domain_name)) {
|
||||
$this->domain_uuid = $row['domain_uuid'];
|
||||
$domain_exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//if the domain exists then set domain_name and update the username
|
||||
if ($domain_exists) {
|
||||
$this->domain_name = $domain_name;
|
||||
$this->username = substr(check_str($_REQUEST["username"]), 0, -(strlen($domain_name)+1));
|
||||
$_SESSION['domain_uuid'] = $this->domain_uuid;
|
||||
}
|
||||
//unset the domain name variable
|
||||
unset($domain_name);
|
||||
}
|
||||
}
|
||||
//get the domain name from the http value
|
||||
if (strlen(check_str($_REQUEST["domain_name"])) > 0) {
|
||||
$this->domain_name = check_str($_REQUEST["domain_name"]);
|
||||
}
|
||||
//set
|
||||
//set the domain name
|
||||
$_SESSION['domain_name'] = $this->domain_name;
|
||||
}
|
||||
|
||||
//get the domain uuid and domain settings
|
||||
if (isset($this->domain_name)) {
|
||||
if (isset($this->domain_name) && !isset($this->domain_uuid)) {
|
||||
foreach ($_SESSION['domains'] as $row) {
|
||||
if (lower_case($row['domain_name']) == lower_case($this->domain_name)) {
|
||||
$this->domain_uuid = $row['domain_uuid'];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* plugin_database
|
||||
* plugin_database
|
||||
*
|
||||
* @method validate uses authentication plugins to check if a user is authorized to login
|
||||
* @method get_domain used to get the domain name from the URL or username and then sets both domain_name and domain_uuid
|
||||
@@ -52,6 +52,8 @@ class plugin_database {
|
||||
//$sql .= "and domain_uuid='".$this->domain_uuid."' ";
|
||||
}
|
||||
$sql .= "and (user_enabled = 'true' or user_enabled is null) ";
|
||||
//echo $sql."<br />\n";
|
||||
//echo "domain name: ".$this->domain_name;
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($_SESSION["user"]["unique"]["text"] != "global") {
|
||||
$prep_statement->bindParam(':domain_uuid', $this->domain_uuid);
|
||||
@@ -67,7 +69,8 @@ class plugin_database {
|
||||
$user_authorized = false;
|
||||
if (is_array($result)) {
|
||||
foreach ($result as &$row) {
|
||||
//get the domain uuid
|
||||
|
||||
//get the domain uuid when users are unique globally
|
||||
if ($_SESSION["user"]["unique"]["text"] == "global" && $row["domain_uuid"] != $this->domain_uuid) {
|
||||
//set the domain_uuid
|
||||
$this->domain_uuid = $row["domain_uuid"];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* plugin_ldap
|
||||
*
|
||||
* @method dap checks a local or remove ldap database to authenticate the user
|
||||
* @method ldap checks a local or remote ldap database to authenticate the user
|
||||
*/
|
||||
class plugin_ldap {
|
||||
|
||||
@@ -18,7 +18,7 @@ class plugin_ldap {
|
||||
public $contact_uuid;
|
||||
|
||||
/**
|
||||
* ldap checks a local or remove ldap database to authenticate the user
|
||||
* ldap checks a local or remote ldap database to authenticate the user
|
||||
* @return array [authorized] => true or false
|
||||
*/
|
||||
function ldap() {
|
||||
@@ -51,11 +51,20 @@ class plugin_ldap {
|
||||
//Note: As of 4/16, the call below will fail randomly. PHP debug reports ldap_bind
|
||||
//called below with all arguments '*uninitialized*'. However, the debugger
|
||||
//single-stepping just before the failing call correctly displays all the values.
|
||||
$bind = ldap_bind($connect, $bind_dn, $bind_pw);
|
||||
if ($bind) {
|
||||
$user_authorized = true;
|
||||
if (strlen($bind_pw) > 0) {
|
||||
$bind = ldap_bind($connect, $bind_dn, $bind_pw);
|
||||
if ($bind) {
|
||||
//connected and authorized
|
||||
$user_authorized = true;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
//connection failed
|
||||
$user_authorized = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//password not provided
|
||||
$user_authorized = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,393 @@
|
||||
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
|
||||
$y++;
|
||||
|
||||
//default settings
|
||||
$y = 0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '3bcb4912-e34c-45b0-8612-662783ee8d1b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'server';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'temp';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'dir';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = sys_get_temp_dir();
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'f1a7c2d4-ba3c-49c8-9146-e40eb8873030';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'template';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'name';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'default';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'da9aa071-5dd8-4955-b5a6-d3c60ce7d78a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'menu';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'uuid';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '500f7a88-e288-4a80-9f0a-b696f9f33cd6';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'language';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'code';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'en-us';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c55b28df-0eba-4e8f-a13b-022d5dfd8d22';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'time_zone';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'name';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'cb55e6ac-9bb0-4714-b68f-82b39a3b9ec2';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'country';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'code';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'us';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c338e26c-0dd5-4ad5-a055-82e2c5ed3f6f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'bridge';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'outbound';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'outbound,loopback,lcr';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '48874632-421d-4829-a6b7-0695c589d85f';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'domain';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'paging';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '100';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the maximum number of records displayed per page. (Default: 50)';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '57d81b35-bc24-4e92-8436-4335ab5e9d0b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_length';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '10';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the required/default length for user/system generated passwords.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '0fa21a56-7515-4c65-b5f8-270cc24ea375';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_number';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set whether to require at least one number in user passwords.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd5f9acbd-857c-42eb-9e9a-92a850fcb734';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_lowercase';
|
||||
$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 whether to require at least one lowecase letter in user passwords.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '256b0d87-a43e-4618-b96b-541e191879c7';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_uppercase';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set whether to require at least one uppercase letter in user passwords.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '4209ff1f-6ea8-4b77-81be-bd75e8670785';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_special';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set whether to require at least one special character in user passwords.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '718b1641-fa3c-4861-b1f3-40635c951888';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_strength';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'numeric';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '4';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Set the default strength for system generated passwords. Valid Options: 1 - Numeric Only, 2 - Include Lower Apha, 3 - Include Upper Alpha, 4 - Include Special Characters.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '33914c55-9081-4b95-b62e-f1a500088d78';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'security';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'session_rotate';
|
||||
$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'] = 'Whether to regenerate the session ID.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '97a2410b-cfc8-4194-9172-dd5b0acfa9f3';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_auth';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$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'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '9f4a1209-72ba-435b-90e1-4cba48d74509';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'method';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'smtp';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'smtp|sendmail|mail|qmail';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8efff742-eea4-493d-abeb-064457586e26';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_port';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'use non-default port if enabled and non-zero';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '16f40b7b-293d-4308-81f4-772e0ea4c536';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_from';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '2976da3a-d8e5-4e25-9f16-463dfa256f4d';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_from_name';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '0bd788c1-3262-4336-92f4-ef7869062380';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_host';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '49e778a6-22a7-418f-84b9-bfa27e38f2e5';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_username';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8a5ae059-9bf3-4d6d-ae92-b6cb39766d0a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_password';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = '';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'fd7441d5-d348-4660-8c0b-6413220c680d';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_secure';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'var';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'tls';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = '';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'e1c17089-1e75-4e46-9e59-4748bb6a6cec';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'email';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'smtp_validate_certificate';
|
||||
$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 to false to ignore SSL certificate warnings e.g. for self-signed certificates';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8a07ab78-f386-482c-85dd-7ce8127597d6';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'login';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'password_reset_key';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'text';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = generate_password('20', '4');
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Display a Reset Password link on the login box (requires smtp_host be defined).';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '962ac32c-74ce-4cce-b1d9-89f4d921493d';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'login';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'domain_name_visible';
|
||||
$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'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Displays a domain input or select box (if domain_name array defined) on the login box.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '796508ee-894d-4566-bb7f-e1269a6e0e26';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'login';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'domain_name';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'pbx1.yourdomain.com';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Domain select option displayed on the login box.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'e20ff5fb-cc63-474b-90f8-f472d2247317';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '39bdd07e-dca5-4aea-949b-72286bd66fe4';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'missed';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '49dbc472-7c68-46b7-84da-986b3e925850';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'recent';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '08095792-7fa7-4d6d-9fc4-d1ba8b4f80b7';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'limits';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd8ee1c50-0c3f-41b8-879a-d0b9c58e4479';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'counts';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Domain Counts block for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '5d96872d-7828-489e-b87a-0e7b75cf1a84';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'call_routing';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'f7ca9dc1-b06e-4477-94c6-c660792ebe6c';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'admin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'ring_groups';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the admin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '610cfc85-7a17-4c96-a7c7-a83054710bc1';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'e5064608-707a-456d-8b1d-d658e7f1b8f8';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'missed';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'da9dc1a2-5d10-4fa4-82f9-0baebc1f8222';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'recent';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'b15264cf-9200-458f-a71a-5967ee7118a7';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'limits';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'false';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '3aa6b8d3-bd6d-4f4f-9a62-104f3452f31b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'counts';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard System Counts block for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '13387e37-bf0a-43ca-a24f-94339bd61208';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'system';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard System Status block for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8ca6fc59-9243-4a4f-9358-006469cf828a';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'call_routing';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '78bb45d5-8108-4bed-aced-d764575531dc';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'superadmin';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'ring_groups';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the superadmin group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'd2bf2781-18c2-44a4-bdf4-68516e68d69c';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'user';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'voicemail';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the users group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '22f90e1b-112c-4842-af77-376226e5aa46';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'user';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'missed';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the users group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'f1bf3d93-29ce-4c3e-8e91-e8ec36d1220b';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'user';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'recent';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the users group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = '8f74f69b-58f1-4040-9d4e-e949d384a915';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'user';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'call_routing';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the users group.';
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'f4e9247b-bfd1-40ed-9a1e-920e7d9ed2bb';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = 'dashboard';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'user';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = 'array';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = 'ring_groups';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true';
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the users group.';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
@@ -45,6 +432,11 @@
|
||||
$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'] = "app_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)";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "default_setting_category";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the category.";
|
||||
@@ -121,4 +513,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "The calling code.";
|
||||
$z++;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -27,418 +27,15 @@
|
||||
//process this only one time
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//define array of settings
|
||||
$x = 0;
|
||||
$array[$x]['default_setting_category'] = 'domain';
|
||||
$array[$x]['default_setting_subcategory'] = 'time_zone';
|
||||
$array[$x]['default_setting_name'] = 'name';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'domain';
|
||||
$array[$x]['default_setting_subcategory'] = 'language';
|
||||
$array[$x]['default_setting_name'] = 'code';
|
||||
$array[$x]['default_setting_value'] = 'en-us';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'domain';
|
||||
$array[$x]['default_setting_subcategory'] = 'bridge';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'outbound';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'outbound,loopback,lcr';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'domain';
|
||||
$array[$x]['default_setting_subcategory'] = 'paging';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '100';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set the maximum number of records displayed per page. (Default: 50)';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_length';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '10';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the required/default length for user/system generated passwords.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_number';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set whether to require at least one number in user passwords.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_lowercase';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set whether to require at least one lowecase letter in user passwords.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_uppercase';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set whether to require at least one uppercase letter in user passwords.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_special';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Set whether to require at least one special character in user passwords.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_strength';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '4';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Set the default strength for system generated passwords. Valid Options: 1 - Numeric Only, 2 - Include Lower Apha, 3 - Include Upper Alpha, 4 - Include Special Characters.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'security';
|
||||
$array[$x]['default_setting_subcategory'] = 'session_rotate';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Whether to regenerate the session ID.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_auth';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'method';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'smtp';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'smtp|sendmail|mail|qmail';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_port';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '0';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'use non-default port if enabled and non-zero';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_from';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_from_name';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_host';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_username';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_password';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = '';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'email';
|
||||
$array[$x]['default_setting_subcategory'] = 'smtp_secure';
|
||||
$array[$x]['default_setting_name'] = 'var';
|
||||
$array[$x]['default_setting_value'] = 'tls';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = '';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'login';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_reset_key';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = generate_password('20', '4');
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Display a Reset Password link on the login box (requires smtp_host be defined).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'login';
|
||||
$array[$x]['default_setting_subcategory'] = 'domain_name_visible';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Displays a domain input or select box (if domain_name array defined) on the login box.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'login';
|
||||
$array[$x]['default_setting_subcategory'] = 'domain_name';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'pbx1.yourdomain.com';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Domain select option displayed on the login box.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'voicemail';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'missed';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'recent';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'limits';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'counts';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Counts block for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'call_routing';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'admin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'ring_groups';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the admin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'voicemail';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'missed';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'recent';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'limits';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'counts';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard System Counts block for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'system';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard System Status block for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'call_routing';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'superadmin';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'ring_groups';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the superadmin group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'user';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'voicemail';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the users group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'user';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'missed';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the users group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'user';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'recent';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the users group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'user';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'call_routing';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the users group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'dashboard';
|
||||
$array[$x]['default_setting_subcategory'] = 'user';
|
||||
$array[$x]['default_setting_name'] = 'array';
|
||||
$array[$x]['default_setting_value'] = 'ring_groups';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the users group.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'voicemail_file';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'attach';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Define whether to attach voicemail files to email notifications, or only include a link.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'keep_local';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Define whether to keep voicemail files on the local system after sending attached via email.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'storage_type';
|
||||
$array[$x]['default_setting_name'] = 'text';
|
||||
$array[$x]['default_setting_value'] = 'base64';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Define which storage type (base_64 stores in the database).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'message_max_length';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '300';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Maximum length of a voicemail (in seconds).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'password_length';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '8';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'The default length of characters in a voicemail password.';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'greeting_max_length';
|
||||
$array[$x]['default_setting_name'] = 'numeric';
|
||||
$array[$x]['default_setting_value'] = '90';
|
||||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Maximum length of a voicemail greeting (in seconds).';
|
||||
$x++;
|
||||
$array[$x]['default_setting_category'] = 'voicemail';
|
||||
$array[$x]['default_setting_subcategory'] = 'display_domain_name';
|
||||
$array[$x]['default_setting_name'] = 'boolean';
|
||||
$array[$x]['default_setting_value'] = 'true';
|
||||
$array[$x]['default_setting_enabled'] = 'false';
|
||||
$array[$x]['default_setting_description'] = 'Enable display of @domain_name after voicemail_id when rendering emails.';
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$x = 0;
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
$missing[$x] = $setting;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory']) && trim($row['default_setting_name']) == trim($setting['default_setting_name'])) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
//get the missing count
|
||||
$i = 0;
|
||||
foreach ($missing as $row) { $i++; }
|
||||
$missing_count = $i;
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) {
|
||||
$sql = "insert into v_default_settings (";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
$sql .= "default_setting_subcategory, ";
|
||||
$sql .= "default_setting_name, ";
|
||||
$sql .= "default_setting_value, ";
|
||||
$sql .= "default_setting_enabled, ";
|
||||
$sql .= "default_setting_description ";
|
||||
$sql .= ") values \n";
|
||||
$i = 1;
|
||||
foreach ($missing as $row) {
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'".check_str($row['default_setting_category'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_name'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_value'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_enabled'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_description'])."' ";
|
||||
$sql .= ")";
|
||||
if ($missing_count != $i) {
|
||||
$sql .= ",\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$db->exec(check_sql($sql));
|
||||
unset($missing);
|
||||
}
|
||||
//set domains with enabled status of empty or null to true
|
||||
$sql = "delete from v_default_settings ";
|
||||
$sql .= "where (default_setting_category is null and default_setting_subcategory is null) ";
|
||||
$sql .= "or (default_setting_category = '' and default_setting_subcategory = '') ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//move the dynamic provision variables that from v_vars table to v_default_settings
|
||||
if (count($_SESSION['provision']) == 0) {
|
||||
/* if (count($_SESSION['provision']) == 0) {
|
||||
$sql = "select * from v_vars ";
|
||||
$sql .= "where var_cat = 'Provision' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -483,6 +80,7 @@ if ($domains_processed == 1) {
|
||||
//$db->exec(check_sql($sql));
|
||||
//echo "$var_name $var_value \n";
|
||||
}
|
||||
*/
|
||||
|
||||
//populate the languages table, if necessary
|
||||
$sql = "select count(*) as num_rows from v_languages";
|
||||
|
||||
@@ -116,6 +116,11 @@
|
||||
$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'] = "app_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)";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_setting_category";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the category.";
|
||||
@@ -144,4 +149,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -121,7 +121,7 @@ class events {
|
||||
/**
|
||||
* check for required headers
|
||||
* @param string $category
|
||||
* @return bolean $value
|
||||
* @return boolean $value
|
||||
*/
|
||||
public function check_required($category) {
|
||||
foreach ($this->required['headers'] as &$header) {
|
||||
@@ -161,4 +161,4 @@ class events {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
Copyright (C) 2010-2016
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -52,7 +52,7 @@ include "root.php";
|
||||
}
|
||||
|
||||
function write_progress($message) {
|
||||
if($this->echo_progress){
|
||||
if ($this->echo_progress){
|
||||
echo "$message\n";
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,8 @@ include "root.php";
|
||||
$this->write_debug("backing up to $dst_tar");
|
||||
if (file_exists('/bin/tar')) {
|
||||
exec('tar -cvf ' .$dst_tar. ' -C '.$dir .' .');
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
$this->write_debug('WARN: old config could not be compressed');
|
||||
$dst_dir = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name"));
|
||||
recursive_copy($dir, $dst_dir);
|
||||
@@ -100,7 +101,7 @@ include "root.php";
|
||||
//make sure the conf directory exists
|
||||
if (!is_dir($this->global_settings->switch_conf_dir())) {
|
||||
if (!mkdir($this->global_settings->switch_conf_dir(), 02770, true)) {
|
||||
throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
|
||||
$this->write_progress("Switch conf directory does not exist");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,12 +136,12 @@ include "root.php";
|
||||
protected function restart_switch() {
|
||||
$esl = new event_socket;
|
||||
if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
|
||||
throw new Exception("Failed to connect to switch");
|
||||
$this->write_progress("Failed to connect to switch");
|
||||
}
|
||||
if (!$esl->request('api fsctl shutdown restart elegant')){
|
||||
throw new Exception("Failed to send switch restart");
|
||||
$this->write_progress("Failed to send switch restart");
|
||||
}
|
||||
$esl->reset_fp();
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -24,32 +24,33 @@
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
if ($domains_processed == 1) {
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//update the notifications table
|
||||
$sql = "select count(*) as num_rows from v_notifications ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$sql = "insert into v_notifications ";
|
||||
$sql .= "(";
|
||||
$sql .= "notification_uuid, ";
|
||||
$sql .= "project_notifications ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'false' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
//update the notifications table
|
||||
if (is_array($_SESSION['switch']['scripts'])) {
|
||||
$sql = "select count(*) as num_rows from v_notifications ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] == 0) {
|
||||
$sql = "insert into v_notifications ";
|
||||
$sql .= "(";
|
||||
$sql .= "notification_uuid, ";
|
||||
$sql .= "project_notifications ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'false' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -85,7 +85,7 @@ if ($domains_processed == 1) {
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'e2bff94b-2c68-45ee-9141-d4cdb437c644', ";
|
||||
$sql .= "'login', ";
|
||||
$sql .= "'message', ";
|
||||
$sql .= "'text', ";
|
||||
@@ -133,4 +133,4 @@ if ($domains_processed == 1) {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
// run source update
|
||||
if ($do["source"] && permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx")) {
|
||||
chdir($_SERVER["PROJECT_ROOT"]);
|
||||
exec("git pull", $response_source_update);
|
||||
exec("git pull 2>&1", $response_source_update);
|
||||
$update_failed = true;
|
||||
if (sizeof($response_source_update) > 0) {
|
||||
$_SESSION["response_source_update"] = $response_source_update;
|
||||
@@ -64,6 +64,11 @@
|
||||
if (substr_count($response_line, "Updating ") > 0 || substr_count($response_line, "Already up-to-date.") > 0) {
|
||||
$update_failed = false;
|
||||
}
|
||||
|
||||
if (substr_count($response_line, "error") > 0) {
|
||||
$update_failed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($update_failed) {
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// set included, if not
|
||||
if (!isset($included)) { $included = false; }
|
||||
|
||||
//check the permission
|
||||
if(defined('STDIN')) {
|
||||
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
|
||||
@@ -57,4 +54,4 @@
|
||||
$domain = new domains;
|
||||
$domain->upgrade();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
preg_match("/^(.*)\/core\/.*$/", $document_root, $matches);
|
||||
$document_root = $matches[1];
|
||||
set_include_path($document_root);
|
||||
require_once "resources/require.php";
|
||||
include "root.php";
|
||||
include "resources/functions.php";
|
||||
require_once "resources/classes/text.php";
|
||||
$_SERVER["DOCUMENT_ROOT"] = $document_root;
|
||||
$format = 'text'; //html, text
|
||||
|
||||
@@ -102,6 +102,19 @@ $text['message-failed']['uk'] = "";
|
||||
$text['message-failed']['sv-se'] = "Uppdatering Misslyckades - Kontakta Support";
|
||||
$text['message-failed']['de-at'] = "Aktualisierung fehlgeschlagen - Kontaktieren Sie den Support";
|
||||
|
||||
$text['message-duplicate']['en-us'] = "Duplicate Detected";
|
||||
$text['message-duplicate']['es-cl'] = "duplicar detectado";
|
||||
$text['message-duplicate']['pt-pt'] = "Detectado um duplicado";
|
||||
$text['message-duplicate']['fr-fr'] = "Donblons détectés";
|
||||
$text['message-duplicate']['pt-br'] = "Detectado uma dubplicidade";
|
||||
$text['message-duplicate']['pl'] = "Wykryto duplikat";
|
||||
$text['message-duplicate']['uk'] = "Знайдено дублікат";
|
||||
$text['message-duplicate']['sv-se'] = "Dubblett Upptäckt";
|
||||
$text['message-duplicate']['ro'] = "";
|
||||
$text['message-duplicate']['de-at'] = "bereits vorhanden";
|
||||
$text['message-duplicate']['ar-eg'] = "";
|
||||
$text['message-duplicate']['he'] = "זוהותה כפילות";
|
||||
|
||||
$text['message-copy']['en-us'] = "Copy Completed";
|
||||
$text['message-copy']['es-cl'] = "Copia Completado";
|
||||
$text['message-copy']['pt-pt'] = "Cópia Preenchida";
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
//if the username is not provided then send to login.php
|
||||
if (strlen(check_str($_REQUEST["username"])) == 0 && strlen(check_str($_REQUEST["key"])) == 0) {
|
||||
if (strlen($_REQUEST["username"]) == 0 && strlen($_REQUEST["key"]) == 0) {
|
||||
$target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["REQUEST_URI"];
|
||||
$_SESSION["message_mood"] = "negative";
|
||||
$_SESSION["message"] = "Invalid Username and/or Password";
|
||||
@@ -59,19 +59,34 @@
|
||||
|
||||
//validate the username and password
|
||||
$auth = new authentication;
|
||||
$auth->username = $_REQUEST["username"];
|
||||
$auth->password = $_REQUEST["password"];
|
||||
if (strlen($_REQUEST["username"]) > 0) {
|
||||
$auth->username = $_REQUEST["username"];
|
||||
$auth->password = $_REQUEST["password"];
|
||||
}
|
||||
if (strlen($_REQUEST["key"]) > 0) {
|
||||
$auth->key = $_REQUEST["key"];
|
||||
}
|
||||
$auth->debug = false;
|
||||
$result = $auth->validate();
|
||||
if ($result["authorized"] == "true") {
|
||||
// add the user settings
|
||||
// set the session variables
|
||||
$_SESSION["domain_uuid"] = $result["domain_uuid"];
|
||||
$_SESSION["user_uuid"] = $result["user_uuid"];
|
||||
|
||||
// user session array
|
||||
$_SESSION["user"]["username"] = $result["username"];
|
||||
$_SESSION["user"]["user_uuid"] = $result["user_uuid"];
|
||||
$_SESSION["user"]["contact_uuid"] = $result["contact_uuid"];
|
||||
}
|
||||
else {
|
||||
//debug
|
||||
if ($debug) {
|
||||
echo "<pre>";
|
||||
print_r($result);
|
||||
echo "</pre>";
|
||||
exit;
|
||||
}
|
||||
|
||||
//log the failed auth attempt to the system, to be available for fail2ban.
|
||||
openlog('FusionPBX', LOG_NDELAY, LOG_AUTH);
|
||||
syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] authentication failed for ".$result["username"]);
|
||||
@@ -91,7 +106,7 @@
|
||||
$sql .= "where domain_uuid=:domain_uuid ";
|
||||
$sql .= "and user_uuid=:user_uuid ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->bindParam(':domain_uuid', $domain_uuid);
|
||||
$prep_statement->bindParam(':domain_uuid', $_SESSION["domain_uuid"] );
|
||||
$prep_statement->bindParam(':user_uuid', $_SESSION["user_uuid"]);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
@@ -105,10 +120,10 @@
|
||||
foreach($_SESSION["groups"] as $field) {
|
||||
if (strlen($field['group_name']) > 0) {
|
||||
if ($x == 0) {
|
||||
$sql .= "where (domain_uuid = '".$domain_uuid."' and domain_uuid = null) ";
|
||||
$sql .= "where (domain_uuid = '".$_SESSION["domain_uuid"]."' and domain_uuid = null) ";
|
||||
}
|
||||
else {
|
||||
$sql .= "or (domain_uuid = '".$domain_uuid."' and domain_uuid = null) ";
|
||||
$sql .= "or (domain_uuid = '".$_SESSION["domain_uuid"]."' and domain_uuid = null) ";
|
||||
}
|
||||
$sql .= "or group_name = '".$field['group_name']."' ";
|
||||
$x++;
|
||||
|
||||
@@ -584,4 +584,4 @@ if (!function_exists('php_right')) {
|
||||
$database->add();
|
||||
print_r($database->result);
|
||||
*/
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -228,6 +228,9 @@ if (!class_exists('domains')) {
|
||||
//get the PROJECT PATH
|
||||
include "root.php";
|
||||
|
||||
//check for default settings
|
||||
$this->settings();
|
||||
|
||||
//get the list of installed apps from the core and app directories (note: GLOB_BRACE doesn't work on some systems)
|
||||
$config_list_1 = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php");
|
||||
$config_list_2 = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php");
|
||||
@@ -263,6 +266,7 @@ if (!class_exists('domains')) {
|
||||
$database_default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset($prep_statement);
|
||||
|
||||
|
||||
//get the domain_uuid
|
||||
foreach($domains as $row) {
|
||||
if (count($domains) == 1) {
|
||||
@@ -363,7 +367,114 @@ if (!class_exists('domains')) {
|
||||
unset($_SESSION['domain']);
|
||||
unset($_SESSION['switch']);
|
||||
|
||||
}
|
||||
} //end upgrade method
|
||||
|
||||
public function settings() {
|
||||
|
||||
//connect to the database if not connected
|
||||
if (!$this->db) {
|
||||
require_once "resources/classes/database.php";
|
||||
$database = new database;
|
||||
$database->connect();
|
||||
$this->db = $database->db;
|
||||
}
|
||||
|
||||
//get the list of installed apps from the core and mod directories
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
|
||||
$x=0;
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
$x = 0;
|
||||
foreach ($apps as $app) {
|
||||
if (is_array($app['default_settings'])) {
|
||||
foreach ($app['default_settings'] as $setting) {
|
||||
$array[$x] = ($setting);
|
||||
$array[$x]['app_uuid'] = $app['uuid'];
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$sql .= "order by default_setting_category asc, default_setting_subcategory asc";
|
||||
$prep_statement = $this->db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//named array
|
||||
foreach ($default_settings as $row) {
|
||||
$default_settings[$row['default_setting_category']][$row['default_setting_subcategory']][$row['default_setting_name']]['uuid'] = $row['default_setting_uuid'];
|
||||
$default_settings[$row['default_setting_category']][$row['default_setting_subcategory']][$row['default_setting_name']]['value'] = $row['default_setting_value'];
|
||||
$default_settings[$row['default_setting_category']][$row['default_setting_subcategory']][$row['default_setting_name']]['app_uuid'] = $row['app_uuid'];
|
||||
//echo "[".$row['default_setting_category']."][".$row['default_setting_subcategory']."][".$row['default_setting_name']."] = ".$row['default_setting_value']."\n";
|
||||
}
|
||||
|
||||
//update matching settings with the correct default_setting_uuid and app_uuid and if they exist remove them from the array
|
||||
$x = 0;
|
||||
foreach ($array as $row) {
|
||||
$category = $row['default_setting_category'];
|
||||
$subcategory = $row['default_setting_subcategory'];
|
||||
$name = $row['default_setting_name'];
|
||||
|
||||
if (isset($default_settings[$category][$subcategory][$name]['value'])) {
|
||||
//set the variables
|
||||
$default_setting_uuid = $default_settings[$category][$subcategory][$name]['uuid'];
|
||||
$app_uuid = $default_settings[$category][$subcategory][$name]['app_uuid'];
|
||||
//update matching settings
|
||||
if ($app_uuid == null) {
|
||||
$sql = "update v_default_settings set ";
|
||||
if ($default_setting_uuid != $row['default_setting_uuid']) {
|
||||
$sql .= "default_setting_uuid = '".$row['default_setting_uuid']."', ";
|
||||
}
|
||||
$sql .= "app_uuid = '".$row['app_uuid']."' ";
|
||||
$sql .= "where default_setting_uuid = '".$row['default_setting_uuid']."';";
|
||||
//echo $category." ".$subcategory." ".$name." ".$app_uuid."\n";
|
||||
//echo $sql."\n";
|
||||
$this->db->exec(check_sql($sql));
|
||||
//echo "\n";
|
||||
}
|
||||
|
||||
//remove settings from the array that were found
|
||||
unset($array[$x]);
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
unset($default_settings);
|
||||
|
||||
//get the missing count
|
||||
$array_count = count($array);
|
||||
|
||||
//add the missing default settings
|
||||
if (is_array($array) && count($array) > 0) {
|
||||
foreach ($array as $row) {
|
||||
$sql = "insert into v_default_settings (";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
$sql .= "default_setting_subcategory, ";
|
||||
$sql .= "default_setting_name, ";
|
||||
$sql .= "default_setting_value, ";
|
||||
$sql .= "default_setting_enabled, ";
|
||||
$sql .= "default_setting_description ";
|
||||
$sql .= ") values \n";
|
||||
$sql .= "(";
|
||||
$sql .= "'".check_str($row['default_setting_uuid'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_category'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_name'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_value'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_enabled'])."', ";
|
||||
$sql .= "'".check_str($row['default_setting_description'])."' ";
|
||||
$sql .= ");";
|
||||
//echo $sql."\n";
|
||||
$this->db->exec(check_sql($sql));
|
||||
unset($array);
|
||||
}
|
||||
}
|
||||
} //end settings method
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,11 @@ class event_socket {
|
||||
}
|
||||
|
||||
public function connect($host, $port, $password) {
|
||||
//set defaults
|
||||
if ($host == '') { $host = '127.0.0.1'; }
|
||||
if ($port == '') { $port = '8021'; }
|
||||
if ($password == '') { $password = 'ClueCon'; }
|
||||
|
||||
$fp = fsockopen($host, $port, $errno, $errdesc, 3);
|
||||
|
||||
if (!$fp) {
|
||||
|
||||
@@ -91,27 +91,32 @@ if (!class_exists('groups')) {
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
if (count($result) == 0) {
|
||||
$x = 0;
|
||||
$tmp[$x]['group_name'] = 'superadmin';
|
||||
$tmp[$x]['group_description'] = 'Super Administrator Group';
|
||||
$tmp[$x]['group_protected'] = 'false';
|
||||
//$groups[$x]['group_uuid'] = '';
|
||||
$groups[$x]['group_name'] = 'superadmin';
|
||||
$groups[$x]['group_description'] = 'Super Administrator Group';
|
||||
$groups[$x]['group_protected'] = 'false';
|
||||
$x++;
|
||||
$tmp[$x]['group_name'] = 'admin';
|
||||
$tmp[$x]['group_description'] = 'Administrator Group';
|
||||
$tmp[$x]['group_protected'] = 'false';
|
||||
//$groups[$x]['group_uuid'] = '';
|
||||
$groups[$x]['group_name'] = 'admin';
|
||||
$groups[$x]['group_description'] = 'Administrator Group';
|
||||
$groups[$x]['group_protected'] = 'false';
|
||||
$x++;
|
||||
$tmp[$x]['group_name'] = 'user';
|
||||
$tmp[$x]['group_description'] = 'User Group';
|
||||
$tmp[$x]['group_protected'] = 'false';
|
||||
//$groups[$x]['group_uuid'] = '';
|
||||
$groups[$x]['group_name'] = 'user';
|
||||
$groups[$x]['group_description'] = 'User Group';
|
||||
$groups[$x]['group_protected'] = 'false';
|
||||
$x++;
|
||||
$tmp[$x]['group_name'] = 'public';
|
||||
$tmp[$x]['group_description'] = 'Public Group';
|
||||
$tmp[$x]['group_protected'] = 'false';
|
||||
//$groups[$x]['group_uuid'] = '';
|
||||
$groups[$x]['group_name'] = 'public';
|
||||
$groups[$x]['group_description'] = 'Public Group';
|
||||
$groups[$x]['group_protected'] = 'false';
|
||||
$x++;
|
||||
$tmp[$x]['group_name'] = 'agent';
|
||||
$tmp[$x]['group_description'] = 'Call Center Agent Group';
|
||||
$tmp[$x]['group_protected'] = 'false';
|
||||
//$groups[$x]['group_uuid'] = '';
|
||||
$groups[$x]['group_name'] = 'agent';
|
||||
$groups[$x]['group_description'] = 'Call Center Agent Group';
|
||||
$groups[$x]['group_protected'] = 'false';
|
||||
$this->db->beginTransaction();
|
||||
foreach($tmp as $row) {
|
||||
foreach($groups as $row) {
|
||||
if (strlen($row['group_name']) > 0) {
|
||||
$sql = "insert into v_groups ";
|
||||
$sql .= "(";
|
||||
@@ -156,8 +161,8 @@ if (!class_exists('groups')) {
|
||||
//no permissions found add the defaults
|
||||
$this->db->beginTransaction();
|
||||
foreach($apps as $app) {
|
||||
foreach ($app['permissions'] as $row) {
|
||||
foreach ($row['groups'] as $group) {
|
||||
if (is_array($app['permissions'])) foreach ($app['permissions'] as $row) {
|
||||
if (is_array($row['groups'])) foreach ($row['groups'] as $group) {
|
||||
//add the record
|
||||
$sql = "insert into v_group_permissions ";
|
||||
$sql .= "(";
|
||||
@@ -188,4 +193,4 @@ if (!class_exists('groups')) {
|
||||
$group = new groups;
|
||||
$group->defaults();
|
||||
*/
|
||||
?>
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user