From a2bacc49116d44aee2c3d294dbfa8985a06b4a62 Mon Sep 17 00:00:00 2001 From: Stricted Date: Sat, 17 Jun 2017 15:18:29 +0200 Subject: [PATCH] fix login logic --- lib/trait/Login.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/trait/Login.class.php b/lib/trait/Login.class.php index 0bb3045..737106c 100644 --- a/lib/trait/Login.class.php +++ b/lib/trait/Login.class.php @@ -49,8 +49,7 @@ trait Login { $fields = array('csrf_token' => 'nulltoken', "challengev" => $this->challenge, 'showpw' => 0, 'password' => $this->hash); $data = $this->sendRequest($path, $fields); $json = $this->getValues($data['body']); - - if (in_array("challenge", $json)) { + if (!in_array("challenge", $json)) { $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash); $data = $this->sendRequest($path, $fields); $json = $this->getValues($data['body']); @@ -93,10 +92,9 @@ trait Login { * Requests the password-challenge from the router. */ private function getChallenge () { - $path = 'html/content/overview/index.html'; + $path = 'html/login/index.html'; $fields = array(); - $data = $this->sendRequest($path, $fields, true); - + $data = $this->sendRequest($path, $fields); $a = explode('challenge = "', $data['body']); if (!isset($a[1])) { -- 2.20.1