add changeConnectionStatus method
authorStricted <info@stricted.de>
Sun, 28 Jun 2015 02:28:57 +0000 (04:28 +0200)
committerStricted <info@stricted.de>
Sun, 28 Jun 2015 02:28:57 +0000 (04:28 +0200)
speedport.class.php

index 1cf4c7e5eac40c4300061507295cae43e08f0689..36837cef33c7c4b5de695fe0671da36a9d5bb6fd 100644 (file)
@@ -118,6 +118,24 @@ class speedport {
                return $json;
        }
        
+       /**
+        * change dsl connection status
+        *
+        * @param       string  $status
+        */
+       public function changeConnectionStatus ($status) {
+               $url = 'data/Connect.json';
+               
+               if ($status == 'online' || $status == 'offline') {
+                       $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash, 'req_connect' => $status);
+                       $cookie = 'challengev='.$this->challenge.'; '.$this->session;
+                       $this->sentRequest($url, $fields, $cookie);
+               }
+               else {
+                       throw new Exception();
+               }
+       }
+       
        /**
         * return the given json as array
         *