Complete and fix the generated provisioning XML

Use require_once to load the hooks and prevent double inclusion
This commit is contained in:
Timothée Jaussoin 2021-09-02 14:57:59 +02:00
parent 82526da4fd
commit 683e8164fc
2 changed files with 8 additions and 4 deletions

View file

@ -65,7 +65,7 @@ class ProvisioningController extends Controller
$provisioningHooks = config_path('provisioning_hooks.php');
if (file_exists($provisioningHooks)) {
require($provisioningHooks);
require_once($provisioningHooks);
}
$dom = new \DOMDocument('1.0', 'UTF-8');
@ -119,7 +119,7 @@ class ProvisioningController extends Controller
$section = $dom->createElement('section');
$section->setAttribute('name', 'proxy_' . $proxyConfigIndex);
$entry = $dom->createElement('entry', $account->identifier);
$entry = $dom->createElement('entry', '<sip:'.$account->identifier.'>');
$entry->setAttribute('name', 'reg_identity');
$section->appendChild($entry);
@ -144,10 +144,14 @@ class ProvisioningController extends Controller
$section = $dom->createElement('section');
$section->setAttribute('name', 'auth_info_' . $authInfoIndex);
$entry = $dom->createElement('entry', $account->identifier);
$entry = $dom->createElement('entry', $account->username);
$entry->setAttribute('name', 'username');
$section->appendChild($entry);
$entry = $dom->createElement('entry', $account->domain);
$entry->setAttribute('name', 'domain');
$section->appendChild($entry);
$entry = $dom->createElement('entry', $password->password);
$entry->setAttribute('name', 'ha1');
$section->appendChild($entry);

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 98
%define build_number 99
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager