Had to update a few conditions since the json response is different now
This commit is contained in:
parent
135c1df697
commit
f46c938a12
1 changed files with 3 additions and 3 deletions
|
@ -29,15 +29,15 @@ class Auth_FAS extends AuthPlugin {
|
||||||
$response = json_decode(curl_exec($ch), true);
|
$response = json_decode(curl_exec($ch), true);
|
||||||
curl_close ($ch);
|
curl_close ($ch);
|
||||||
|
|
||||||
if (!isset($response["success"])) {
|
if (!isset($response['person']['id'])) {
|
||||||
error_log("FAS auth failed for $username: incorrect username or password", 0);
|
error_log("FAS auth failed for $username: incorrect username or password", 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$groups = $response["person"]["approved_memberships"];
|
$groups = $response['memberships'];
|
||||||
|
|
||||||
for ($i = 0, $cnt = count($groups); $i < $cnt; $i++) {
|
for ($i = 0, $cnt = count($groups); $i < $cnt; $i++) {
|
||||||
if ($groups[$i]["name"] == "cla_done") {
|
if ($groups[$i]["name"] == 'cla_done' && $response['person']['status'] == 'active') {
|
||||||
error_log("FAS auth succeeded for $username", 0);
|
error_log("FAS auth succeeded for $username", 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue