* @param integer $count
* @return array
*/
- private function sentRequest ($path, $fields, $cookie = false, $count = 0) {
+ private function sendRequest ($path, $fields, $cookie = false, $count = 0) {
$url = $this->url.$path.'?lang=en';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
if ($status == 'online' || $status == 'offline') {
$fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash, 'req_connect' => $status);
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ($data['status'] == 'ok') {
else if ($status == 'no') $status = '0';
$fields = array('csrf_token' => $this->token, 'use_lte' => $status);
- $data = $this->sentEncryptedRequest($path, $fields, true);
+ $data = $this->sendEncryptedRequest($path, $fields, true);
// debug only
return $data;
$path = 'data/modules.json';
$fields = array('csrf_token' => $this->token, 'lte_reconn' => '1');
- $data = $this->sentEncryptedRequest($path, $fields, true);
+ $data = $this->sendEncryptedRequest($path, $fields, true);
return $data['body'];
}
* @param string $cookie
* @return array
*/
- private function sentEncryptedRequest ($path, $fields, $cookie = false) {
+ private function sendEncryptedRequest ($path, $fields, $cookie = false) {
$count = count($fields);
$fields = $this->encrypt(http_build_query($fields));
- return $this->sentRequest($path, $fields, $cookie, $count);
+ return $this->sendRequest($path, $fields, $cookie, $count);
}
/**
'deleteEntry' => 'delete'
);
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ($data['status'] == 'ok') {
$path = 'data/Login.json';
$this->hash = hash('sha256', $this->challenge.':'.$password);
$fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash);
- $data = $this->sentRequest($path, $fields);
+ $data = $this->sendRequest($path, $fields);
$json = $this->getValues($data['body']);
if (isset($json['login']) && $json['login'] == 'success') {
private function getChallenge () {
$path = 'data/Login.json';
$fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'challengev' => 'null');
- $data = $this->sentRequest($path, $fields);
+ $data = $this->sendRequest($path, $fields);
$data = $this->getValues($data['body']);
if (isset($data['challengev']) && !empty($data['challengev'])) {
$path = 'data/SecureStatus.json';
$fields = array();
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ($data['loginstate'] != 1) {
$path = 'data/Login.json';
$fields = array('csrf_token' => $this->token, 'logout' => 'byby');
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ((isset($data['status']) && $data['status'] == 'ok') && $this->checkLogin(false) === false) {
// reset challenge and session
$path = 'html/content/overview/index.html';
$fields = array();
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$a = explode('csrf_token = "', $data['body']);
$a = explode('";', $a[1]);
'phonebook_number_m' => $mobile
);
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ($data['status'] == 'ok') {
'deleteEntry' => 'delete'
);
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ($data['status'] == 'ok') {
$path = 'data/'.$file.'.json';
$fields = array();
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
return $data['body'];
}
$path = 'data/resetAllSetting.json';
$fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash, 'reset_all' => 'true');
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
return $data['body'];
}
$path = 'data/checkfirmware.json';
$fields = array('checkfirmware' => 'true');
- $data = $this->sentRequest($path, $fields, true);
+ $data = $this->sendRequest($path, $fields, true);
return $data['body'];
}
$path = 'data/Reboot.json';
$fields = array('csrf_token' => $this->token, 'reboot_device' => 'true');
- $data = $this->sentEncryptedRequest($path, $fields, true);
+ $data = $this->sendEncryptedRequest($path, $fields, true);
$data = $this->getValues($data['body']);
if ($data['status'] == 'ok') {