X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FFKOAuth1.php;h=64ac4e7be54f3272f71ce8a17c65aff233c1f49d;hb=69e7c7fecac5d315930c52bfa9fb21954dcf8b5e;hp=ce2d4a6b8bb382f47701c13a7d27ba0c3447442c;hpb=82df294e31a938ede7b5374d53094c1b7034df29;p=friendica.git diff --git a/src/Network/FKOAuth1.php b/src/Network/FKOAuth1.php index ce2d4a6b8b..64ac4e7be5 100644 --- a/src/Network/FKOAuth1.php +++ b/src/Network/FKOAuth1.php @@ -1,21 +1,17 @@ $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1), array('limit' => 1)); + $record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]); - if (!DBM::is_result($record)) { + if (!DBA::isResult($record)) { logger('FKOAuth1::loginUser failure: ' . print_r($_SERVER, true), LOGGER_DEBUG); header('HTTP/1.0 401 Unauthorized'); die('This api requires login'); @@ -63,16 +59,15 @@ class FKOAuth1 extends OAuthServer $a->timezone = $a->user['timezone']; } - $r = dba::select('contact', array(), array('uid' => $_SESSION['uid'], 'self' => 1), array('limit' => 1)); - - if (DBM::is_result($r)) { - $a->contact = $r; - $a->cid = $r['id']; + $contact = DBA::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => 1]); + if (DBA::isResult($contact)) { + $a->contact = $contact; + $a->cid = $contact['id']; $_SESSION['cid'] = $a->cid; } - dba::update('user', ['login_date' => datetime_convert()], ['uid' => $_SESSION['uid']]); + DBA::update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $_SESSION['uid']]); - call_hooks('logged_in', $a->user); + Addon::callHooks('logged_in', $a->user); } }