|
@@ -112,6 +112,8 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
if($this->isCurrentRoute('edit')) {
|
|
if($this->isCurrentRoute('edit')) {
|
|
|
|
|
|
if($this->getParameter('tr069_service')) {
|
|
if($this->getParameter('tr069_service')) {
|
|
|
|
+ $serviceName = $this->getParameter('tr069_api');
|
|
|
|
+ $tr069 = $this->get($serviceName);
|
|
$object = $this->getSubject();
|
|
$object = $this->getSubject();
|
|
|
|
|
|
$query = array('$or' => array());
|
|
$query = array('$or' => array());
|
|
@@ -131,11 +133,11 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- $devices = $this->get('tr069.api')->getDevices($query);
|
|
|
|
|
|
+ $devices = $tr069->getDevices($query);
|
|
|
|
|
|
if(is_array($devices) && isset($devices[0]) && isset($devices[0]['_id'])) {
|
|
if(is_array($devices) && isset($devices[0]) && isset($devices[0]['_id'])) {
|
|
|
|
|
|
- $tr069Data = $this->getTR069Data($devices[0]);
|
|
|
|
|
|
+ $tr069Data = $tr069->getTR069Data($devices[0]);
|
|
|
|
|
|
$id = $tr069Data['_id'] ?? null;
|
|
$id = $tr069Data['_id'] ?? null;
|
|
$manufacturer = $tr069Data['_deviceId']['_Manufacturer'] ?? null;
|
|
$manufacturer = $tr069Data['_deviceId']['_Manufacturer'] ?? null;
|
|
@@ -258,6 +260,8 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
->end();
|
|
->end();
|
|
|
|
|
|
if($this->getParameter('tr069_service')) {
|
|
if($this->getParameter('tr069_service')) {
|
|
|
|
+ $serviceName = $this->getParameter('tr069_api');
|
|
|
|
+ $tr069 = $this->get($serviceName);
|
|
$object = $this->getSubject();
|
|
$object = $this->getSubject();
|
|
|
|
|
|
$query = array('$or' => array());
|
|
$query = array('$or' => array());
|
|
@@ -276,11 +280,11 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
$query['$or'][] = array("InternetGatewayDevice.DeviceInfo.SerialNumber" => strtolower($object->getPonSerialNumberAux()));
|
|
$query['$or'][] = array("InternetGatewayDevice.DeviceInfo.SerialNumber" => strtolower($object->getPonSerialNumberAux()));
|
|
}
|
|
}
|
|
|
|
|
|
- $devices = $this->get('tr069.api')->getDevices($query);
|
|
|
|
|
|
+ $devices = $tr069->getDevices($query);
|
|
|
|
|
|
if(is_array($devices) && isset($devices[0]) && isset($devices[0]['_id'])) {
|
|
if(is_array($devices) && isset($devices[0]) && isset($devices[0]['_id'])) {
|
|
|
|
|
|
- $tr069Data = $this->getTR069Data($devices[0]);
|
|
|
|
|
|
+ $tr069Data = $tr069->getTR069Data($devices[0]);
|
|
|
|
|
|
$id = $tr069Data['_id'] ?? null;
|
|
$id = $tr069Data['_id'] ?? null;
|
|
$manufacturer = $tr069Data['_deviceId']['_Manufacturer'] ?? null;
|
|
$manufacturer = $tr069Data['_deviceId']['_Manufacturer'] ?? null;
|
|
@@ -371,13 +375,16 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
$broadcast = ($this->getForm()->get('tr069_broadcast')->getData()) ?? null;
|
|
$broadcast = ($this->getForm()->get('tr069_broadcast')->getData()) ?? null;
|
|
$status = ($this->getForm()->get('tr069_status')->getData()) ?? null;
|
|
$status = ($this->getForm()->get('tr069_status')->getData()) ?? null;
|
|
|
|
|
|
- if($ssid) $aux = $this->get('tr069.api')->setWlan($id, $ssid, $pass);
|
|
|
|
|
|
+ $serviceName = $this->getParameter('tr069_api');
|
|
|
|
+ $tr069 = $this->get($serviceName);
|
|
|
|
+
|
|
|
|
+ if($ssid) $aux = $tr069->setWlan($id, $ssid, $pass);
|
|
|
|
|
|
- if(!is_null($catv)) $aux = $this->get('tr069.api')->setCATV($id, $catv);
|
|
|
|
|
|
+ if(!is_null($catv)) $aux = $tr069->setCATV($id, $catv);
|
|
|
|
|
|
- if(!is_null($broadcast)) $aux = $this->get('tr069.api')->setWbroadcast($id, $broadcast);
|
|
|
|
|
|
+ if(!is_null($broadcast)) $aux = $tr069->setWbroadcast($id, $broadcast);
|
|
|
|
|
|
- if(!is_null($status)) $aux = $this->get('tr069.api')->setWstatus($id, $status);
|
|
|
|
|
|
+ if(!is_null($status)) $aux = $tr069->setWstatus($id, $status);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -479,31 +486,6 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return parent::update($object);
|
|
return parent::update($object);
|
|
- }
|
|
|
|
-
|
|
|
|
- private function getTR069Data($data) {
|
|
|
|
- $result = array();
|
|
|
|
-
|
|
|
|
- $result['_id'] = $data['_id'] ?? null;
|
|
|
|
- $result['_deviceId'] = $data['_deviceId'] ?? null;
|
|
|
|
-
|
|
|
|
- $result['SSID'] = $data['InternetGatewayDevice']['LANDevice']['1']['WLANConfiguration']['1']['SSID'] ?? null;
|
|
|
|
- $result['keyPassphrase'] = $data['InternetGatewayDevice']['LANDevice']['1']['WLANConfiguration']['1']['KeyPassphrase'] ?? null;
|
|
|
|
- $result['SSIDAdvertisementEnabled'] = $data['InternetGatewayDevice']['LANDevice']['1']['WLANConfiguration']['1']['SSIDAdvertisementEnabled'] ?? null;
|
|
|
|
- $result['Status'] = $data['InternetGatewayDevice']['LANDevice']['1']['WLANConfiguration']['1']['Enable'] ?? null;
|
|
|
|
-
|
|
|
|
- //InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.PreSharedKey
|
|
|
|
- $result['preSharedKey'] = $data['InternetGatewayDevice']['LANDevice']['1']['WLANConfiguration']['1']['PreSharedKey']['1']['PreSharedKey'] ?? null;
|
|
|
|
-
|
|
|
|
- $result['CatvPower'] = $data['InternetGatewayDevice']['VS_AppCfg']['VsCatvCfg']['CatvPower'] ?? null;
|
|
|
|
- $result['ExternalIPAddress'] = $data['InternetGatewayDevice']['WANDevice']['1']['WANConnectionDevice']['1']['WANPPPConnection']['1']['ExternalIPAddress'] ?? null;
|
|
|
|
-
|
|
|
|
- return $result;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|