Skip to content

Commit

Permalink
Fixed issue with synch for OAuth User accounts if info not returned
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed May 8, 2020
1 parent c901e58 commit e79e427
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions system/classes/oauthhelper.class.php
Expand Up @@ -272,7 +272,7 @@ public function doAction($info)
if (strlen($loginName) > 16) {
$loginName = substr($loginName, 0, 16);
}

// Remember some database collations are case and accent insensitive and some are not. They would consider "nina", "nina ", "Nina", and, "niña" as the same
$checkName = DB_getItem($_TABLES['users'], 'username', "TRIM(LOWER(username)) = TRIM(LOWER('" . DB_escapeString($loginName) . "'))");
if (!empty($checkName) || empty($loginName)) { // also if for some reason blank login name we should create one
Expand Down Expand Up @@ -330,9 +330,12 @@ public function doSynch($info)
}
$updateColumns .= "homepage='" . DB_escapeString($users['homepage']) . "'";
}
$sql = $sql . $updateColumns . " WHERE uid=" . (int) $_USER['uid'];

DB_query($sql);
if (!empty($updateColumns)) {
$sql = $sql . $updateColumns . " WHERE uid=" . (int) $_USER['uid'];

DB_query($sql);
}

// Update rest of users info
$this->_DBupdate_users($_USER['uid'], $users);
Expand Down

0 comments on commit e79e427

Please sign in to comment.