Update rewrite rules
Add header with credits Add specific rule for sccp_manager Add correct fields to parse xml for sccpvalues Add new option to update files from @dkgroot/provision
This commit is contained in:
parent
2b709c9037
commit
6e26428b1d
9
conf/mappingRulesHeader
Normal file
9
conf/mappingRulesHeader
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#
|
||||||
|
# TFTPd Mapping Rules for SCCP_Manager Provision
|
||||||
|
#
|
||||||
|
# This file is maintained by Sccp_Manager, and will be overwritten by the installer
|
||||||
|
# a copy of the original can be found at sccpManagerRewrite.rules.bu
|
||||||
|
# For any changes to this file to be effective, the tftp server will have to be restarted.
|
||||||
|
#
|
||||||
|
# The rules below are provided by dkgroot/provision project https://github.com/dkgroot/provision_sccp
|
||||||
|
#
|
|
@ -1226,6 +1226,14 @@ and open the template in the editor. Base Version before all crash :-)
|
||||||
<button value="no">No</button>
|
<button value="no">No</button>
|
||||||
<help>Say 'yes' if you need to create cisco default language directory in tftp path.</help>
|
<help>Say 'yes' if you need to create cisco default language directory in tftp path.</help>
|
||||||
</item>
|
</item>
|
||||||
|
<item type="IS" id="4" seq="90">
|
||||||
|
<name>getExternalData</name>
|
||||||
|
<label>Get data files from Provision</label>
|
||||||
|
<default>no</default>
|
||||||
|
<button value="yes">Yes</button>
|
||||||
|
<button value="no">No</button>
|
||||||
|
<help>If this is set to yes, Sccp_manager will try to get data files from dkgroot/Provision (languages, ring tones, firmware etc). This is enabled at your own risk - Sccp_Manager cannot vouch for the security or accuracy of these files, and this option is included to assist in getting up to speed as rapidly as possible.</help>
|
||||||
|
</item>
|
||||||
<item type="IS" id="4" seq="90">
|
<item type="IS" id="4" seq="90">
|
||||||
<name>system_rouminguser</name>
|
<name>system_rouminguser</name>
|
||||||
<label>User Roaming</label>
|
<label>User Roaming</label>
|
||||||
|
@ -1356,7 +1364,7 @@ and open the template in the editor. Base Version before all crash :-)
|
||||||
<default></default>
|
<default></default>
|
||||||
<class>sccp-custom</class>
|
<class>sccp-custom</class>
|
||||||
</input>
|
</input>
|
||||||
<help>The ringtone that the phone will default to. Can be overridden in the phone. The files RINGLIST.XML provice the basic phone ring tones, while DISTINCTIVERINGLIST.XML defines the list of possible ring tones for your other line types. They, along with the actual 'raw' ringtones, are stored in the /tftpboot/ringtones directory with the rest of the config files.</help>
|
<help>The ringtone that the phone will default to. Can be overridden in the phone. The files RINGLIST.XML provides the basic phone ring tones, while DISTINCTIVERINGLIST.XML defines the list of possible ring tones for your other line types. They, along with the actual 'raw' ringtones, are stored in the /tftpboot/ringtones directory with the rest of the config files.</help>
|
||||||
</item>
|
</item>
|
||||||
</page_group>
|
</page_group>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
#
|
#
|
||||||
# TFTPd Rewrite for SCCP_Manager Custom remapping
|
# TFTPd Rewrite for SCCP_Manager Custom remaping
|
||||||
#
|
|
||||||
# This file is maintained by Sccp_Manager, and will be overwritten by the installer
|
|
||||||
# a copy of the original can be found at sccpManagerRewrite.rules.bu
|
|
||||||
# For any changes to this file to be effective, the tftp server will have to be restarted.
|
|
||||||
#
|
|
||||||
# /firmware
|
# /firmware
|
||||||
# /settings
|
# /settings
|
||||||
# /wallpapers
|
# /wallpapers
|
||||||
|
@ -179,8 +174,6 @@ ri ^(ATA030204SCCP090202A.zup)$ firmware/ata186/\1
|
||||||
# Sub-Directory Handling
|
# Sub-Directory Handling
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
# Do not disable the first rule - this is required by sccp_manager
|
|
||||||
ri ^(.+\.tlzz)?$ settings/\1
|
|
||||||
#ri ^(.+\.tlv)?$ settings/\1
|
#ri ^(.+\.tlv)?$ settings/\1
|
||||||
#ri ^\/(.+\.tlv)?$ settings/\1
|
#ri ^\/(.+\.tlv)?$ settings/\1
|
||||||
#ri ^((.+\.cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
#ri ^((.+\.cnf.xml)(\.enc)?(\.sgn)?)$ settings/\1
|
||||||
|
|
|
@ -858,8 +858,9 @@ function checkTftpServer() {
|
||||||
if (file_exists("{$confDir}/sccpManagerRewrite.rules")) {
|
if (file_exists("{$confDir}/sccpManagerRewrite.rules")) {
|
||||||
rename("{$confDir}/sccpManagerRewrite.rules", "{$confDir}/sccpManagerRewrite.rules.bu");
|
rename("{$confDir}/sccpManagerRewrite.rules", "{$confDir}/sccpManagerRewrite.rules.bu");
|
||||||
}
|
}
|
||||||
copy($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/contrib/rewrite.rules',"{$confDir}/sccpManagerRewrite.rules");
|
copy($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/mappingRulesHeader',"{$confDir}/sccpManagerRewrite.rules");
|
||||||
|
file_put_contents("{$confDir}/sccpManagerRewrite.rules", file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/contrib/rewrite.rules'), FILE_APPEND);
|
||||||
|
file_put_contents("{$confDir}/sccpManagerRewrite.rules", "\n# Do not disable this rule - this is required by sccp_manager\nri ^(.+\.tlzz)?$ settings/\\1", FILE_APPEND);
|
||||||
// TODO: add option to use external server
|
// TODO: add option to use external server
|
||||||
$remoteFileName = ".sccp_manager_installer_probe_sentinel_temp".mt_rand(0, 9999999);
|
$remoteFileName = ".sccp_manager_installer_probe_sentinel_temp".mt_rand(0, 9999999);
|
||||||
$remoteFileContent = "# This is a test file created by Sccp_Manager. It can be deleted without impact";
|
$remoteFileContent = "# This is a test file created by Sccp_Manager. It can be deleted without impact";
|
||||||
|
|
|
@ -541,7 +541,6 @@ trait ajaxHelper {
|
||||||
|
|
||||||
$extSettings = $this->extconfigs->updateTftpStructure(array_merge($this->sccpvalues, $save_settings));
|
$extSettings = $this->extconfigs->updateTftpStructure(array_merge($this->sccpvalues, $save_settings));
|
||||||
$save_settings = array_merge($save_settings, $extSettings);
|
$save_settings = array_merge($save_settings, $extSettings);
|
||||||
dbug('saveSettingsAfter', $save_settings);
|
|
||||||
if (!empty($save_settings)) {
|
if (!empty($save_settings)) {
|
||||||
$this->saveSccpSettings($save_settings);
|
$this->saveSccpSettings($save_settings);
|
||||||
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting();
|
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting();
|
||||||
|
|
|
@ -280,7 +280,7 @@ trait helperfunctions {
|
||||||
$tp = 1;
|
$tp = 1;
|
||||||
}
|
}
|
||||||
if (empty($this->sccpvalues[(string) $value->name])) {
|
if (empty($this->sccpvalues[(string) $value->name])) {
|
||||||
$this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq);
|
$this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq, 'systemdefault' => '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ trait helperfunctions {
|
||||||
$datav = (string) $child->value;
|
$datav = (string) $child->value;
|
||||||
}
|
}
|
||||||
if (empty($this->sccpvalues[(string) $child->name])) {
|
if (empty($this->sccpvalues[(string) $child->name])) {
|
||||||
$this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);
|
$this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq, 'systemdefault' => '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (in_array($child['type'], array('SLD', 'SLS', 'SLT', 'SL', 'SLM', 'SLZ', 'SLTZN', 'SLA'))) {
|
if (in_array($child['type'], array('SLD', 'SLS', 'SLT', 'SL', 'SLM', 'SLZ', 'SLTZN', 'SLA'))) {
|
||||||
|
@ -301,7 +301,7 @@ trait helperfunctions {
|
||||||
$datav = (string) $child->value;
|
$datav = (string) $child->value;
|
||||||
}
|
}
|
||||||
if (empty($this->sccpvalues[(string) $child->name])) {
|
if (empty($this->sccpvalues[(string) $child->name])) {
|
||||||
$this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);
|
$this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq, 'systemdefault' => '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue