X-Git-Url: https://git.stricted.de/?p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git;a=blobdiff_plain;f=speedport.class.php;fp=speedport.class.php;h=90f5c32154dc8658d5337baf6a07d1443d6d987f;hp=692b7c31647a148f0489ddf6ea6ea3cb9fdfa17e;hb=4ae464d153f5f08a023f1421babf7cd7fd683916;hpb=dae16c50daa8b58cfede18e9cd3c1a9fd9333132 diff --git a/speedport.class.php b/speedport.class.php index 692b7c3..90f5c32 100644 --- a/speedport.class.php +++ b/speedport.class.php @@ -247,7 +247,7 @@ class speedport { $fields = array('exporttype' => '3'); $cookie = 'challengev='.$this->challenge.'; '.$this->session; $data = $this->sentRequest($path, $fields, $cookie); - + print_r($data); if (empty($data['body'])) { throw new Exception('unable to get syslog data'); } @@ -255,6 +255,26 @@ class speedport { return explode("\n", $data['body']); } + /** + * check if firmware is actual + * + * @return array + */ + public function checkFirmware () { + $path = 'data/checkfirmware.json'; + $fields = array('checkfirmware' => 'true'); + $cookie = 'challengev='.$this->challenge.'; '.$this->session; + $data = $this->sentRequest($path, $fields, $cookie); + + if (empty($data['body'])) { + throw new Exception('unable to get checkfirmware data'); + } + + $json = json_decode($data['body'], true); + + return $json; + } + /** * sends the request to router *