add lanDeviceOverview
authorStricted <info@stricted.de>
Sun, 26 Jul 2015 23:22:52 +0000 (01:22 +0200)
committerStricted <info@stricted.de>
Sun, 26 Jul 2015 23:22:52 +0000 (01:22 +0200)
SpeedportHybrid.class.php
lib/trait/Network.class.php [new file with mode: 0644]
lib/trait/Phone.class.php

index 534d32309e3c27b3893f0b8e277873f7f311fef7..bbd91462c635aa203bc8338e5e2b505920d61ecd 100644 (file)
@@ -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 (file)
index 0000000..0c22a8d
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @author      Jan Altensen (Stricted)
+ * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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();
+               }
+       }
+}
index 8799221fcd4ba479806c3509abe41a4cba583086..a30f9401e8cbadc6479af0047d435e556977b358 100644 (file)
@@ -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'
                                                );