Skip to content

Commit

Permalink
Joomla 3.x JAuthentication status
Browse files Browse the repository at this point in the history
  • Loading branch information
dcapslock committed Jun 21, 2018
1 parent a7b4e48 commit 3416234
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crowd/crowd.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function doCrowdLogin( $credentials, $options, &$response )
$result = $http->get($request_url, $request_header);
JLog::add('cookie config: ' . var_export($result, true));
if (!$result or $result->code != 200) {
$response->status = JAUTHENTICATE_STATUS_FAILURE;
$response->status = JAuthentication::STATUS_FAILURE;
$response->error_message = 'Cannot fetch cookie config from crowd';
return false;
}
Expand Down Expand Up @@ -171,7 +171,7 @@ function doCrowdLogin( $credentials, $options, &$response )
JLog::add('response: ' . var_export($result, true));
if (!$result or $result->code != 201) {
JLog::add('have not got expected code 201, login failed');
$response->status = JAUTHENTICATE_STATUS_FAILURE;
$response->status = JAuthentication::STATUS_FAILURE;
$response->error_message = 'Login to crowd failed';
return false;
}
Expand All @@ -180,7 +180,7 @@ function doCrowdLogin( $credentials, $options, &$response )
JLog::add('response: ' . var_export($result, true));
if (!$result or $result->code != 200) {
JLog::add('have not got expected code 200, login failed');
$response->status = JAUTHENTICATE_STATUS_FAILURE;
$response->status = JAuthentication::STATUS_FAILURE;
$response->error_message = 'Login to crowd failed';
return false;
}
Expand All @@ -192,7 +192,7 @@ function doCrowdLogin( $credentials, $options, &$response )
$response->email = (string) $xml->user->email;
$response->fullname = (string) $xml->user->{'display-name'};
$response->username = (string) $xml->user['name'];
$response->status = JAUTHENTICATE_STATUS_SUCCESS;
$response->status = JAuthentication::STATUS_SUCCESS;
$response->error_message = '';
JLog::add('login successfull, returning: ' . var_export($response, true));

Expand Down Expand Up @@ -223,7 +223,7 @@ function handleGroups( $user, $credentials, $options, &$response )
$result = $http->get($request_url, $request_header);
JLog::add('group config: ' . var_export($result, true));
if (!$result or $result->code != 200) {
$response->status = JAUTHENTICATE_STATUS_FAILURE;
$response->status = JAuthentication::STATUS_FAILURE;
$response->error_message = 'Cannot fetch groups from crowd';
return false;
}
Expand Down

0 comments on commit 3416234

Please sign in to comment.