241 Commits
Author SHA1 Message Date
FusionPBX fb540e047b Update index.lua
Add the voicemail_uuid to the if statement on vm disk quota.
2017-01-30 20:56:05 -07:00
FusionPBX 10f1d7a2b2 Minor version update 4.2.2. 2017-01-30 20:39:25 -07:00
FusionPBX 6603eaab05 Update index.lua
Prevent a nil error when using voicemail has reached its quota.
2017-01-30 20:37:27 -07:00
FusionPBX 9fc3541382 Update device_vendor_function_edit.php
Prevent a warning that was discovered in the Admin Training.
2017-01-29 13:31:15 -07:00
FusionPBX 2fb79825ea Update index.php
Prevent php warning message that discovered in the Admin training.
2017-01-29 13:07:48 -07:00
FusionPBX 72094f870f Update index_inc.php
Prevent php warnings.
2017-01-29 13:06:07 -07:00
FusionPBX 7b401b39a0 Update sofia.conf.lua
This fixes the sofia profile domain alias.
2017-01-28 16:09:32 -07:00
FusionPBX 0bfd1fb885 Update app_defaults.php 2017-01-28 16:01:06 -07:00
FusionPBX e3c330017b Update 2017-01-28 15:58:58 -07:00
FusionPBX 950b764485 Update internal-ipv6.xml.noload
Add the domains and domain tags.
2017-01-28 13:08:02 -07:00
FusionPBX 9f0d14efd2 Update index.lua
Add voicemail/vm-no_answer_no_vm.wav - Gil's recommended and found this file.
2017-01-27 13:27:17 -07:00
FusionPBX 641e026474 Update index.lua
Prevent an error when the voicemail_uuid is empty when the voicemail box is disabled.
2017-01-27 12:22:12 -07:00
FusionPBX ba64113e51 Update 310_extension-to-voicemail.xml
Prevent a minor error.
2017-01-26 13:08:40 -07:00
FusionPBX bbf902a104 Update recordings.php
Prevent a warning by checking if the file exists.
2017-01-26 09:42:33 -07:00
FusionPBX 3a23176948 Update {$mac}.cfg 2017-01-25 13:32:03 -07:00
FusionPBX 22959fb2bc Update {$mac}.cfg
Prevent an empty Polycom admin password.
2017-01-25 13:30:56 -07:00
FusionPBX 7b4fa99857 Update fax_send.php
Prevent the fax cover page from exceeding 1 page.
2017-01-22 22:36:53 -07:00
FusionPBX f16b7851d6 Update status_registrations.php
Add moteus fix to display lan ip for grandstream.
2017-01-20 03:42:20 -07:00
FusionPBX 283253ac17 Update dialplans.php
Make sure dialplan context public has the correct app_uuid.
2017-01-19 12:42:20 -07:00
FusionPBX a8dc026574 Update sql_query_result.php 2017-01-19 12:01:08 -07:00
FusionPBX 87e481d285 Update sql_query_result.php
Prevent warnings.
2017-01-19 11:50:30 -07:00
FusionPBX 4eb8d5c53f Fix xml cdr export show all. 2017-01-18 20:06:40 -07:00
FusionPBX a579f82192 Update extension_edit.php
Use a slightly more elegant approach from the master branch.
2017-01-18 10:42:21 -07:00
FusionPBX 7b47ee638c Update extension_edit.php
Fix a warning for music on hold.
2017-01-18 10:37:04 -07:00
FusionPBX 3835477219 Update sofia.conf.lua 2017-01-18 08:57:11 -07:00
FusionPBX eae6c0aa92 Update domains.php 2017-01-17 14:02:36 -07:00
FusionPBX ae6b922736 Update email_cron.php 2017-01-16 23:47:49 -07:00
FusionPBX baeb2fbae9 Update email_cron.php 2017-01-16 18:27:25 -07:00
FusionPBX 3cdae74fde Update v_mailto.php 2017-01-16 18:23:05 -07:00
DigiDaz d419a459f7 Stop warning message appearing (#2301)
Stops php warning message appearing when there are no assigned agents

(Warning: Invalid argument supplied for foreach() in /var/www/fusionpbx/app/call_centers/call_center_queue_edit.php on line 635)
2017-01-15 18:43:26 -07:00
FusionPBX 98f20b78f2 Change a duplicate uuid. 2017-01-14 20:27:42 -07:00
FusionPBX 10926f1721 Update domains.php 2017-01-14 18:16:37 -07:00
FusionPBX b853b7253c Update events.php 2017-01-14 16:04:28 -07:00
FusionPBX 070eef4334 Voicemail settings moved to app/voicemail 2017-01-14 14:26:41 -07:00
FusionPBX ff6a9c4247 Update app_config.php 2017-01-14 14:01:14 -07:00
FusionPBX 2d2fc2c787 Add the settings method to the domains class.
This is to help make the install a smoother process and other benefits.
2017-01-14 13:18:43 -07:00
FusionPBX e5df85049d Update app_config.php 2017-01-14 12:13:28 -07:00
FusionPBX f2d4c4d990 Update app_config.php 2017-01-14 11:19:28 -07:00
FusionPBX dff02c733c Update app_config.php 2017-01-14 00:11:25 -07:00
FusionPBX 63863a8839 Update app_config.php 2017-01-13 16:39:11 -07:00
FusionPBX 7411592da8 Update app_config.php 2017-01-13 16:36:09 -07:00
FusionPBX c370b5097f Update app_config.php 2017-01-13 16:32:04 -07:00
FusionPBX efd22e1b68 Update app_config.php 2017-01-13 16:29:24 -07:00
FusionPBX 6c2266f099 Delete app_defaults.php 2017-01-13 14:05:44 -07:00
FusionPBX 3e9a030380 Delete app_defaults.php 2017-01-13 13:57:56 -07:00
FusionPBX db9778c87a Update app_defaults.php 2017-01-13 13:50:55 -07:00
FusionPBX 5c63d07d0c Create app_config.php 2017-01-13 13:49:02 -07:00
FusionPBX ac16421c0c Update 470_valet_park.xml 2017-01-13 11:37:17 -07:00
FusionPBX 2d45fb0cca Update app_defaults.php 2017-01-13 10:18:19 -07:00
FusionPBX ef7a71cab4 Update app_config.php 2017-01-13 10:02:42 -07:00
FusionPBX f4b445cad3 Update app_defaults.php 2017-01-13 09:58:36 -07:00
FusionPBX 5fae9183e1 Update app_config.php 2017-01-13 00:27:09 -07:00
FusionPBX c0a5ed67a5 Update app_defaults.php 2017-01-13 00:24:07 -07:00
FusionPBX d5a4f263c3 Update app_config.php 2017-01-13 00:20:30 -07:00
FusionPBX 829444f962 Update app_defaults.php 2017-01-13 00:17:42 -07:00
FusionPBX 56d1eabda9 Update app_config.php 2017-01-13 00:12:07 -07:00
FusionPBX f92e5c7543 Update app_defaults.php 2017-01-12 23:51:25 -07:00
FusionPBX 93cf491c2e Update app_defaults.php 2017-01-12 23:48:08 -07:00
FusionPBX 732c08ca2b Update app_config.php 2017-01-12 23:44:56 -07:00
FusionPBX e46cd9a48e Update app_defaults.php 2017-01-12 23:38:25 -07:00
FusionPBX 46b14657bc Update app_config.php 2017-01-12 23:31:44 -07:00
FusionPBX 28b20fc174 Update app_defaults.php 2017-01-12 23:27:37 -07:00
FusionPBX 77aee41478 Update app_config.php 2017-01-12 23:23:44 -07:00
FusionPBX cb9067debc Update 2017-01-12 23:12:07 -07:00
FusionPBX efd77c36be Update app_defaults.php 2017-01-12 23:04:41 -07:00
FusionPBX b2a49aaddf Update app_config.php 2017-01-12 23:03:48 -07:00
FusionPBX c99753bddc Update app_defaults.php 2017-01-12 22:54:15 -07:00
FusionPBX fa3292a766 Update app_config.php 2017-01-12 22:53:09 -07:00
FusionPBX 061c819a78 Update app_config.php 2017-01-12 22:51:41 -07:00
FusionPBX c236b72ea7 Update app_defaults.php 2017-01-12 22:43:19 -07:00
FusionPBX d52bcd79fb Update app_config.php 2017-01-12 22:41:04 -07:00
FusionPBX f7d56f40a1 Update app_defaults.php 2017-01-12 20:21:55 -07:00
FusionPBX 1d353f6248 Update app_defaults.php 2017-01-12 15:47:47 -07:00
FusionPBX 20dceb8aca Update app_defaults.php 2017-01-12 15:27:47 -07:00
FusionPBX ebeef3a9cc Update app_defaults.php 2017-01-12 15:14:56 -07:00
FusionPBX fc0b617b4e Update app_defaults.php 2017-01-12 14:42:51 -07:00
FusionPBX c179800bb6 Update sofia.conf.lua
Fix domain alias show with sofia status.
2017-01-12 04:25:21 -07:00
FusionPBX 1fbffe797d Update ring_group_edit.php 2017-01-12 03:16:29 -07:00
FusionPBX 391a056f8e Create app_defaults.php 2017-01-12 03:11:14 -07:00
FusionPBX 688be0fe52 Update ivr_menu_edit.php 2017-01-12 02:58:32 -07:00
FusionPBX bf4f8269b1 Create app_defaults.php 2017-01-12 02:53:53 -07:00
FusionPBX fecea0d123 Update switch.php
Add missing extension_presence_id function.
2017-01-12 01:33:56 -07:00
FusionPBX 872278e6cb Update event_socket.php 2017-01-11 14:45:00 -07:00
FusionPBX 8a7385c3cc Update groups.php
Prevent warnings in groups.php.
2017-01-11 14:38:02 -07:00
FusionPBX 29e10444b6 Update 2017-01-11 14:34:22 -07:00
FusionPBX 7b3362241d Update event_socket.php 2017-01-11 14:16:08 -07:00
FusionPBX c26c4b3316 Update app_defaults.php 2017-01-10 10:24:11 -07:00
FusionPBX 48771882e1 Update app_defaults.php
Add the menu.
2017-01-10 10:15:08 -07:00
FusionPBX 667056829c Update switch.php 2017-01-10 01:48:58 -07:00
FusionPBX fe00529fb1 Update scripts.php 2017-01-10 01:39:50 -07:00
FusionPBX 27e709f32d Update switch_settings.php 2017-01-10 01:20:02 -07:00
FusionPBX 18047f2611 Update app_defaults.php 2017-01-10 01:14:49 -07:00
FusionPBX b4019239ba Update app_defaults.php 2017-01-10 01:09:11 -07:00
FusionPBX 2bfbce7ec8 Update 2017-01-10 00:59:37 -07:00
FusionPBX 884290378d Update app_defaults.php 2017-01-10 00:45:54 -07:00
FusionPBX 3f495272a6 Update app_defaults.php 2017-01-10 00:37:45 -07:00
FusionPBX 03447bb335 Update app_defaults.php 2017-01-10 00:34:33 -07:00
FusionPBX f68487d7bd Update app_defaults.php 2017-01-10 00:33:24 -07:00
FusionPBX 884be60f99 Update upgrade_domains.php 2017-01-10 00:21:49 -07:00
FusionPBX fe68eadaf7 Update app_defaults.php 2017-01-10 00:01:28 -07:00
FusionPBX 8880a42a1a Update app_defaults.php 2017-01-09 23:47:13 -07:00
FusionPBX f7760858da Update app_defaults.php
Check to see if the file exists before renaming it.
2017-01-09 23:28:13 -07:00
FusionPBX 819e391f23 Update pdo.php 2017-01-09 17:56:41 -07:00
Len fee4e876d3 Update {$mac}.cfg
correct missing {
2017-01-08 19:42:59 -05:00
FusionPBX bf7a5f17fa Update
Fix follow me problem that prevented calling all destinations when dial_string is set in default settings.
2017-01-06 15:50:44 -07:00
FusionPBX 250650789a Create uuid.php 2017-01-05 04:16:22 -07:00
FusionPBX d3b23f7dfc Update upgrade_schema.php 2017-01-05 04:05:58 -07:00
FusionPBX 039e776a67 Update 2017-01-05 04:01:39 -07:00
FusionPBX e2284ba408 Update extension_edit.php 2017-01-05 02:32:06 -07:00
FusionPBX 352f6c4ca5 Update app_defaults.php
Fix a sql error for ringtones.
2017-01-05 02:11:35 -07:00
FusionPBX d5e798a2d1 Update xml_cdr.php 2017-01-04 22:27:12 -07:00
FusionPBX 5dc38ccc24 Update xml_cdr_inc.php 2017-01-04 21:57:48 -07:00
FusionPBX af1bb175a8 Update pdo.php
Prevent php warnings.
2017-01-04 20:41:58 -07:00
FusionPBX 96afdfb809 Update device_vendor_function_edit.php
Fix a PHP warning.
2017-01-02 20:03:14 -07:00
FusionPBX 86b17a986f Update device_vendor_functions.php
Fix a PHP warning.
2017-01-02 20:00:14 -07:00
FusionPBX 654c1a4762 Update xml_cdr.php
Add changes to make the extension summary several times faster.
2016-12-30 10:57:27 -07:00
FusionPBX e58b19c643 Update ivr.conf.lua
Fix IVR Menu direct dial conflicting with 2 to 7 digits.
2016-12-29 13:36:59 -07:00
FusionPBX 517f7fb6da Update fax_retry.lua 2016-12-27 17:55:59 -07:00
jebsolutions 88187232d4 4.2 vars.php fix notify errors (#2248)
* 4.2 vars.php fix notify errors

* Update vars.php
2016-12-26 14:57:29 -07:00
Luis Daniel Lucio Quiroz 7eca3bd4e0 Fix globals variable scope (#2262)
Some PHP installations won't recognize such as $db_type as a global variable if is inside a class. Using the super variable $GLOABALS makes sure the global variables are reached.
2016-12-26 14:54:16 -07:00
FusionPBX f414d866e5 Update functions.php
Make is_uuid more generic.
2016-12-24 14:11:15 -07:00
Luis Daniel Lucio Quiroz 3eebd937e3 Fix call forward BUSY and NO ANSWER 4.2 (#2268)
Same rationale as 4.0
2016-12-24 10:38:40 -07:00
FusionPBX 2760559529 Update app_config.php
Show follow me ignore busy by default.
2016-12-23 00:00:47 -07:00
FusionPBX 8a6a1a4277 Update xml_cdr_inc.php
Prevent warnings on the array.
2016-12-22 21:37:27 -07:00
FusionPBX b773a6db26 Update xml_cdr.php 2016-12-22 21:18:56 -07:00
FusionPBX d45ceabe19 Update xml_cdr.php 2016-12-22 21:15:05 -07:00
FusionPBX af75971b63 Update v_xml_cdr_import.php 2016-12-22 21:09:52 -07:00
FusionPBX df8470fe06 Update v_xml_cdr_import.php 2016-12-22 20:50:39 -07:00
FusionPBX 906356002e Update xml_cdr.php
Hide the the paging controls in Call Detail Records if there are are not enough records to page.
2016-12-22 19:02:23 -07:00
FusionPBX ca38f4a529 Update xml_cdr_search.php 2016-12-22 18:42:02 -07:00
FusionPBX c923f11d36 Update xml_cdr_inc.php 2016-12-22 17:55:33 -07:00
FusionPBX ae293c932e Update 2016-12-22 17:38:52 -07:00
FusionPBX aa7ed46939 Update xml_cdr.php 2016-12-22 17:02:27 -07:00
FusionPBX bc80ed0435 Update xml_cdr_inc.php 2016-12-22 17:00:20 -07:00
FusionPBX b5ed79277c Update 2016-12-22 14:37:39 -07:00
FusionPBX 0e9c4e7751 Update check_password.lua 2016-12-22 14:35:22 -07:00
FusionPBX f66d0af99f Update xml_cdr_inc.php 2016-12-21 17:06:16 -07:00
FusionPBX 33b2b48d2a Update 2016-12-21 16:59:43 -07:00
FusionPBX 44c0065f0d Update 2016-12-21 16:55:14 -07:00
FusionPBX 3112a5a170 Update v_xml_cdr_import.php 2016-12-21 14:15:57 -07:00
FusionPBX 13c601b88b Update xml_cdr.php 2016-12-21 14:05:13 -07:00
FusionPBX 641bff350f Update {$mac}.xml
Add cisco_router_mode variable.
2016-12-20 15:04:54 -07:00
FusionPBX 3315b12146 Update {$mac}.xml 2016-12-19 12:41:39 -07:00
FusionPBX 17777e7c42 Update {$mac}.xml 2016-12-19 12:40:50 -07:00
FusionPBX e935a67feb Update {$mac}.xml 2016-12-19 12:36:55 -07:00
FusionPBX e4765042e9 Update {$mac}.xml 2016-12-19 12:30:08 -07:00
FusionPBX fa24fc8716 Update {$mac}.xml 2016-12-19 12:27:46 -07:00
FusionPBX a1fe9379ec Update {$mac}.xml 2016-12-19 11:21:27 -07:00
FusionPBX 186828f63e Update 2016-12-19 11:18:45 -07:00
FusionPBX 9c53fdb3ef Update fax_send.php
Need to set the working dirctory to /tmp for unix systems.
2016-12-17 12:25:46 -07:00
FusionPBX 7e47bb6446 Update ivr.conf.lua
Fix the memcache expire on the ivr menu.
2016-12-14 08:45:16 -07:00
FusionPBX 154bf5ba83 Update scripts.php
Add expire.default and expire.ivr.
2016-12-14 08:43:10 -07:00
FusionPBX 615743970f Update vars.xml 2016-12-12 18:37:28 -07:00
DigiDaz 48e745e6d6 Fix recording setting in extension (#2246)
* Fix recording setting in extension

If as a superadmin you add recording to an extension, then the admin for the domain (ie member of group: admin) goes in and edits the extension, the recording property will be set to false.

* Update extension_edit.php
2016-12-09 16:26:38 -07:00
FusionPBX 2a8b1ff602 Update functions.php
Updating the version number to 4.2.1 which includes bug fixes and security updates.
2016-12-08 19:37:43 -07:00
FusionPBX 79d149b688 Update dialplan.lua
Use the database params.
2016-12-08 19:24:12 -07:00
markjcrane 9b1b38fab6 Improve security on the lua scripts, add lua json library, add *77 dnd toggle feature code, speed dial *0[ext], and improve blf support for extension number alias. 2016-12-08 18:36:15 -07:00
FusionPBX 30acee4dff Delete provision_write.php 2016-12-06 10:57:45 -07:00
FusionPBX d85528b195 Update device_edit.php 2016-12-06 10:47:31 -07:00
FusionPBX 0a90bd9472 Update device_profile_edit.php 2016-12-06 10:44:09 -07:00
FusionPBX 5e7e2e0778 Update device_dashboard.php 2016-12-06 10:43:16 -07:00
FusionPBX e7879e8b2f Update device_profile_delete.php 2016-12-06 10:42:05 -07:00
FusionPBX 249f0f4b45 Update device_delete.php 2016-12-06 10:39:45 -07:00
FusionPBX d45f89d5fe Update extension_edit.php
Fixes a permission issue for extension edit.
2016-12-06 10:31:44 -07:00
FusionPBX 9fb41cb357 Update 2016-12-03 13:33:47 -07:00
FusionPBX 99e0dfac48 Update voicemail.php
Increase security on the voicemail php class.
2016-12-03 12:03:09 -07:00
FusionPBX b6d49aed5e Update
Fix the bug where voicemail id is null.
2016-12-03 11:56:43 -07:00
FusionPBX 0d913c2b47 Update voicemail_messages.php 2016-12-03 11:53:16 -07:00
FusionPBX 4d03f5f356 Update fax_send.php
Use fax variables from default settings fax category.
2016-12-02 21:28:33 -07:00
FusionPBX d5c7f53be3 Update fax_to_email.php
Remove the hard coded fax_enable_t38=true,fax_enable_t38_request=true in favor of default settings -> fax -> variables.
2016-12-02 21:18:35 -07:00
FusionPBX b96f15fe4e Update fax_to_email.php 2016-12-02 17:17:14 -07:00
FusionPBX 0e5cd1d932 Create json_cdr.conf.xml 2016-12-02 12:23:09 -07:00
FusionPBX 6980ba6a4a Update {$mac}.xml
Add the SPA dialplan to Dial_Plan_2_
2016-12-02 01:59:26 -07:00
FusionPBX d3acbd3289 Update fax_to_email.php
Should fix fax relay and fax forward.
2016-12-02 00:44:38 -07:00
FusionPBX 2348767ab9 Update extension_copy.php
Change the color to red on the duplicate message.
2016-11-29 12:07:26 -07:00
FusionPBX 472069555c Update extension_copy.php 2016-11-29 11:57:54 -07:00
FusionPBX a25dad50bf Update extension.php 2016-11-29 11:50:52 -07:00
FusionPBX 54a83d5725 Update extension.php
I'm prove the extension exists method.
2016-11-29 11:39:14 -07:00
FusionPBX 9c04d93b56 Update extension.php 2016-11-29 11:05:42 -07:00
jebsolutions 04196328ef typo fix (#2200)
Ooh Noo.
2016-11-26 16:08:35 -07:00
FusionPBX 66978fae79 Update gateways.php 2016-11-25 20:39:18 -07:00
FusionPBX b2827775dc Update app_defaults.php
Make sure the temp directory exist in default settings.
2016-11-25 14:29:55 -07:00
FusionPBX b445fd24a8 Update voicemails.php
Uppercase the SQL, cast voicemail id as text, and add sterilize user data.
2016-11-24 13:02:40 -07:00
FusionPBX 50d6e4e2ff Update extension_edit.php
Prevent a minor SQL error.
2016-11-24 12:23:49 -07:00
FusionPBX b0429f15b5 Update extension.php 2016-11-24 11:35:10 -07:00
FusionPBX b9ee3c816f Update {$mac}.cfg 2016-11-24 01:44:26 -07:00
FusionPBX 9dcfbb5234 Update {$mac}.cfg 2016-11-24 01:43:56 -07:00
jebsolutions 8547f2ac32 fixes for #1821 4.2 branch (#2034)
* fixes for #1822 4.2 branch

app/extensions/app_languages.php
+ add duplicate extension error prompt

app/extensions/extension_copy.php
+ add check to see if duplicate extension exists

app/extensions/resources/classes/extension.php
+ add function to check if extension exists
+ all cherry picks "AND AND" fix from master

* fix typo

* Update app_languages.php

* Update extension_copy.php

* Update extension.php
2016-11-24 01:12:21 -07:00
FusionPBX 42aa667a26 Update app_languages.php 2016-11-24 00:56:11 -07:00
FusionPBX 14e1b6c668 Update y000000000044.cfg
Fix the reference to the yealink_t23g_firmware_url variable.
2016-11-23 23:25:36 -07:00
FusionPBX 7809b63e72 Update provision.php
Add ability to use provision settings with type boolean and numeric.
2016-11-23 22:44:38 -07:00
FusionPBX 3dd0f69b03 Create recording_play.php
Add the missing recording play file.
2016-11-23 22:07:07 -07:00
FusionPBX 72ead8b3b1 Update xml_cdr_details.php
Fix the recording links in the xml cdr details for the 4.2 branch.
2016-11-23 22:03:03 -07:00
FusionPBX 209cfbc524 Update {$mac}.cfg
Prevent ghost calls for polycom.
2016-11-23 15:48:02 -07:00
FusionPBX 4b37db4fba Update {$mac}.cfg
Prevent ghost calls for polycom.
2016-11-23 15:46:54 -07:00
FusionPBX fd17546365 Update xml_cdr.php
Fix missed calls on the extension summary.
2016-11-23 05:25:27 -07:00
FusionPBX 17e0ab3181 Update index.lua
Get the sip_from_user and sip_number_alias session variables.
2016-11-23 01:21:25 -07:00
jebsolutions f60b25175d [4.2] fix orphan v_ring_group_users after deleting ring group (#2111)
Same as pr #2110 except for 4.2 branch

steps to test:
create a ring group with one extension and one user. This will add one user to v_ring_group_users table. Delete the ring group.

expected result:
ring group and all it's components are deleted

actual result
v_ring_group_user entry for this ring group is not deleted.

This fix: deletes v_ring_group_user when ring group is deleted.
2016-11-21 13:59:51 -07:00
FusionPBX 130e415bc9 Update app_defaults.php 2016-11-20 16:50:03 -07:00
jebsolutions aa12c13056 include stderr in git pull results and check for error (#2104)
Old result (seems correct but actually failed)
Updating d190f6a..d958bea

Corrected result (includes failure message):
Updating d190f6a..d958bea
error: Your local changes to the following files would be overwritten by merge:
        app/fax/fax_log_view.php
Please, commit your changes or stash them before you can merge.
2016-11-20 13:55:12 -07:00
FusionPBX 59659ddb7a Update {$mac}.cfg 2016-11-14 23:27:35 -07:00
FusionPBX f47509143a Update ivr.conf.lua
Use ${default_language}/${default_dialect}/${default_voice} instead as it will work better when the IVR Menu is cached.
2016-11-14 12:07:04 -07:00
FusionPBX 8a3d4a2488 Update ivr.conf.lua
Fixed multi-lingual support for IVR Menu direct dial your call is being transferred and invalid entry.
2016-11-14 11:47:23 -07:00
FusionPBX 0ffb43d2a9 Update css.php
CSS fix the overwrap problem on the pre html tags.
2016-11-06 01:45:50 -07:00
FusionPBX f43c639ecc Update index.lua
Add additional security when using voicemail_authorized = true.
2016-11-06 01:07:08 -06:00
jebsolutions 251b808558 #1987 combined fix for 4.2 (#2030)
app/fax/app_defaults.php:
+ fix: duplicate check only within same default_setting_category.  This fixes the bug where "keep_local" for fax wasn't being created because there was a "keep_local" for voicemail.  Without this fix you will get a lua error due to the field not being set and nothing shows up in the sent faxes log.

fax/fax_log_view.php:
+ fix: back button text is missing.  Copied correct localized text code from another fax page that worked.

app/fax/app_config.php
+ fix: date field is now timestamp for postgres+mysql.  This fixes the listing only showing the date, not the time as well.

Note: app->defaults doesn't change field types.  Existing installs will have to manually update the field type e.g. for postgres:

sudo -sHu postgres
\d fusionpbx
alter table v_fax_logs alter column fax_date type timestamp without time zone;
\q
2016-11-03 16:25:02 -06:00
FusionPBX 3d52bba57d Update ldap.php
If the password is not provided then set user authorized to false.
2016-11-02 00:34:18 -06:00
FusionPBX 1633a2730d Update install_switch.php 2016-10-31 23:47:10 -06:00
jebsolutions 0ed5657ec6 email/fax fixes for 4.2 branch (#2022)
I updated this to latest 4.2.
2016-10-31 14:21:26 -06:00
FusionPBX b887eb4c82 Update message_waiting.lua 2016-10-30 12:16:49 -06:00
FusionPBX 29b08aa753 Update vars.xml 2016-10-27 12:44:20 -06:00
FusionPBX 213de55ccc Update xml_cdr.php 2016-10-25 18:05:55 -06:00
FusionPBX b75f73f28a Update ivr.conf.lua
Move direct dial after the options.
2016-10-25 10:07:19 -06:00
FusionPBX 8147223696 Update {$mac}.xml 2016-10-24 15:10:06 -06:00
FusionPBX cdd04a39ee Update extension.php 2016-10-18 00:19:10 -06:00
FusionPBX e0b10228e0 Update database.php
Remove the changes to the 4.2 database class they were meant for the master branch.
2016-10-16 10:47:11 -06:00
FusionPBX 6162768599 Update database.php
Moving orm method into to the database class goal is to remove orm class in the near future.
2016-10-16 10:40:03 -06:00
FusionPBX a10ce2d162 Update ivr.conf.lua
Fix IVR Menu greet short.
2016-10-16 01:07:56 -06:00
hargut 687e02569d [4.2] allow page-break on fax_message & fax_footer (#1978)
* enable page-breaks on fax messages

* fix footer & allow page break

* update footer placement to work properly on single page
2016-10-11 22:52:14 -07:00
FusionPBX f52649f2fd Update macro.lua 2016-10-08 09:53:29 -06:00
FusionPBX 65ba2caa57 Update permissions.php 2016-10-01 12:10:07 -06:00
FusionPBX 7887489078 Update xml_cdr_inc.php 2016-09-30 01:02:15 -06:00
Luis Daniel Lucio Quiroz aa21a1c4a5 Look further for domain_name (#1954)
Same rationale as 4.0
2016-09-28 17:57:29 -06:00
FusionPBX 3266c14409 Update fax_to_email.php
Fix fax to email when using method and smtp_port.
2016-09-28 13:32:09 -06:00
FusionPBX 500e42c2ac Update play_greeting.lua 2016-09-25 01:45:05 -06:00
FusionPBX 95a12e2fcd Update recordings.php
When uploading a recording ensure that the domain name directory exists so the file can be uploaded to it.
2016-09-22 19:26:40 -06:00
hargut 760c44b7b0 [4.2] Fix e-mail attachment handling / conversion & allow local emails to be valid (#1921) (#1933)
* Enable local email addresses to be valid. E.g required for local Fax submission.
* Fix filenames & allow spaces in filenames.
* Fix attachment file names.
* Revert "Fix filenames & allow spaces in filenames."
2016-09-20 21:11:13 -06:00
FusionPBX 5d9720c983 Update index.php 2016-09-20 16:51:38 -06:00
Luis Daniel Lucio Quiroz cb3b0e6f06 Fix load balancing (#1919) 2016-09-18 22:09:25 -06:00
FusionPBX 5343cfd641 Update macro.lua 2016-09-18 14:05:52 -06:00
FusionPBX 5a1f8feeec Update macro.lua 2016-09-17 18:21:36 -06:00
FusionPBX c0fdf6d9ad Update check_auth.php 2016-09-16 18:07:47 -06:00
FusionPBX 7f559315a2 Update switch.conf.xml
Update mailer-app and mailer-app-args.
2016-09-15 14:11:10 -06:00
FusionPBX 53b701c398 Update time_condition_edit.php
Time condition time-of-day use 1 minute increments this solves multiple problems and more flexible for minutes 0 - 59.
2016-09-13 19:43:02 -06:00
FusionPBX 89a5f06bb7 Update ivr_menu.php 2016-09-12 15:51:29 -06:00
FusionPBX 639516828b Update permissions.php
Use the new array structure.
2016-09-12 15:42:05 -06:00
FusionPBX 26c4168cab Update authentication.php 2016-09-11 12:52:15 -06:00
FusionPBX cd34ed0527 Update database.php 2016-09-11 12:45:39 -06:00
FusionPBX 69e258e8ae Update check_auth.php
Set the domain_uuid session variables.
2016-09-11 12:28:12 -06:00
FusionPBX 928dd3ecfa Update authentication.php
Make the database the default authentication plugin if the default setting -> authentication is not set.
2016-09-11 09:52:29 -06:00
FusionPBX b61e746b1e Fix a spelling mistake in ldap.php. 2016-09-11 09:09:16 -06:00
209 changed files with 9833 additions and 5807 deletions
+4 -2
View File
@@ -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
View File
@@ -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++;
?>
+1 -34
View File
@@ -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);
}
}
}
?>
?>
+5 -3
View File
@@ -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
View File
@@ -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++;
?>
+153 -130
View File
@@ -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."' ";
+2 -2
View File
@@ -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 @@
}
?>
?>
+1 -1
View File
@@ -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);
+4
View File
@@ -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.";
+22
View File
@@ -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";
+36 -14
View File
@@ -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";
?>
+7 -3
View File
@@ -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'])) {
+8 -2
View File
@@ -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;
?>
?>
+5 -1
View File
@@ -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
+8 -2
View File
@@ -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;
?>
?>
+5 -1
View File
@@ -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
+11 -11
View File
@@ -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'];
}
}
}
+28 -4
View File
@@ -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 ";
+10
View File
@@ -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 -->
+15 -11
View File
@@ -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
View File
@@ -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'] = "";
?>
-89
View File
@@ -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
View File
@@ -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);
?>
?>
+62 -45
View File
@@ -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]."&nbsp;</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]."&nbsp;</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";
}
}
}
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -1598,4 +1598,4 @@ $text['button-call_routing']['ro'] = "rutare de apel";
$text['button-call_routing']['ar-eg'] = "توجيه الدعوة";
$text['button-call_routing']['he'] = "ניתוב שיחות";
?>
?>
+27 -14
View File
@@ -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;
?>
?>
+32 -26
View File
@@ -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";
+30 -4
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
?>
?>
+2 -4
View File
@@ -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
View File
@@ -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 . ",";
+4 -3
View File
@@ -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
View File
@@ -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;
+22 -3
View File
@@ -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);
}
}
?>
?>
+11 -11
View File
@@ -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();
+87 -81
View File
@@ -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
}
?>
+48 -35
View File
@@ -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";
?>
+37 -27
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
?>
?>
+3 -5
View File
@@ -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 {
+10 -10
View File
@@ -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) {
}
?>
?>
+88
View File
@@ -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>
+26 -11
View File
@@ -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'} ?: "&nbsp;";
$registrations[$x]['status'] = $row->{'status'} ?: "&nbsp;";
$registrations[$x]['ping-time'] = $row->{'ping-time'} ?: "&nbsp;";
//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'] = "&nbsp;";
}
//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'] = "&nbsp;";
}
@@ -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;
}
?>
+19
View File
@@ -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) {
}
?>
+7
View File
@@ -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 ";
+30 -20
View File
@@ -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) {
+12 -8
View File
@@ -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";
+44 -1
View File
@@ -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++;
?>
?>
+106 -1
View File
@@ -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
View File
@@ -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';
?>
+2 -59
View File
@@ -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);
}
?>
}
?>
+143
View File
@@ -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';
?>
-110
View File
@@ -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);
}
?>
+3 -5
View File
@@ -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);
+1 -2
View File
@@ -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
View File
@@ -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";
?>
?>
+73
View File
@@ -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++;
?>
+195 -90
View File
@@ -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 -11
View File
@@ -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']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\" nowrap='nowrap'>".$row['message_length_label']."&nbsp;</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";
?>
?>
+35 -25
View File
@@ -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";
?>
?>
+35 -1
View File
@@ -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.";
?>
?>
-55
View File
@@ -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++;
}
}
?>
+237 -135
View File
@@ -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);
+17
View File
@@ -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
View File
@@ -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]."'>&nbsp;</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";
?>
?>
+20 -17
View File
@@ -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>&nbsp;";
}
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";
?>
?>
+34 -2
View File
@@ -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
View File
@@ -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='&#9665;' 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='&#9665;' 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'>&lt;</option>\n";
echo " <option value='greater'>&gt;</option>\n";
echo " <option value='lessorequal'>&lt;&#61;</option>\n";
echo " <option value='greaterorequal'>&gt;&#61;</option>\n";
echo " <option value='equal'>&#61;</option>\n";
echo " <option value='notequal'>&lt;&gt;</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'>&lt;</option>\n";
echo " <option value='greater'>&gt;</option>\n";
echo " <option value='lessorequal'>&lt;&#61;</option>\n";
echo " <option value='greaterorequal'>&gt;&#61;</option>\n";
echo " <option value='equal'>&#61;</option>\n";
echo " <option value='notequal'>&lt;&gt;</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;
}
+393 -1
View File
@@ -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++;
?>
?>
+9 -411
View File
@@ -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";
+6 -1
View File
@@ -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'] = "";
?>
?>
+2 -2
View File
@@ -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();
}
}
?>
?>
+25 -24
View File
@@ -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);
}
}
}
?>
?>
+2 -2
View File
@@ -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) {
}
}
?>
?>
+6 -1
View File
@@ -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) {
+1 -4
View File
@@ -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();
?>
?>
+2 -1
View File
@@ -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
+13
View File
@@ -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";
+22 -7
View File
@@ -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++;
+1 -1
View File
@@ -584,4 +584,4 @@ if (!function_exists('php_right')) {
$database->add();
print_r($database->result);
*/
?>
?>
+112 -1
View File
@@ -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
}
}
+5
View File
@@ -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) {
+24 -19
View File
@@ -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