add function to return the config object used to create the database object (#6998) (#7006)

Co-authored-by: Tim Fry <tim@fusionpbx.com>
This commit is contained in:
Antonio Fernandez
2024-06-13 16:53:30 -04:00
committed by GitHub
parent dd4cde850d
commit ac876402b3
4 changed files with 42 additions and 1 deletions
+27
View File
@@ -783,6 +783,9 @@
else if ($device_template == "sipnetic/default") {
$qr_code_enabled = true;
}
else if ($device_template == "acrobits/default") {
$qr_code_enabled = true;
}
else {
$qr_code_enabled = false;
}
@@ -863,6 +866,30 @@
unset($template);
}
}
//build content for acrobits
else if ($device_template == 'acrobits/default') {
//check custom template provision location
if (is_file('/usr/share/fusionpbx/templates/provision/'.$device_template.'/qr_template.txt')) {
$template = file_get_contents('/usr/share/fusionpbx/templates/provision/'.$device_template.'/qr_template.txt');
}
else if (is_file('/var/www/fusionpbx/resources/templates/provision/'.$device_template.'/qr_template.txt')) {
$template = file_get_contents('/var/www/fusionpbx/resources/templates/provision/'.$device_template.'/qr_template.txt');
}
//get the provision settings
$provision = new settings(["category" => "provision"]);
$acrobits_code = $provision->get('provision', 'acrobits_code');
if (!empty($template) && isset($acrobits_code)) {
$template = str_replace('{$server_address}', $row['server_address'], $template);
$template = str_replace('{$user_id}', urlencode($row['user_id']), $template);
$template = str_replace('{$password}', urlencode(str_replace(';',';;',$row['password'])), $template);
$template = str_replace('{$code}', $acrobits_code, $template);
$content = trim($template, "\r\n");
unset($template);
unset($acrobits_code);
}
}
}