implement non-authenticated default status
[linksys-wrt3g-tools.git] / Wrt3g.php
index 2fe0db850fb7a68e1adcf978261c8c1cb495be71..07a68216de4fa3bbb47701302d76cf6520a6dca1 100644 (file)
--- a/Wrt3g.php
+++ b/Wrt3g.php
@@ -145,14 +145,40 @@ class Wrt3g
 
 
     /**
-     * Retrieves status information about the router
+     * Retrieves basic connection status information about the router
      *
      * @return array Array with several key-value pairs
      *               connection => connecting, disconnected, connected
      *
-     * @throws Exception When the router can't be reached, or unauthorized
+     * @throws Exception When the router can't be reached
      */
     public function getConnectionStatus()
+    {
+        return array_intersect_key(
+            $this->loadStatus_NoAuth(),
+            array(
+                'connection'      => 0,
+                'type'            => 0,
+                'network'         => 0,
+                'signal strength' => 0,
+                'connection time' => 0,
+                'session usage'   => 0
+            )
+        );
+    }
+
+
+
+    /**
+     * Retrieves connection status information about the router.
+     * Uses pages that can only be reached with authentication.
+     *
+     * @return array Array with several key-value pairs
+     *               connection => connecting, disconnected, connected
+     *
+     * @throws Exception When the router can't be reached, or unauthorized
+     */
+    public function getConnectionStatusAuth()
     {
         $arRetval = array();