Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sccp_manager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
private $cnf_wr = null;
public $sccppath = array();
public $sccpvalues = array();
private $dbsccpvalues = array();
public $sccp_conf_init = array();
public $xml_data;
public $class_error; //error construct
Expand Down Expand Up @@ -136,6 +137,7 @@ public function __construct($freepbx = null) {
}

$this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); //Initialise core settings
$this->dbsccpvalues = $this->sccpvalues; //Copy settings from DB for future reference
$this->initializeSccpPath(); //Set required Paths
$this->updateTimeZone(); // Get timezone from FreePBX
//$this->findInstLangs();
Expand Down Expand Up @@ -800,9 +802,9 @@ private function updateSccpButtons($hw_list = array()) {
*/

private function saveSccpSettings($save_value = array()) {

$diffToSave = array_udiff_assoc($this->sccpvalues, $this->dbsccpvalues, array($this, "compareArrays"));
if (empty($save_value)) {
$this->dbinterface->write('sccpsettings', $this->sccpvalues, 'replace'); //Change to replace as clearer
$this->dbinterface->write('sccpsettings', $diffToSave, 'update');
} else {
$this->dbinterface->write('sccpsettings', $save_value, 'update');
}
Expand Down
8 changes: 7 additions & 1 deletion sccpManTraits/helperFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ public function initialiseConfInit(){
return $sccp_conf_init;
}


public function compareArrays(array $a, array $b){
if (array_diff_assoc($a, $b)===[]) {
return 0;
}
return ($a>$b)?1:-1;
}

public function checkTftpMapping(){
exec('in.tftpd -V', $tftpInfo);
$info['TFTP Server'] = array('Version' => 'Not Found', 'about' => 'Mapping not available');
Expand Down