Use "getOwnerDataById" and "getOwnerDataByNick" to fetch owner data
This commit is contained in:
parent
638723ea1c
commit
f0268b57be
6 changed files with 36 additions and 79 deletions
|
@ -34,7 +34,7 @@ use Friendica\DI;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Event;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Module\BaseProfile;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
@ -67,7 +67,7 @@ function cal_init(App $a)
|
|||
return;
|
||||
}
|
||||
|
||||
$a->profile = Profile::getByNickname($nick);
|
||||
$a->profile = User::getOwnerDataByNick($nick);
|
||||
if (empty($a->profile)) {
|
||||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\Post;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\Tag;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Module\BaseProfile;
|
||||
|
@ -73,7 +72,7 @@ function photos_init(App $a) {
|
|||
$a->profile_uid = $user['uid'];
|
||||
$is_owner = (local_user() && (local_user() == $a->profile_uid));
|
||||
|
||||
$profile = Profile::getByNickname($nick);
|
||||
$profile = User::getOwnerDataByNick($nick);
|
||||
|
||||
$account_type = Contact::getAccountType($profile);
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ use Friendica\DI;
|
|||
use Friendica\Model\Attach;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Module\BaseProfile;
|
||||
use Friendica\Security\Security;
|
||||
|
@ -56,7 +55,7 @@ function videos_init(App $a)
|
|||
$a->data['user'] = $user[0];
|
||||
$a->profile_uid = $user[0]['uid'];
|
||||
|
||||
$profile = Profile::getByNickname($nick);
|
||||
$profile = User::getOwnerDataByNick($nick);
|
||||
|
||||
$account_type = Contact::getAccountType($profile);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue