Use settings class for app_defaults.php
This commit is contained in:
@@ -37,18 +37,18 @@ if ($domains_processed == 1) {
|
||||
unset($sql, $parameters);
|
||||
if (!empty($voicemails) && is_array($voicemails)) {
|
||||
foreach($voicemails as $row) {
|
||||
if (!empty($_SESSION['switch']['voicemail']['dir']) && !empty($row['voicemail_id']) && is_numeric($row['voicemail_id'])) {
|
||||
if (!file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$row['domain_name']."/".$row['voicemail_id'])) {
|
||||
mkdir($_SESSION['switch']['voicemail']['dir']."/default/".$row['domain_name']."/".$row['voicemail_id'], 0770, true);
|
||||
if (!empty($setting->get('switch','voicemail')) && !empty($row['voicemail_id']) && is_numeric($row['voicemail_id'])) {
|
||||
if (!file_exists($setting->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'])) {
|
||||
mkdir($setting->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'], 0770, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//define initial, get current, define correct languages folder paths
|
||||
$switch_configuration_dir = !empty($_SESSION['switch']['conf']['dir']) ? $_SESSION['switch']['conf']['dir'] : '/etc/freeswitch';
|
||||
$switch_configuration_dir = !empty($setting->get('switch','conf')) ? $setting->get('switch','conf') : '/etc/freeswitch';
|
||||
$switch_languages_dir_initial = $switch_configuration_dir.'/lang';
|
||||
$switch_languages_dir_current = $_SESSION['switch']['languages']['dir'] ?? '';
|
||||
$switch_languages_dir_current = $setting->get('switch','languages') ?? '';
|
||||
$switch_languages_dir_correct = $switch_configuration_dir.'/languages';
|
||||
|
||||
//ensure switch using languages (not lang) folder
|
||||
@@ -60,9 +60,6 @@ if ($domains_processed == 1) {
|
||||
|
||||
//update default setting value
|
||||
if (file_exists($switch_languages_dir_correct)) {
|
||||
//get the languages directory
|
||||
$_SESSION['switch']['languages']['dir'] = $switch_languages_dir_correct;
|
||||
|
||||
//update languages with the correct path
|
||||
$sql = "update v_default_settings ";
|
||||
$sql .= "set default_setting_value = '".$switch_languages_dir_correct."', ";
|
||||
|
||||
Reference in New Issue
Block a user