mirror of
https://github.com/friendica/friendica
synced 2025-04-24 17:50:11 +00:00
Move mod/receive to src/Module/Diaspora/receive
- Added routes - Make Diaspora::decode(Raw) more explicit - Add new User::getByGuid() method
This commit is contained in:
parent
49c05036ae
commit
7716374593
6 changed files with 182 additions and 103 deletions
|
@ -18,7 +18,6 @@ use Friendica\Core\Protocol;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\TwoFactor\AppSpecificPassword;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\Crypto;
|
||||
|
@ -105,6 +104,27 @@ class User
|
|||
return DBA::selectFirst('user', $fields, ['uid' => $uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a user record based on it's GUID
|
||||
*
|
||||
* @param string $guid The guid of the user
|
||||
* @param array $fields The fields to retrieve
|
||||
* @param bool $active True, if only active records are searched
|
||||
*
|
||||
* @return array|boolean User record if it exists, false otherwise
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getByGuid(string $guid, array $fields = [], bool $active = true)
|
||||
{
|
||||
if ($active) {
|
||||
$cond = ['guid' => $guid, 'account_expired' => false, 'account_removed' => false];
|
||||
} else {
|
||||
$cond = ['guid' => $guid];
|
||||
}
|
||||
|
||||
return DBA::selectFirst('user', $fields, $cond);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $nickname
|
||||
* @param array $fields
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue