From 87026df30731d9ccc450842b9825c46d28bea1ac Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 28 Jun 2015 04:28:57 +0200 Subject: [PATCH] add changeConnectionStatus method --- speedport.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/speedport.class.php b/speedport.class.php index 1cf4c7e..36837ce 100644 --- a/speedport.class.php +++ b/speedport.class.php @@ -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 * -- 2.20.1