Skip to content

Commit

Permalink
OAuth Errors now are set to write to error log file
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed Dec 28, 2016
1 parent fc1a5c4 commit 446f94f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions public_html/users.php
Expand Up @@ -895,7 +895,7 @@ function resend_request()
$active_service = (count($modules) == 0) ? false : in_array($_GET['oauth_login'], $modules);
if (!$active_service) {
$status = -1;
COM_errorLog("OAuth login failed - there was no consumer available for the service:" . $_GET['oauth_login']);
COM_errorLog("OAuth login failed - there was no consumer available for the service:" . $_GET['oauth_login'], 1);
} else {
$query = array_merge($_GET, $_POST);
$service = $query['oauth_login'];
Expand All @@ -913,14 +913,15 @@ function resend_request()

$consumer->setRedirectURL($callback_url);
$oauth_userinfo = $consumer->authenticate_user();

if ( $oauth_userinfo === false ) {
COM_updateSpeedlimit('login');
COM_errorLog("OAuth Error: " . $consumer->error);
COM_errorLog("OAuth Error: " . $consumer->error, 1);
COM_redirect($_CONF['site_url'] . '/users.php?msg=111'); // OAuth authentication error
}

if ( $consumer->doAction($oauth_userinfo) == NULL ) {
COM_errorLog("Oauth: Error creating new user in OAuth authentication");
COM_errorLog("Oauth: Error creating new user in OAuth authentication", 1);
COM_redirect($_CONF['site_url'] . '/users.php?msg=111'); // OAuth authentication error
}
}
Expand Down
6 changes: 3 additions & 3 deletions system/classes/oauthhelper.class.php
Expand Up @@ -164,7 +164,7 @@ public function authenticate_user()
$success = $this->client->Finalize($success);
}
if ($_SYSTEM['debug_oauth']) {
COM_errorLog($this->client->debug_output);
COM_errorLog($this->client->debug_output, 1);
}
if ($this->client->exit) {
exit;
Expand Down Expand Up @@ -213,10 +213,10 @@ public function doAction($info)

// remote auth precludes usersubmission, and integrates user activation
$status = USER_ACCOUNT_ACTIVE;

$users = $this->_getCreateUserInfo($info);
$userInfo = $this->_getUpdateUserInfo($info);

$sql = "SELECT uid, status FROM {$_TABLES['users']} "
. "WHERE remoteusername = '" . DB_escapeString($users['remoteusername']) . "' "
. "AND remoteservice = '" . DB_escapeString($users['remoteservice']) . "'";
Expand Down

0 comments on commit 446f94f

Please sign in to comment.