From: Stricted Date: Sun, 26 Jul 2015 23:22:52 +0000 (+0200) Subject: add lanDeviceOverview X-Git-Tag: 1.0.5~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e559c2bbfddcc84c380cb2e4007eb66954d95d24;p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git add lanDeviceOverview --- diff --git a/SpeedportHybrid.class.php b/SpeedportHybrid.class.php index 534d323..bbd9146 100644 --- a/SpeedportHybrid.class.php +++ b/SpeedportHybrid.class.php @@ -5,6 +5,7 @@ require_once('CryptLib/CryptLib.php'); require_once('lib/trait/Connection.class.php'); require_once('lib/trait/CryptLib.class.php'); require_once('lib/trait/Login.class.php'); +require_once('lib/trait/Network.class.php'); require_once('lib/trait/Phone.class.php'); require_once('lib/trait/System.class.php'); @@ -17,6 +18,7 @@ class SpeedportHybrid { use Connection; use CryptLib; use Login; + use Network; use Phone; use System; diff --git a/lib/trait/Network.class.php b/lib/trait/Network.class.php new file mode 100644 index 0000000..0c22a8d --- /dev/null +++ b/lib/trait/Network.class.php @@ -0,0 +1,24 @@ + + * @copyright 2015 Jan Altensen (Stricted) + */ +trait Network { + /** + * get all devices in network + * + * @return array + */ + public function lanDeviceOverview () { + $data = $this->getData('LAN'); + $data = $this->getValues($data); + + if (isset($data['addmdevice'])) { + return $data['addmdevice']; + } + else { + return array(); + } + } +} diff --git a/lib/trait/Phone.class.php b/lib/trait/Phone.class.php index 8799221..a30f940 100644 --- a/lib/trait/Phone.class.php +++ b/lib/trait/Phone.class.php @@ -38,8 +38,7 @@ trait Phone { $this->checkLogin(); $path = 'data/PhoneBook.json'; - $fields = array( - 'csrf_token' => $this->token, + $fields = array('csrf_token' => $this->token, 'id' => $id, 'search' => '', 'phonebook_name' => $name, @@ -87,8 +86,7 @@ trait Phone { $this->checkLogin(); $path = 'data/PhoneBook.json'; - $fields = array( - 'csrf_token' => $this->token, + $fields = array('csrf_token' => $this->token, 'id' => $id, 'deleteEntry' => 'delete' );