3 * @author Jan Altensen (Stricted)
4 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
5 * @copyright 2015 Jan Altensen (Stricted)
9 * get uptime based on online (connection) time
13 public function getUptime () {
14 $data = $this->getData('LAN');
15 $data = $this->getValues($data);
17 return $data['days_online'];
21 * return the given json as array
26 public function getData ($file) {
27 if ($file != 'Status') $this->checkLogin();
29 $path = 'data/'.$file.'.json';
31 $data = $this->sentRequest($path, $fields, true);
37 * get the router syslog
41 public function getSyslog() {
42 $data = $this->getData('SystemMessages');
43 $data = $this->getValues($data);
45 if (isset($data['addmessage'])) {
46 return $data['addmessage'];
54 * reset the router to Factory Default
59 public function resetToFactoryDefault () {
62 $path = 'data/resetAllSetting.json';
63 $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash
, 'reset_all' => 'true');
64 $data = $this->sentRequest($path, $fields, true);
71 * check if firmware is actual
75 public function checkFirmware () {
78 $path = 'data/checkfirmware.json';
79 $fields = array('checkfirmware' => 'true');
80 $data = $this->sentRequest($path, $fields, true);