X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FFKOAuth1.php;h=64ac4e7be54f3272f71ce8a17c65aff233c1f49d;hb=3020b0fdc4f4ccdfc1deccc23b8748066a7c9979;hp=a323f5cd568080cdd9a3a5c17b85fbab2a6a749c;hpb=2bbfc0640f411f99e37d82763ce57af5c0c18bd9;p=friendica.git diff --git a/src/Network/FKOAuth1.php b/src/Network/FKOAuth1.php index a323f5cd56..64ac4e7be5 100644 --- a/src/Network/FKOAuth1.php +++ b/src/Network/FKOAuth1.php @@ -1,18 +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($r)) { - $record = $r; - } else { + 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'); @@ -62,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); } }