fix login logic again
authorStricted <info@stricted.net>
Sat, 17 Jun 2017 13:48:32 +0000 (15:48 +0200)
committerStricted <info@stricted.net>
Sat, 17 Jun 2017 13:48:32 +0000 (15:48 +0200)
lib/trait/Login.class.php

index 737106c5042e6318f80b20aff9f255e9bf752336..bfbb276635c491ecc73d4a9066135c334e79ac1e 100644 (file)
@@ -49,12 +49,11 @@ 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 (array_key_exists("challengev", $json)) {
                        $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash);
                        $data = $this->sendRequest($path, $fields);
                        $json = $this->getValues($data['body']);
                }
-               
                if (isset($json['login']) && $json['login'] == 'success') {
                        $this->cookie = $this->getCookie($data);