Skip to content

Commit

Permalink
code grooming
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodim99 committed Dec 1, 2017
1 parent 8dd6b44 commit 9835985
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cms/include/classes/Cetera/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ public static function getExternal($network, $id)
}

$data = self::getDbConnection()->fetchAssoc( 'SELECT A.* FROM '.User::TABLE.' A LEFT JOIN users_external B ON (A.id = B.user_id) WHERE B.external_id = ? and B.external_type = ?', array( $id, $network ) );
if (!$data)
{
if (!$data) {
// пробуем найти по старой схеме
try {
$data = self::getDbConnection()->fetchAssoc( 'SELECT * FROM '.User::TABLE.' WHERE external_id=? and external=?', array( $id, $network ) );
if ($data)
{
if ($data) {
$u = User::fetch($data);
$u->addExternal( $network, $id );
} else {
Expand Down

0 comments on commit 9835985

Please sign in to comment.