Fix all PHP 8.1 messages for upgrade.php

This commit is contained in:
markjcrane
2023-05-17 10:07:49 -06:00
parent 6816921f47
commit 6d7e125743
22 changed files with 215 additions and 152 deletions
+7 -5
View File
@@ -11,7 +11,7 @@
$array['email_templates'][$x]['template_category'] = 'authentication';
$array['email_templates'][$x]['template_subcategory'] = 'email';
$array['email_templates'][$x]['template_subject'] = 'Authentication Code';
$array['email_templates'][$x]['template_body'] .= "<html>\n";
$array['email_templates'][$x]['template_body'] = "<html>\n";
$array['email_templates'][$x]['template_body'] .= " <body>\n";
$array['email_templates'][$x]['template_body'] .= " <br />\n";
$array['email_templates'][$x]['template_body'] .= " <br><strong>Security Code</strong><br><br>\n";
@@ -28,7 +28,7 @@
$array['email_templates'][$x]['template_category'] = 'authentication';
$array['email_templates'][$x]['template_subcategory'] = 'email';
$array['email_templates'][$x]['template_subject'] = 'Authentication Code';
$array['email_templates'][$x]['template_body'] .= "<html>\n";
$array['email_templates'][$x]['template_body'] = "<html>\n";
$array['email_templates'][$x]['template_body'] .= " <body>\n";
$array['email_templates'][$x]['template_body'] .= " <br />\n";
$array['email_templates'][$x]['template_body'] .= " <br><strong>Security Code</strong><br><br>\n";
@@ -49,7 +49,7 @@
}
//add the email templates to the database
if (is_array($uuids) && @sizeof($uuids) != 0) {
if (!empty($uuids)) {
$sql = "select * from v_email_templates where ";
foreach ($uuids as $index => $uuid) {
$sql_where[] = "email_template_uuid = :email_template_uuid_".$index;
@@ -74,7 +74,7 @@
}
//add the missing email templates
if (is_array($array['email_templates']) && @sizeof($array['email_templates']) != 0) {
if (!empty($array['email_templates'])) {
//add the temporary permission
$p = new permissions;
$p->add("email_template_add", 'temp');
@@ -93,7 +93,9 @@
}
//remove the array
unset($array);
if (!empty($array)) {
unset($array);
}
}
+4 -4
View File
@@ -15,7 +15,7 @@ if ($domains_processed == 1) {
$sql = "select * from v_groups ";
$sql .= "where domain_uuid is null ";
$database = new database;
$groups = $database->select($sql, $parameters, 'all');
$groups = $database->select($sql, null, 'all');
//get the dashboard
$sql = "select ";
@@ -27,7 +27,7 @@ if ($domains_processed == 1) {
$sql .= "dashboard_description ";
$sql .= "from v_dashboard ";
$database = new database;
$dashboard_widgets = $database->select($sql, $parameters, 'all');
$dashboard_widgets = $database->select($sql, null, 'all');
unset($sql, $parameters);
//add the dashboard widgets
@@ -60,7 +60,7 @@ if ($domains_processed == 1) {
$array['dashboard'][$x]['dashboard_enabled'] = $row['dashboard_enabled'];
$array['dashboard'][$x]['dashboard_description'] = $row['dashboard_description'];
$y = 0;
if (is_array($row['dashboard_groups'])) {
if (!empty($row['dashboard_groups'])) {
foreach ($row['dashboard_groups'] as $row) {
if (isset($row['group_name'])) {
foreach($groups as $field) {
@@ -84,7 +84,7 @@ if ($domains_processed == 1) {
$p->add('dashboard_group_add', 'temp');
//save the data
if (is_array($array)) {
if (!empty($array)) {
$database = new database;
$database->app_name = 'dashboard';
$database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7';
+2 -2
View File
@@ -33,7 +33,7 @@ if ($domains_processed == 1) {
$sql = "select software_version from v_software ";
$database = new database;
$software_version = $database->select($sql, null, 'column');
if ($software_version == '') {
if (empty($software_version)) {
$array['software'][0]['software_uuid'] = '7de057e7-333b-4ebf-9466-315ae7d44efd';
$array['software'][0]['software_name'] = 'FusionPBX';
$array['software'][0]['software_url'] = 'https://www.fusionpbx.com';
@@ -45,7 +45,7 @@ if ($domains_processed == 1) {
}
//save the data in the array
if (is_array($array) && count($array) > 0) {
if (!empty($array)) {
//add the temporary permission
$p = new permissions;
$p->add("software_add", 'temp');
+3 -1
View File
@@ -27,7 +27,9 @@
if ($domains_processed == 1) {
//remove smarty cache
system('rm '.sys_get_temp_dir().'/*.php');
foreach(glob(sys_get_temp_dir().'*.php') as $file) {
unlink($file);
}
//ensure the login message is set, if new message exists
$sql = "select count(*) as num_rows from v_default_settings ";