diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index dcff7d8..8e1f917 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -609,7 +609,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $result = array(); if (!file_exists("{$this->sccppath['tftp_path']}/masterFilesStructure.xml")) { - if (!$this->getFileListFromProvisioner($this->sccppath['tftp_path'])) { + if (!$this->getFileListFromProvisioner($this->sccpvalues['tftp_path']['data'])) { // File does not exist and cannot get from internet. return $result; }; @@ -680,7 +680,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { */ function initializeSccpPath() { - $this->sccppath = array( 'asterisk' => $this->sccpvalues['asterisk_etc_path']['data'], 'tftp_path' => $this->sccpvalues['tftp_path']['data'], @@ -907,7 +906,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $hw_addon = explode(',', $dev_config['addon']); foreach ($hw_addon as $key) { $hw_data = $this->getSccpModelInformation('byid', false, "all", array('model' => $key)); - $dev_config['addon_info'][$key] = $hw_data[0]['loadimage']; + $dev_config['addon_info'][$key] = $hw_data[$key]['loadimage']; } } diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index b1b1d8f..bb7b7fb 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -116,10 +116,6 @@ $(document).ready(function () { }); }); - $(".input-js-add").click(function () { - add_dynamic_input($(this), $(this).data('for'), "", ""); - }); - $(".table").on('click', '.table-js-add', function (e) { add_dynamic_table($(this), $(this).data('for'), "", ""); }); @@ -920,32 +916,51 @@ function load_oncliсk(e, data) } } +// call from here not document.ready as have dynamic content +$(document).on('click', ".input-js-remove" , function () { + // delete the current row + var pname = $(this).data('id'); + $('#' + pname).remove(); +}); -function add_dynamic_input(pe, pclass, vdefault) -{ - // We'd like a new one, please. - pcls = pe.data('for'); - pname = pe.data('id'); - pmax = pe.data('max'); - jdata = JSON.parse(hex2bin(pe.data('json'))); +$(document).on('click', ".input-js-add" , function () { + // Add new row to networks or ip array + var pcls = $(this).data('for'), + pname = $(this).data('id'), + pmax = $(this).data('max'), + prow = $(this).data('row'), + pcount = $("." + pcls).length; + if (pcount == pmax){ + //already reached max elements + return; + } - var last = $("." + pcls + ":last"), - ourid = last.data('nextid'), - nextid = ourid + 1; - var html = "
"; + jdata = JSON.parse(hex2bin($(this).data('json'))); + + var last = $("." + pcls).last(), + ourid = last.data('nextid'), + nextid = ourid + 1, + html = "
"; for (var key in jdata) { html_opt = ''; - html_calss = jdata[key]['class']; for (var skey in jdata[key]['options']) { html_opt += ' ' + skey + '="' + jdata[key]['options'][skey] + '"'; } - html += " " + jdata[key]['nameseparator'] + " "; + html += " " + jdata[key]['nameseparator'] + " "; } + // add remove button + html += ""; + // add plus button + html += ""; html += "
\n"; - if (pmax >= nextid) { - last.after(html); - } -} + + last.after(html); + + $('#' + pname + prow + '-btn-add').remove(); +}); function del_dynamic_table(pe, pclass, vdefault) { diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 3a53000..7cfe35e 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -166,6 +166,23 @@ and open the template in the editor. Base Version before all crash :-) + + + deny + 0.0.0.0/0.0.0.0 + + + + + + + + + + + 5 + Add Deny network + All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. + permit @@ -178,6 +195,7 @@ and open the template in the editor. Base Version before all crash :-) + + 5 Add Allow Range Allow network settings. Blank fields will be ignored used Network 0.0.0.0/0.0.0.0 to resolve any existing connections. You can use the 'internal' connections only from the networks connected to the server. @@ -195,30 +213,13 @@ and open the template in the editor. Base Version before all crash :-) + + 5 Add Internal Range Local network settings. Blank fields will be ignored used Network 0.0.0.0. - - - deny - 0.0.0.0/0.0.0.0 - - - - - - - - - + - Add Deny network - All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. - ccm_address - Internal - 0.0.0.0:2000 @@ -228,6 +229,7 @@ and open the template in the editor. Base Version before all crash :-) + + 5 Add Address This function is useful when the server has many interfaces, but devices must connect only to some interfaces. @@ -712,7 +714,7 @@ and open the template in the editor. Base Version before all crash :-) srst_ip 3 / - + @@ -1683,6 +1685,7 @@ and open the template in the editor. Base Version before all crash :-) + + 5 Add Deny network All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. @@ -1690,11 +1693,7 @@ and open the template in the editor. Base Version before all crash :-) permit NONE - Inherit - false - sccp_hw-ar_permit-grinternal - sccp_hw_net_inherit @@ -1703,6 +1702,7 @@ and open the template in the editor. Base Version before all crash :-) + + 5 Add Allow network Allow network settings. Blank fields will be ignored used Network 0.0.0.0. @@ -2022,6 +2022,7 @@ and open the template in the editor. Base Version before all crash :-) col-md-9 + + 3 diff --git a/sccpManClasses/dbinterface.class.php b/sccpManClasses/dbinterface.class.php index 3dc9e7b..e233d45 100644 --- a/sccpManClasses/dbinterface.class.php +++ b/sccpManClasses/dbinterface.class.php @@ -264,7 +264,7 @@ class dbinterface $this->db->prepare('TRUNCATE sccpsettings')->execute(); $stmt = $this->db->prepare('INSERT INTO sccpsettings (keyword, data, seq, type, systemdefault) VALUES (:keyword,:data,:seq,:type,:systemdefault)'); } else { - $stmt = $this->db->prepare('REPLACE INTO sccpsettings (keyword, data, seq, type, systemdefault) VALUES (:keyword,:data,:seq,:type,:systemdefault)'); + $stmt = $this->db->prepare('REPLACE INTO sccpsettings (keyword, seq, type, data, systemdefault) VALUES (:keyword,:seq,:type,:data,:systemdefault)'); } foreach ($save_value as $key => $dataArr) { if (empty($dataArr)) { diff --git a/sccpManClasses/formcreate.class.php b/sccpManClasses/formcreate.class.php index e33e6c6..32c92c8 100644 --- a/sccpManClasses/formcreate.class.php +++ b/sccpManClasses/formcreate.class.php @@ -4,6 +4,8 @@ namespace FreePBX\modules\Sccp_manager; class formcreate { + use \FreePBX\modules\Sccp_Manager\sccpManTraits\helperFunctions; + public function __construct($parent_class = null) { $this->buttonDefLabel = 'chan-sccp'; $this->buttonHelpLabel = 'site'; @@ -174,6 +176,8 @@ class formcreate } function addElementIED($child, $fvalues, $sccp_defaults,$npref, $napref) { + //$Sccp_manager = \FreePBX::create()->Sccp_manager; + // IED fields are arrays of networks and masks, or ip and ports. $res_input = ''; $res_value = ''; $opt_at = array(); @@ -187,20 +191,27 @@ class formcreate // $res_value $lnhtm = ''; $res_id = $napref.$child->name; - $i = 0; + //$i = 0; $max_row = 255; if (!empty($child->max_row)) { $max_row = $child->max_row; } + // fvalues are current settings - the encoding depends on where the data is + // coming from: IED fields in sccpsettings are json, elsewhere they are ; delimited. if (!empty($fvalues[$res_n])) { if (!empty($fvalues[$res_n]['data'])) { - $res_value = explode(';', $fvalues[$res_n]['data']); + $res_value = $this->convertCsvToArray($fvalues[$res_n]['data']); } } + + if ($res_n == 'srst_ip') { + $res_value = $this->convertCsvToArray($sccp_defaults[$res_n]['data']); + } if (empty($res_value)) { $res_value = array((string) $child->default); } + ?>
@@ -218,15 +229,21 @@ class formcreate echo '
'; foreach ($child->xpath('cbutton') as $value) { $res_n = $res_id.'[0]['.$value['field'].']'; - $res_vf = ''; + // res_vf sets the state of the checkbox internal. This is always + // the first array element in $res_value if set + $res_vf = false; if ($value['value']=='NONE' && empty($res_value)) { - $res_vf = 'active'; + $res_vf = true; } - $ch_key = array_search($value['value'], $res_value); - if ($ch_key !== false) { - unset($res_value[$ch_key]); - $res_vf = 'active'; - $res_value = explode(';', implode(';', $res_value)); + if ((isset($res_value[0]['internal'])) || ($res_value[0] == 'internal')) { + $res_vf = true; + // Remove the value from $res_value so that do not add empty row for internal + array_shift($res_value); + // If now have an empty array, add a new empty element + if (count($res_value) == 0) { + // although handle also ip, internal is never set for those arrays + $res_value[0] = array('net'=>"", 'mask' =>""); + } } $opt_hide =''; $opt_class="button-checkbox"; @@ -250,9 +267,9 @@ class formcreate $opt_class .= " ".(string)$value->class; } - echo ''; + echo ''; } echo '
'; } @@ -261,36 +278,40 @@ class formcreate $opt_class .= " ".(string)$child->class; } echo '
'; - - foreach ($res_value as $dat_v) { + $i=1; + foreach ($res_value as $addrArr) { ?> -
> +
id= > xpath('input') as $value) { - $res_n = $res_id.'['.$i.']['.$value['field'].']'; - $fields_id = (string)$value['field']; - //$opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator']; + $field_id = (string)$value['field']; + $res_n = $res_id.'['.$i.']['.$field_id.']'; if (!empty($value->class)) { - $opt_at[$fields_id]['class']='form-control ' .(string)$value->class; + $opt_at[$field_id]['class']='form-control ' .(string)$value->class; } - //$opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator']; - if (!empty((string)$value['nameseparator'])) { - $res_vf = explode((string)$value['nameseparator'], $dat_v); - } - echo 'options)) { foreach ($value->options ->attributes() as $optkey => $optval) { - $opt_at[$fields_id]['options'][$optkey]=(string)$optval; + $opt_at[$field_id]['options'][$optkey]=(string)$optval; + $opt_at[$field_id]['nameseparator'] = (null !== (string)$value['nameseparator']) ? (string)$value['nameseparator'] : ''; echo ' '.$optkey.'="'.$optval.'"'; } } echo '> '.(string)$value['nameseparator'].' '; - $i2 ++; } + if (!empty($child->add_pluss)) { - echo ''; + if ($i <= count($res_value)) { + echo ''; + } + // only add plus button to the last row + if ($i == count($res_value)) { + echo ''; + } } echo '
'; $i++; diff --git a/sccpManClasses/xmlinterface.class.php b/sccpManClasses/xmlinterface.class.php index 8cc65e3..2b33947 100644 --- a/sccpManClasses/xmlinterface.class.php +++ b/sccpManClasses/xmlinterface.class.php @@ -15,7 +15,7 @@ namespace FreePBX\modules\Sccp_manager; class xmlinterface { - + use \FreePBX\modules\Sccp_Manager\sccpManTraits\helperFunctions; private $val_null = 'NONE'; /// REPLACE to null Field public function __construct($parent_class = null) @@ -152,7 +152,7 @@ class xmlinterface $node->addAttribute('model', $var['vendor'] . ' ' . $var['model']); } } - \FreePBX::Sccp_manager()->saveXml($xml_work, $xml_name); // Save XMLDefault1.cnf.xml + $this->saveXml($xml_work, $xml_name); // Save XMLDefault1.cnf.xml } } @@ -251,29 +251,15 @@ class xmlinterface $xnode->userModifiable = $data_values['srst_userModifiable']; $xnode->isSecure = $data_values['srst_isSecure']; - $srst_fld = array('srst_ip' => array('ipAddr', 'port')); - foreach ($srst_fld as $srst_pro => $srs_put) { - if (empty($data_values[$srst_pro]) || ($data_values['srst_Option'] == 'disable') ) { - $srst_data =array(); - } else { - $srst_data = explode(';', $data_values[$srst_pro]); - } - $si = 1; - foreach ($srst_data as $value) { - $srs_val = explode('/', $value); - $nod = $srs_put[0] . $si; - $xnode->$nod = $srs_val[0]; - $nod = $srs_put[1] . $si; - $xnode->$nod = ((empty($srs_val[1])) ? "2000": $srs_val[1]); - $si++; - } - while ($si < 4) { - $nod = $srs_put[0] . $si; - $xnode->$nod = ''; - $nod = $srs_put[1] . $si; - $xnode->$nod = ''; - $si++; - } + // srst addresses are now stored as json; + $srst_addrs = $this->convertCsvToArray($data_values['srst_ip']); + //Now have an array of srst addresses - maybe empty + + foreach ($srst_addrs as $netKey => $netValue) { + $nodeName = "ipAddr${netKey}"; + $xnode->$nodeName = $netValue['ip']; + $nodeName = "port${netKey}"; + $xnode->$nodeName = $netValue['port']; } break; case 'connectionmonitorduration': @@ -403,7 +389,7 @@ class xmlinterface } } - \FreePBX::Sccp_manager()->saveXml($xml_work, $xml_name); // Save + $this->saveXml($xml_work, $xml_name); // Save return time(); } @@ -418,20 +404,11 @@ class xmlinterface } $ip_fill = true; if (!empty($data_values['ccm_address'])) { - $ccm_address = $data_values['ccm_address']; - if (strpos($ccm_address, 'internal') === false && strpos($ccm_address, '0.0.0.0') === false) { - $tmp_data = explode(';', $ccm_address); - $ip_fill = false; - foreach ($tmp_data as $tmp_row) { - if (strpos($tmp_row, '/') !== false) { - $ttmp_r = explode('/', $tmp_row); // IPv6 - ???? - $rkey = $ttmp_r[0]; - $res[$rkey] = array('ip' => $rkey, 'port' => $ttmp_r[1]); - } else { - $rkey = $tmp_row; - $res[$rkey] = array('ip' => $rkey, 'port' => $data_values['port']); - } - } + // ccm_address is json from sccpsettings + $ccm_address = $this->convertCsvToArray($data_values['ccm_address'], true); + // This is a sanitised list of ipaddresses and ports + foreach ($ccm_address as $netValue) { + $res[$netValue['ip']] = $netValue; } } if ($ip_fill) { @@ -728,7 +705,7 @@ class xmlinterface } } - \FreePBX::Sccp_manager()->saveXml($xml_work, $xml_name); // Save + $this->saveXml($xml_work, $xml_name); // Save } else { die('Error Hardware template :' . $xml_template . ' not found'); } diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index 267b793..380744e 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -440,38 +440,32 @@ trait ajaxHelper { $sccpdevice_def = (array)$this->getTableDefaults('sccpdevice', false); $sccpline_def = (array)$this->getTableDefaults('sccpline', false); + // before handling arrays, need to see if deny and permit are set in the request + // if they have been cleared by the users, will not be present + + foreach (['deny','permit'] as $keyVal) { + if (!isset($request[$hdr_arprefix.$keyVal])) { + $tmpArr = $this->convertCsvToArray($this->sccpvalues[$keyVal]['systemdefault']); + if (isset($tmpArr[0]['internal'])) { + $request[$hdr_arprefix.$keyVal][0] = $tmpArr[0]; + } else { + $request[$hdr_arprefix.$keyVal][1]['net'] = $tmpArr[0]['net']; + $request[$hdr_arprefix.$keyVal][1]['mask'] = $tmpArr[0]['mask']; + } + } + } + foreach ($request as $key => $value) { // First handle any arrays as their prefix is part common with normal data + //$netvalue = array(); $key = (str_replace($hdr_arprefix, '', $key, $count_mods)); if ($count_mods) { - $arr_data = ''; - if (!empty($this->sccpvalues[$key])) { - foreach ($value as $valArr) { - foreach ($valArr as $vkey => $vval) { - switch ($vkey) { - case 'inherit': - case 'internal': - if ($vval == 'on') { - $arr_data .= 'internal;'; - } - break; - case 'port': - $arr_data .= ":{$vval}"; - break; - case 'mask': - $arr_data .= "/{$vval}"; - break; - default: - $arr_data .= $vval; - break; - } - } - } - if (!($this->sccpvalues[$key]['data'] == $arr_data)) { - $save_settings[$key] = $this->sccpvalues[$key]; - $save_settings[$key]['data'] = $arr_data; - } - } + // Only arrays : network lists or ip lists. + $save_settings[$key]['keyword'] = $key; + $save_settings[$key]['type'] = $this->sccpvalues[$key]['type']; + $save_settings[$key]['seq'] = $this->sccpvalues[$key]['seq']; + $save_settings[$key]['data'] = $this->convertArrayToCsv($value); + $save_settings[$key]['systemdefault'] = $this->sccpvalues[$key]['systemdefault']; continue; } // Now handle any normal data - arrays will not match as already handled. @@ -500,14 +494,29 @@ trait ajaxHelper { continue 2; } } + } $extSettings = $this->extconfigs->updateTftpStructure(array_merge($this->sccpvalues, $save_settings)); $save_settings = array_merge($save_settings, $extSettings); + //dbug($save_settings); if (!empty($save_settings)) { $this->saveSccpSettings($save_settings); $this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); } + // now add the site defaults from sccpsettings to sccpdevice for permit and deny, so that these will override + foreach (['deny', 'permit'] as $fieldId) { + $output = array(); + foreach ($this->convertCsvToArray($this->sccpvalues[$fieldId]['data']) as $netValue) { + if (isset($netValue['internal'])) { + $output[] = 'internal'; + continue; + } + $output[] = implode('/', $netValue); + } + $dbSaveArray[$fieldId] = array('table' => 'sccpdevice', 'field' => $fieldId, 'Default' => implode(';',$output)); + } + foreach ($dbSaveArray as $key => $rowToSave) { $this->dbinterface->updateTableDefaults($rowToSave['table'], $rowToSave['field'], $rowToSave['Default']); } @@ -697,56 +706,51 @@ trait ajaxHelper { break; default: // handle vendor prefix - if (!empty($get_settings[$hdr_vendPrefix . $key])) { - $value = $get_settings[$hdr_vendPrefix . $key]; + if (!empty($get_settings["${hdr_vendPrefix}${key}"])) { + $value = $get_settings["${hdr_vendPrefix}${key}"]; } // handle array prefix - if (!empty($get_settings[$hdr_arprefix . $key])) { + if (!empty($get_settings["${hdr_arprefix}${key}"])) { + // Only 3 types of array returned permit,deny, setvar $arr_data = ''; $arr_clear = false; - foreach ($get_settings[$hdr_arprefix . $key] as $vkey => $vval) { - $tmp_data = ''; - foreach ($vval as $vkey => $vval) { - switch ($vkey) { - case 'inherit': - if ($vval == 'on') { - $arr_clear = true; - // Злобный ХАК ?!TODO!? - if ($key == 'permit') { - $save_settings['deny'] = 'NONE'; - } - } - break; - case 'internal': - if ($vval == 'on') { - $tmp_data .= 'internal;'; - } - break; - default: - $tmp_data .= $vval . '/'; - break; - } + $output = array(); + foreach ($get_settings["${hdr_arprefix}${key}"] as $netValue) { + switch ($key) { + case 'permit': + case 'deny'; + // Now have an array of settings each with keys net and Mask + // TODO: This needs to be optimised + //foreach ($valueArr as $netValue) { + if (isset($netValue['inherit'])) { + $save_settings['deny'] = 'NONE'; + continue 2; + } + if (isset($netValue['internal'])) { + $output[] = 'internal'; + continue; + } + if (empty($netValue['net'])) { + // empty net so ignored + continue; + } + $netValue['mask'] = (empty($netValue['mask'])) ? "255.255.255.0" : $netValue['mask']; + $output[]= implode('/', $netValue); + //} + break; + case 'setvar': + $output[] = implode(';', $netValue); + break; + // No default case } - if (strlen($tmp_data) > 2) { - while (substr($tmp_data, -1) == '/') { - $tmp_data = substr($tmp_data, 0, -1); - } - $arr_data .= $tmp_data . ';'; - } - } - while (substr($arr_data, -1) == ';') { - $arr_data = substr($arr_data, 0, -1); - } - if ($arr_clear) { - $value = 'NONE'; - } else { - $value = $arr_data; - } - } - // Now only have normal prefix - if (!empty($get_settings["{$hdr_prefix}{$key}"])) { - $value = $get_settings["{$hdr_prefix}{$key}"]; } + $save_settings[$key] = implode(';', $output); + unset($output); + } + // Now only have normal prefix + if (!empty($get_settings["{$hdr_prefix}{$key}"])) { + $value = $get_settings["{$hdr_prefix}{$key}"]; + } } if (!empty($value)) { $save_settings[$key] = $value; @@ -780,7 +784,5 @@ trait ajaxHelper { $search = '?display=sccp_phone'; return array('status' => true, 'message' => $msg, 'reload' => true, 'toastFlag' => $toastFlag, 'search' => $search, 'hash' => $hash); } - } - ?> diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php index a6e4c3a..c8d53c5 100644 --- a/sccpManTraits/helperFunctions.php +++ b/sccpManTraits/helperFunctions.php @@ -3,8 +3,76 @@ namespace FreePBX\modules\Sccp_manager\sccpManTraits; trait helperfunctions { + private function convertCsvToArray($stringToConvert = "") { + // Take a csv string form of net/mask or ip/port and convert to an array + // sub arrays are separated by ";" + $outputArr = array(); + if (empty($stringToConvert)) { + return $outputArr; + } + foreach (explode(";", $stringToConvert) as $value) { + //internal is always the first setting if present + if ($value == 'internal') { + $outputArr[] = array('internal' => 'on'); + continue; + } + // Now handle rest of value types + $subArr = explode("/", $value); + if (count($subArr) === 2) { + // Have net/mask + $outputArr[] = array('net' => $subArr[0], 'mask' => $subArr[1]); + } else { + // have ip:port + $subArr = explode(":", $value); + $outputArr[] = array('ip' => $subArr[0], 'port' => $subArr[1]); + } + } + return $outputArr; + } - function getIpInformation($type = '') { + private function convertArrayToCsv(array $arrayToConvert) { + // About to save to db so need to convert to string + // Take an array form of net mask or ip port and convert to a csv + // sub arrays are separated by ";" + if (empty($arrayToConvert)) { + return ''; + } + $output = array(); + // Internal is always element 0, nets and ips start at element 1. + if ((isset($arrayToConvert[1]['net'])) || (isset($arrayToConvert[0]['internal']))) { + // Have net masks + foreach ($arrayToConvert as $netValue) { + if (isset($netValue['internal'])) { + $output[] = 'internal'; + continue; + } + if (empty($netValue['net'])) { + // If network not set, user error, has added empty row so delete + continue; + } + // If the mask has not been set, set to this subnet + $netValue['mask'] = (empty($netValue['mask'])) ? "255.255.255.0" : $netValue['mask']; + $output[] = implode('/', $netValue); + } + } else { + // Have ip addresses + foreach ($arrayToConvert as $ipArr) { + if (isset($ipArr['internal'])) { + // should not be set for an ip address + continue; + } + if (empty($ipArr['ip'])) { + // If ip not set, user error, has added empty row so delete + continue; + } + $ipArr['port'] = (empty($ipArr['port'])) ? "2000" : $ipArr['port']; + $output[] = implode(':', $ipArr); + } + } + return implode(';', $output); + } + + private function getIpInformation($type = '') { $interfaces = array(); switch ($type) { case 'ip4': @@ -307,15 +375,9 @@ trait helperfunctions { case "allow": case "disallow": case "deny": - $this->sccp_conf_init['general'][$key] = explode(';', $value['data']); - break; case "localnet": case "permit": - $content = $value['data']; - if (strpos($content, 'internal') !== false) { - $content = str_replace(';0.0.0.0/0.0.0.0', '', $value['data']); - } - $this->sccp_conf_init['general'][$key] = explode(';', $content); + $this->sccp_conf_init['general'][$key] = explode(';', $value['data']); break; case "devlang": /*