Commit Graph

141 Commits

Author SHA1 Message Date
FusionPBX aeec91fae8
Fix insert on for child data
Add a few try catch,
Add ; to the end of a few SQL queries
2022-09-30 12:46:44 -06:00
FusionPBX a355dda5b7
Fix a copy error.
Fixed the copy issue when the data includes insert_user, insert_update, update_user and update_date.
2022-09-20 13:56:54 -06:00
FusionPBX e29877e958
Move unset parameters outside of the debug
Unset of the parameters is required or can have parameters that interfere with other queries.
2022-09-19 09:30:20 -06:00
FusionPBX 4400618830
Sub array data use the child table name.
In Destination edit it was using the dialplan table name instead of child dialplan details table.
2022-09-18 04:47:17 -06:00
FusionPBX 50b66f8bea
If the domain_uuid is null the data is global.
This error broken dialplan edit when saving a global dialplan.
2022-09-18 03:08:18 -06:00
FusionPBX d5bd5957a4
Minor edit add a few spaces. 2022-09-18 02:59:58 -06:00
FusionPBX 7c2017bd03
On insert and update add the user and date 2022-09-18 02:57:43 -06:00
FusionPBX 2ff62f638b
Add a few minor changes for code consistency. 2022-09-18 02:13:33 -06:00
frytimo ba3b60b07b
Move database methods to static and document database class (#6474)
* Add new static method to created newly connected database object

* Document database class and clean up and document some of the methods.
This removes the methods that should not be in each instance and places
them in the single instance class as to occupy less resources and be
able to create database objects more efficiently.

* More docs & removed the ability to set any value within the object.

Co-authored-by: Tim Fry <tim@voipstratus.com>
2022-09-17 15:44:21 -06:00
frytimo 6bb6ae6b2b
Fix PHP warning for PDO::setAttribute() requires 2 parameters (#6464)
Co-authored-by: Tim Fry <tim@voipstratus.com>
2022-08-24 14:09:33 -06:00
FusionPBX ea9b9ce621
Update additional occurances of PDO::PGSQL_ATTR_DISABLE_PREPARES 2022-08-18 17:53:33 -06:00
FusionPBX 2783cbd251
Update database.php 2022-08-18 17:39:51 -06:00
FusionPBX 98b19d1f22
Only add PDO::PGSQL_ATTR_DISABLE_PREPARES for versions of PHP that support it. 2022-08-18 17:37:43 -06:00
FusionPBX 8431d419ca
Reduce round trips to the database server.
Add PDO attribute:  PDO::PGSQL_ATTR_DISABLE_PREPARES
https://prototype.php.net/manual/en/ref.pdo-pgsql.php
2022-08-08 16:58:52 -06:00
FusionPBX 63ac177ebe
Fixes an error 'Strict Standards: Only variables should be passed by reference'
Would see this on some systems when saving call forward
2022-01-24 15:33:34 -07:00
FusionPBX 8f6d12fa7d
Add table_exists method to the database class. 2021-08-10 07:54:08 -06:00
FusionPBX 2eb83e45b8
Add new transaction save option to the database save method. 2020-12-10 19:52:03 -07:00
FusionPBX c8e51bd89e
Update database.php
Only use the $_SESSION['domain_uuid'] if it is set. It's not set when using from the command line.
2020-10-21 15:17:38 -06:00
FusionPBX ec65ab905d
Fix the database copy method. 2020-07-24 10:15:30 -06:00
Mark J Crane 1b38c9541d Make the relations method public 2020-07-17 21:43:34 -06:00
FusionPBX 4514947223
Disable this until it has been improved and tested more. 2020-07-10 12:55:58 -06:00
FusionPBX 7a720b84a9
Disable the delete for now. 2020-07-10 12:36:11 -06:00
FusionPBX 5b5696456f
Update the database class toggle, copy an delete methods. 2020-07-09 02:57:28 -06:00
FusionPBX d29ea55bcf
Update database.php 2020-04-24 17:36:14 -06:00
FusionPBX 368d7a6987
Update database.php 2020-04-24 17:14:41 -06:00
FusionPBX dc1b1f5717 Update database.php 2020-03-03 19:44:57 -07:00
FusionPBX f41e989c7f Update database.php 2020-02-08 15:53:32 -07:00
FusionPBX 843e3d3c01 Update database.php 2019-12-16 12:39:54 -07:00
FusionPBX d7af2c794d Update database.php 2019-11-23 15:30:29 -07:00
FusionPBX 71d0872945 Update database.php 2019-11-22 23:34:03 -07:00
FusionPBX 08079a9fb8 Update database.php 2019-11-20 10:14:01 -07:00
FusionPBX b9bba7edce Update database.php 2019-08-20 13:05:27 -06:00
FusionPBX a4f1854452 Update database.php 2019-08-20 12:40:51 -06:00
FusionPBX d5ebe489bb Update database.php 2019-08-03 16:16:30 -06:00
Nate b07150a01d Make singular() method public in database class. 2019-07-27 21:03:16 -06:00
Nate e6c1d232df Adjust singular() method in database class to support 'addresses'. 2019-07-27 09:02:47 -06:00
Nate 77b85a3f9c Database class integration. Modify database class singular() method to support table names ending in 'ses', such as v_databases. 2019-07-09 20:06:17 -06:00
Nate 32b04431f7 Fix typo in select() method switch statement. 2019-07-01 13:26:26 -06:00
Nate a591c87776 Database Class Support for "...ies" Table Names (#4321)
Currently, the permission checks within the class try to singularize the table name, then check for permissions based on the result.  This PR modifies the private singular() function to support table names that end in "...ies", where an _add or _edit permission likely uses a 'y' instead.  An example would be where inserting records into v_event_categories, the class should probably look for an "event_category_add" permission, instead of "event_categorie_add".  Likewise for update queries.  

This proposed change isn't foolproof, obviously. In the case of inserting or updating records in a table named v_pies, it would fail to suffice.  You're welcome to integrate a better solution, if one exists.
2019-06-30 15:11:15 -06:00
jpattWPC 4ae27f13b6 Add support for PostgreSQL TLS (#4262)
This commit adds support for PostgreSQL TLS communication. This requires /etc/fusionpbx/config.php to have two parameters added:

$db_secure = true;
$db_cert_authority = "/path/to/ca.crt";
2019-06-05 21:10:58 -06:00
FusionPBX c34ff1d4c6 Update database.php 2019-05-27 19:56:32 -06:00
FusionPBX 9796cabe28 Update database.php 2019-05-05 19:30:05 -06:00
FusionPBX 57a62cf6b6 Update database.php 2019-04-23 09:28:49 -06:00
FusionPBX 76f52e2686 Update database.php 2019-04-09 10:49:51 -06:00
FusionPBX 50c6bd254f Update database.php 2019-03-25 09:32:00 -06:00
FusionPBX b4cf441521 Update database.php 2019-03-23 17:27:58 -06:00
FusionPBX fcbac2bd02 Update database.php 2018-05-31 09:15:23 -06:00
FusionPBX 5028507062 Update database.php 2018-05-19 15:48:02 -06:00
FusionPBX 70f9d4944d Update database.php 2018-05-18 18:56:06 -06:00
FusionPBX 38eb772745 Update database.php 2018-02-12 08:40:23 -07:00
FusionPBX 12308f4082 Update database.php 2017-09-11 01:21:36 -05:00
FusionPBX a24528c196 Update database.php 2017-07-15 23:06:22 -06:00
FusionPBX 030752f964 Update database.php 2017-07-15 22:26:01 -06:00
FusionPBX 1fedc4e009 Update database.php 2017-07-15 20:38:56 -06:00
FusionPBX 420cce478d Update database.php 2017-07-15 20:20:51 -06:00
FusionPBX 3c9acd16dc Update database.php 2017-07-15 17:20:21 -06:00
FusionPBX bc414459de Update database.php 2017-07-15 17:09:01 -06:00
FusionPBX e7b49caad6 Update database.php 2017-07-14 20:44:45 -06:00
FusionPBX 0e68a3ff2f Update database.php 2017-07-14 20:41:23 -06:00
FusionPBX d0cfe5e0e1 Update database.php 2017-07-14 10:52:30 -06:00
FusionPBX a55ada0195 Update database.php 2017-07-11 12:48:20 -06:00
FusionPBX c91b280edd Update database.php 2017-07-11 11:30:22 -06:00
FusionPBX 1d8f16446a Update database.php 2017-07-11 00:13:54 -06:00
FusionPBX a086610092 Update database.php 2017-07-10 22:38:29 -06:00
FusionPBX 96cb411d72 Update database.php 2017-07-08 01:10:28 -06:00
FusionPBX c6c5c012e1 Update database.php 2017-07-04 09:48:52 -06:00
FusionPBX a93b7983ea Use null instead of an empty string for user_uuid when not available. 2017-06-11 08:48:18 -06:00
Mafoo b941879c91 BugFix - database class app_uuid (#2663)
if $database->app_uuid is not set it would use '' in some conditions
which isset would test true.
This fix uses strlen instead, but also fixes number_transations app that
highlighted the flaw
2017-06-09 13:31:50 -06:00
Mafoo 71f681496b BugFix [master] database class (#2594)
Fix for if you send an array containing both updates and new data, it would end up placing all the new data on top of the last item containing the uuid of the last update (if updates are earlier in the array than new items)
2017-05-28 10:18:07 -06:00
Mafoo 1ff6bc7ad5 Enhance [master] Better reasons for 403 in database class (#2596)
update return message when code 403 to also state the permission that failed
2017-05-25 23:54:10 -06:00
FusionPBX 6421dffba3 Update database.php 2017-03-17 00:09:32 -06:00
FusionPBX 0fb9850d07 Update database.php 2017-03-16 22:20:11 -06:00
FusionPBX d6b10c6e64 Update database.php
An improvement to make the database class more robust.
2016-11-27 00:16:18 -07:00
FusionPBX 2fcb774dc0 Update database.php
Update the database class delete method.
2016-11-23 13:39:20 -07:00
FusionPBX 549ac9a70d Update database.php
Enhance database->delete() method.
2016-11-19 14:10:06 -07:00
FusionPBX 1b06ed31d5 Update database.php 2016-11-19 11:57:36 -07:00
FusionPBX 03180c9018 Update database.php
Changes for database -> delete() keeping for the moment for backwards compatibility.
2016-11-19 11:49:38 -07:00
FusionPBX 06b94fb1e7 Update database.php
Add database -> select method.
2016-11-02 12:31:59 -06:00
FusionPBX dca1482b07 Update database.php 2016-10-20 15:03:52 -06:00
FusionPBX 1b015205cd Update database.php
Migrate methods from the orm class to the database class. Will be deprecating the orm class.
2016-10-16 10:45:04 -06:00
markjcrane fa081456b1 Change $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH to $_SERVER["PROJECT_ROOT"]. 2016-01-17 00:01:13 -07:00
Mark Crane 50010ed5ae Remove mysql_connect. 2015-04-15 01:35:15 +00:00
Mark Crane d93c5198df Fix the database class count. 2015-03-22 07:54:35 +00:00
luis daniel lucio quiroz 5210f942f4 missing a connect verification 2014-06-21 05:22:45 +00:00
luis daniel lucio quiroz 44aaf5beed missing a this 2014-06-21 05:05:32 +00:00
luis daniel lucio quiroz 79bb16cf81 new method for database object 2014-06-21 04:59:25 +00:00
Mark Crane 5e37c95abb Database class change $this->name to $this->db_name 2014-01-19 13:06:27 +00:00
Mark Crane 0eafdddc8a Fix the database class connection info so it can be provided on demand. 2013-07-13 18:33:30 +00:00
Mark Crane 9f71bdd024 Change links from includes to the resources directory. 2013-07-10 23:41:12 +00:00
Mark Crane 32e16dd2c7 Set the include path to use with config.php inside the database.php class. 2013-07-06 08:06:03 +00:00
Mark Crane 3aa617ded7 Move the class files from includes to the resources directory. 2013-07-06 07:16:58 +00:00