mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Remove redundant database objects
This reduces database connections and improves performance.
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
|
||||
//add the access control list to the database
|
||||
$sql = "select count(*) from v_access_controls ";
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, null, 'column');
|
||||
if ($num_rows == 0) {
|
||||
|
||||
@@ -78,7 +77,6 @@
|
||||
$p = new permissions;
|
||||
$p->add('access_control_add', 'temp');
|
||||
|
||||
$database = new database;
|
||||
$database->app_name = 'access_controls';
|
||||
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
|
||||
$database->save($array, false);
|
||||
@@ -111,7 +109,6 @@
|
||||
$p = new permissions;
|
||||
$p->add('access_control_node_add', 'temp');
|
||||
|
||||
$database = new database;
|
||||
$database->app_name = 'access_controls';
|
||||
$database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd';
|
||||
$database->save($array, false);
|
||||
@@ -133,13 +130,11 @@
|
||||
//rename domains access control to providers
|
||||
$sql = "select count(*) from v_access_controls ";
|
||||
$sql .= "where access_control_name = 'domains' ";
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, null, 'column');
|
||||
if ($num_rows > 0) {
|
||||
//update the access control name
|
||||
$sql = "update v_access_controls set access_control_name = 'providers' ";
|
||||
$sql .= "where access_control_name = 'domains' ";
|
||||
$database = new database;
|
||||
$database->execute($sql, null);
|
||||
unset($sql);
|
||||
|
||||
@@ -147,7 +142,6 @@
|
||||
$sql = "update v_sip_profile_settings set sip_profile_setting_value = 'providers' ";
|
||||
$sql .= "where (sip_profile_setting_name = 'apply-inbound-acl' or sip_profile_setting_name = 'apply-register-acl') ";
|
||||
$sql .= "and sip_profile_setting_value = 'domains'; ";
|
||||
$database = new database;
|
||||
$database->execute($sql, null);
|
||||
unset($sql);
|
||||
|
||||
@@ -165,7 +159,6 @@
|
||||
//rescan each sip profile
|
||||
$sql = "select sip_profile_name from v_sip_profiles ";
|
||||
$sql .= "where sip_profile_enabled = 'true'; ";
|
||||
$database = new database;
|
||||
$sip_profiles = $database->select($sql, null, 'all');
|
||||
if (is_array($sip_profiles)) {
|
||||
foreach ($sip_profiles as $row) {
|
||||
@@ -184,7 +177,6 @@
|
||||
$sql .= "where access_control_uuid not in ( ";
|
||||
$sql .= " select access_control_uuid from v_access_controls ";
|
||||
$sql .= ")";
|
||||
$database = new database;
|
||||
$database->execute($sql, null);
|
||||
unset($sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user