880 Commits

Author SHA1 Message Date
FusionPBX
67de72b21e Fix reconnecting to event socket connection (#7581) 2025-11-06 14:54:36 -07:00
FusionPBX
020c7c2595 Fix pid detection in service class
Fixed process ID not detected
Process Signals are not using numbers instead of their constant. PHP-FPM does not pre-declare the constants.
2025-09-30 08:44:20 -06:00
FusionPBX
94be0f3c01 Add try-catch around beginTransaction and commit
Added try-catch blocks around the save and delete methods.
2025-08-21 09:55:33 -06:00
FusionPBX
4a893ec3ae Fix large log file when using websockets #7446 2025-08-04 15:14:44 -06:00
FusionPBX
178a8b3273 Update invalid_uuid_exception.php 2025-07-13 20:06:29 -06:00
frytimo
62d6165351 Fix service parent class failed to remove PID file after shutdown (#7422)
Fixes the following:
- The service would exit but fail to remove the PID file when the shutdown command was sent to the service.
Added the following:
- Better feedback during service start up if the PID fails to be created
- Appropriate POSIX error codes on failure of modifying the PID file
2025-07-12 08:13:29 -06:00
frytimo
a429852c46 Fix auto_loader duplicate classes in interface list (#7416)
* Fix auto_loader duplicate classes in the interface list
This patch will stop the auto_loader from adding the same class to the interface list if it already exists in the list.

* Update auto_loader.php
2025-07-09 11:05:37 -06:00
frytimo
b163e3d906 Security fix for link in button (#7408)
* security fix for link in button

* Escape characters for button link
2025-07-03 12:12:32 -06:00
FusionPBX
96275ed9c1 Fix transactions to save the domain_uuid
Symptom
Advanced -> Transactions showed as global when it should have shown the correct domain. This was failing when saving a new record.
2025-07-03 09:16:26 -06:00
FusionPBX
aa6bc173a7 Update database.php 2025-07-03 08:30:53 -06:00
FusionPBX
58e69d2596 Fix the user_uuid using database::new() 2025-07-03 08:13:46 -06:00
FusionPBX
2af950cfb3 Update the menu method restore name 2025-06-30 12:31:48 -06:00
FusionPBX
61531c1a5c Update spelling 2025-06-28 17:47:05 -06:00
frytimo
a629504e39 remove unused variables in function call (#7398) 2025-06-26 23:11:33 -06:00
FusionPBX
487bf99086 Update schema.php
- Update db_table_exists
- Update db_column_exists
2025-06-26 09:46:32 -06:00
FusionPBX
3a6d6e6bbc Remove console output 2025-06-26 06:30:05 -06:00
frytimo
d5286a12bc Websockets (#7393)
* Initial commit of websockets

* Move app_menu to the active_calls websockets

* Fix hangup function

* Remove connection wait-state on web socket server so events can process

* Add timestamp and debug level to console for service debug output

* Remove debug exit

* Fix typo for ws_client instead of ws_server

* Update app_config.php

* Fix typo and remove empty function

* Remove call to empty function

* Fix the menu to point to the correct location

* Remove Logging Class

* Rename service file

* Rename service file

* Fix the in progress browser request

* Fix browser reload and implement 'active_calls' default values

* Add apply_filter function

* Create new permission_filter object

* In progress active calls now use filter

* Add invalid_uuid_exception class

* add event_key_filter to honor user permissions

* add and_link and or_link for filters

* Fix disconnected subscriber and add filters to honor permissions

* Add $key and $value for filter

* define a service name

* catch throwable instead of exception

* Add $key and $value for filter and allow returning null

* Update permission checks when loading page

* Add apply_filter function to honor subscriber permissions

* Add create_filter_chain_for function to honor subscriber permissions

* Add apply_filter function to honor subscriber permissions

* Add apply_filter function to honor subscriber permissions

* create interface to allow filterable payload

* create interface to define functions required for websocket services

* Pass in service class when creating a service token

* Allow key/name and return null for filter

* Adjust subscriber exceptions to return the ID of the subscriber

* Add event filter to filter chain

* Add command line options for ip and port for websockets and switch

* update service to use is_a syntax

* initial commit of base class for websockets system services

* initial commit of the system cpu status service

* remove extra line feed

* fix path on active_calls

* initial proof of concept for cpu status updated by websockets

* Allow returning null

* Use default settings to set the interval for cpu status broadcast

* Improve the CPU percent function for Linux systems

* Show more debug information

* Allow child processes to re-connect to the web socket service

* Fix websockets as plural instead of singular

* Add class name list-row

* Update active_calls.php

* Update active_calls.php

* Update websocket_client.js

* Update app_config.php

* Update app_menu.php

* Update debian-websockets.service

* Update debian-active_calls.service

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
2025-06-24 13:07:57 -06:00
frytimo
c53ee8c503 Remove setting app and uuid for groups (#7392) 2025-06-23 13:18:57 -06:00
FusionPBX
ee16644e25 Rename methods used in restore default
Renamed methods
- delete to restore_delete 
- restore to restore_default
2025-05-28 19:49:45 -06:00
FusionPBX
b96b5f8c0f menu_item_protected deprecated
This protected feature has not been working correctly. At the moment commented out depending on feedback it maybe removed entirely.
2025-05-28 19:37:58 -06:00
K-Flagman
62791e4eb3 [CORE] [MENU] Feature Assign/Unassign User Groups (#7373) 2025-05-17 13:50:02 -06:00
frytimo
c4e63c2562 Do not create a new socket when one is provided (#7358)
Check that the current socket in the object is false before trying to create a new socket
2025-04-25 10:38:43 -06:00
FusionPBX
96a6cca25b Define the settings object as global 2025-04-14 10:46:57 -06:00
FusionPBX
c3952028b1 Use the settings get method for the buttons 2025-04-14 10:36:21 -06:00
FusionPBX
a02fcdca37 Update domains all, add enabled and disabled methods
The domains all  method uses domain_uuid for the array key
2025-04-11 11:39:33 -06:00
FusionPBX
07cf65dee5 Update domains all and session methods
Updated to improve and simplify it
2025-04-11 10:34:38 -06:00
FusionPBX
d583e8352d Use more intuitive names 2025-04-07 14:48:47 -06:00
frytimo
5ed20f1c2f Fix plugin class name mismatch in auto loader (#7350)
* Fix plugin class name mismatch in auto loader
When matching the file name of the plugins in the authentication plugin folder they do not match. This causes auto loader not to find and load the class.

* Update auto_loader.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
2025-04-01 09:07:26 -06:00
frytimo
5c1be1a318 Update clear cache method for settings object (#7348)
* update clear cache method for settings object

* re-use the database object from settings object
2025-03-31 10:04:33 -06:00
FusionPBX
0b9fd924a9 Add not empty check on the domains session 2025-03-29 13:20:38 -06:00
frytimo
00c6befb70 Add missing file path when cache miss in auto_loader (#7339) 2025-03-27 13:33:36 -06:00
frytimo
b5af974d34 Add backslash to the trim command (#7338) 2025-03-26 14:56:55 -06:00
frytimo
c165afc53e Fix trim command on interface name (#7336) 2025-03-26 13:11:37 -06:00
frytimo
6d356194ba Ensure apcu_cache_info function is available before calling (#7323) 2025-03-17 14:58:36 -06:00
frytimo
1572c76963 Use regex in autoloader instead of include (#7322) 2025-03-17 10:01:11 -06:00
frytimo
ad1ba95566 Fix undefined constant error when flushing cache (#7321) 2025-03-17 10:00:25 -06:00
frytimo
0a42d8f198 Add caching to the auto_loader for interfaces (#7320)
* update auto loader to load and cache interfaces

* use new method to update the auto loader cache

* use new interface

* use new interface to trigger a cache flush

* update the console upgrade menu

* update the missing implements syntax

* add the clear_cache to the flush cache button
2025-03-15 09:13:36 -06:00
frytimo
77d2b3099a Create get methods for domain_uuid and user_uuid (#7144)
* create get methods for domain_uuid and user_uuid
2025-03-13 14:32:51 -06:00
FusionPBX
6c6814b29e Remove syntax that breaks older PHP
Removed :static to support PHP 7.4
2025-03-12 23:39:24 -06:00
FusionPBX
31a88e3a15 Update auto_loader.php 2025-03-12 14:48:33 -06:00
frytimo
08001488f4 Allow namespace in auto loader (#7307)
* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove closing tag

* remove invalid method params

* remove closing tag

* remove closing tag

* Update auto_loader to load each class file in the project
Update the auto_loader class to use an include statement on each file in the project to load the class within the file. This will allow mismatched names within the file to be loaded and mapped according to the declaration instead of the filename. The class is then checked against the parsed classes from the PHP engine so that namespaces are available and mapped to the file they were declared in. An update was also made to the search algorithm used to find a file that was not already loaded by collapsing the array to have only valid matches to increase performance on a cache miss. Logging within the auto_loader has been moved to a function.
Multiple files were modified to allow the include statement. When the class has the `if(class_exists())` statement, the auto_loader is called to check for the class. This caused an infinite loop scenario so all wrappers have been removed. The auto_loader will now break the loop by directly modifying the internal classes array instead of trying to restart with the 'reload_classes' method.

- APCu is used to cache classes so any loading of the classes is done only once. To clear the APCu cache, restart php-fpm or call the auto_loader::clear_cache() function.
- Cache file is used when APCu is not available. To clear the cache remove it from the tmp folder or call the auto_loader::clear_cache() function.
- All classes must no longer have a class_exists wrapper to benefit from the performance boost.
- Classes should not be directly included when the auto_loader is used.

* remove include statement of class file

* Update destinations.php
2025-03-12 13:55:47 -06:00
frytimo
d529021b3f Use boolean setting as true boolean (#7284)
* use boolean setting as true boolean

* Update settings class to use the php filter_var function for boolean
Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested.
I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.

* Update settings class to use the php filter_var function for boolean
Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested.
I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.
2025-03-04 11:25:47 -07:00
fusionate
7b3b3aa5f9 Menu: New option to set icon colors. 2025-03-03 14:08:05 -07:00
FusionPBX
a15488a708 Update the condition for validate certificate for a boolean value 2025-03-02 10:45:31 -07:00
frytimo
f8e1e81546 fix wrong logical check (#7282)
Forgot to remove the '!' (not) operator from the cache check when re-organizing the update cache function
2025-02-27 21:09:31 -07:00
frytimo
d919a3cc1b Add the apcu caching ability for performance (#7276)
* add the apcu caching ability for performance
When the PHP extension APCu is loaded, the settings class and the auto_loader will cache their results across requests in RAM. For more information about the APCu extension visit the PHP page: https://www.php.net/apcu

* use global instead of default terminology
2025-02-25 17:21:41 -07:00
frytimo
fd34a000a6 Add old search method for auto loading classes (#7261)
Adding this commit to ensure backwards compatibility and a fail-safe mechanism for loading a class
2025-02-20 11:24:39 -07:00
frytimo
5e6ec475df update auto_loader cache file when updating (#7255) 2025-02-15 10:44:46 -07:00
frytimo
dc0f146485 fix php warning in menu class (#7256)
initialize variable before use
2025-02-15 10:43:03 -07:00
FusionPBX
c4aa9e9b02 Update the cache after loading classes array 2025-02-13 15:05:27 -07:00