Commit f6d1d69c authored by Freddy's avatar Freddy Committed by Luke081515

fix login reason

parent 4b6ef9fc
Pipeline #2153 passed with stages
in 1 minute and 40 seconds
......@@ -237,12 +237,17 @@ class Core extends Password {
"&lgpassword=" . urlencode($this->password) .
"&lgtoken=" . urlencode($lgToken), $this->job);
$result = json_decode($result, true);
$lgResult = $result["login"]["result"];
$lgResult = $result['login']['result'];
// manage result
if ($lgResult == "Success") {
return true;
} else {
throw new Exception("Login failed with message: " . $lgResult);
if(isset($result['login']['reason'])) {
$lgReason = $result['login']['reason'];
} else {
$lgReason = $lgResult;
}
throw new Exception("Login failed with message: " . $lgReason);
}
}
/** logout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment