Commit 3b086446 authored by Luke081515's avatar Luke081515

Merge branch '99-login-error' into 'master'

Resolve "Login error"

Closes #99

See merge request !105
parents 4b6ef9fc f6d1d69c
Pipeline #2178 passed with stages
in 3 minutes
......@@ -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