$adminlist = explode(',', str_replace(' ', '', $admin_email));
- return local_user() && $admin_email && DBA::exists('user', ['uid' => $a->getUserId(), 'email' => $adminlist]);
+ return local_user() && $admin_email && DBA::exists('user', ['uid' => $a->getLoggedInUserId(), 'email' => $adminlist]);
}
/**
DI::profiler()->startRecording('rendering');
$o = '';
- $user = User::getById($a->getUserId(), ['uid', 'nickname', 'allow_location', 'default-location']);
+ $user = User::getById($a->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']);
$x['allow_location'] = $x['allow_location'] ?? $user['allow_location'];
$x['default_location'] = $x['default_location'] ?? $user['default-location'];
$fminute = !empty($orig_event) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'i') : '00';
if (!$cid && in_array($mode, ['new', 'copy'])) {
- $acl = ACL::getFullSelectorHTML(DI::page(), $a->getUserId(), false, ACL::getDefaultUserPermissions($orig_event));
+ $acl = ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), false, ACL::getDefaultUserPermissions($orig_event));
} else {
$acl = '';
}
{
$return_path = 'follow?url=' . urlencode($url);
- $result = Contact::createFromProbeForUser($a->getUserId(), $url);
+ $result = Contact::createFromProbeForUser($a->getLoggedInUserId(), $url);
if ($result['success'] == false) {
// Possibly it is a remote item and not an account
$probed = Contact::getByURL($url);
if (in_array($probed['network'], Protocol::FEDERATED)) {
- $result = Contact::createFromProbeForUser($a->getUserId(), $probed['url']);
+ $result = Contact::createFromProbeForUser($a->getLoggedInUserId(), $probed['url']);
if ($result['success']) {
$o .= ' - ' . DI::l10n()->t('success');
} else {
$tpl = Renderer::getMarkupTemplate('photos_upload.tpl');
- $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML(DI::page(), $a->getUserId()));
+ $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId()));
$o .= Renderer::replaceMacros($tpl,[
'$pagename' => DI::l10n()->t('Upload Photos'),
'$albumselect' => $albumselect,
'$permissions' => DI::l10n()->t('Permissions'),
'$aclselect' => $aclselect_e,
- '$lockstate' => ACL::getLockstateForUserId($a->getUserId()) ? 'lock' : 'unlock',
+ '$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
'$alt_uploader' => $ret['addon_text'],
'$default_upload_box' => ($ret['default_upload'] ? $default_upload_box : ''),
'$default_upload_submit' => ($ret['default_upload'] ? $default_upload_submit : ''),
$album_e = $ph[0]['album'];
$caption_e = $ph[0]['desc'];
- $aclselect_e = ACL::getFullSelectorHTML(DI::page(), $a->getUserId(), false, ACL::getDefaultUserPermissions($ph[0]));
+ $aclselect_e = ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), false, ACL::getDefaultUserPermissions($ph[0]));
$edit = Renderer::replaceMacros($edit_tpl, [
'$id' => $ph[0]['id'],
DI::emailer()->send($email);
}
- if (User::getIdFromPasswordAuthentication($a->getUserId(), trim($_POST['qxz_password']))) {
- User::remove($a->getUserId());
+ if (User::getIdFromPasswordAuthentication($a->getLoggedInUserId(), trim($_POST['qxz_password']))) {
+ User::remove($a->getLoggedInUserId());
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
$o .= "<p>".DI::l10n()->t("Keep this window open until done.")."</p>";
- Contact::createFromProbeForUser($a->getUserId(), $r[0]["url"]);
+ Contact::createFromProbeForUser($a->getLoggedInUserId(), $r[0]["url"]);
DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="1; URL=' . DI::baseUrl() . '/repair_ostatus?counter='.$counter.'">';
return;
}
- $user = User::getById($a->getUserId());
+ $user = User::getById($a->getLoggedInUserId());
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] == 'connectors')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/connectors', 'settings_connectors');
return;
}
- $user = User::getById($a->getUserId());
+ $user = User::getById($a->getLoggedInUserId());
$username = $user['username'];
$email = $user['email'];
'$cntunkmail' => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail , DI::l10n()->t("\x28to prevent spam abuse\x29")],
'$group_select' => Group::displayGroupSelection(local_user(), $user['def_gid']),
'$permissions' => DI::l10n()->t('Default Post Permissions'),
- '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->getUserId()),
+ '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId()),
'$expire' => [
'label' => DI::l10n()->t('Expiration settings'),
* Fetch the user id
* @return int
*/
- public function getUserId()
+ public function getLoggedInUserId()
{
return $this->user_id;
}
*/
public static function getFormSecurityToken($typename = '')
{
- $user = User::getById(DI::app()->getUserId(), ['guid', 'prvkey']);
+ $user = User::getById(DI::app()->getLoggedInUserId(), ['guid', 'prvkey']);
$timestamp = time();
$sec_hash = hash('whirlpool', ($user['guid'] ?? '') . ($user['prvkey'] ?? '') . session_id() . $timestamp . $typename);
$max_livetime = 10800; // 3 hours
- $user = User::getById(DI::app()->getUserId(), ['guid', 'prvkey']);
+ $user = User::getById(DI::app()->getLoggedInUserId(), ['guid', 'prvkey']);
$x = explode('.', $hash);
if (time() > (intval($x[0]) + $max_livetime)) {
$nav['usermenu'][] = ['notes/', DI::l10n()->t('Personal notes'), '', DI::l10n()->t('Your personal notes')];
// user info
- $contact = DBA::selectFirst('contact', ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'], ['uid' => $a->getUserId(), 'self' => true]);
+ $contact = DBA::selectFirst('contact', ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'], ['uid' => $a->getLoggedInUserId(), 'self' => true]);
$userinfo = [
'icon' => Contact::getMicro($contact),
'name' => $contact['name'],
$private = !empty($_POST['private']) ? Model\Item::PRIVATE : Model\Item::PUBLIC;
- $user = Model\User::getById($a->getUserId());
+ $user = Model\User::getById($a->getLoggedInUserId());
$allow_cid = ($private ? '<' . $contact['id']. '>' : $user['allow_cid']);
$allow_gid = ($private ? '' : $user['allow_gid']);
$deny_cid = ($private ? '' : $user['deny_cid']);
}
$x = [
- 'lockstate' => self::$groupId || self::$forumContactId || self::$network || ACL::getLockstateForUserId($a->getUserId()) ? 'lock' : 'unlock',
- 'acl' => ACL::getFullSelectorHTML(DI::page(), $a->getUserId(), true, $default_permissions),
+ 'lockstate' => self::$groupId || self::$forumContactId || self::$network || ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
+ 'acl' => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), true, $default_permissions),
'bang' => ((self::$groupId || self::$forumContactId || self::$network) ? '!' : ''),
'content' => $content,
];
}
$uid = local_user();
- $orig_record = User::getById(DI::app()->getUserId());
+ $orig_record = User::getById(DI::app()->getLoggedInUserId());
if (Session::get('submanage')) {
$user = User::getById(Session::get('submanage'));
'$jotplugins' => $jotplugins,
'$rand_num' => Crypto::randomDigits(12),
- '$acl_selector' => ACL::getFullSelectorHTML(DI::page(), $a->getUserId(), $doesFederate, [
+ '$acl_selector' => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), $doesFederate, [
'allow_cid' => $contact_allow_list,
'allow_gid' => $group_allow_list,
'deny_cid' => $contact_deny_list,
'allow_location' => ($is_owner || $commvisitor) && $profile['allow_location'],
'default_location' => $is_owner ? $profile['default-location'] : '',
'nickname' => $profile['nickname'],
- 'acl' => $is_owner ? ACL::getFullSelectorHTML(DI::page(), $a->getUserId(), true) : '',
+ 'acl' => $is_owner ? ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), true) : '',
'visitor' => $is_owner || $commvisitor ? 'block' : 'none',
'profile_uid' => $profile['uid'],
];
Session::set('2fa', true);
info(DI::l10n()->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
- DI::auth()->setForUser($a, User::getById($a->getUserId()), true, true);
+ DI::auth()->setForUser($a, User::getById($a->getLoggedInUserId()), true, true);
} else {
notice(DI::l10n()->t('Invalid code, please retry.'));
}
}
// Resume normal login workflow
- DI::auth()->setForUser($a, User::getById($a->getUserId()), true, true);
+ DI::auth()->setForUser($a, User::getById($a->getLoggedInUserId()), true, true);
} else {
self::$errors[] = DI::l10n()->t('Invalid code, please retry.');
}
'value' => ['profile_field[' . $profileField->id . '][value]', DI::l10n()->t('Value:'), $profileField->value],
'acl' => ACL::getFullSelectorHTML(
DI::page(),
- $a->getUserId(),
+ $a->getLoggedInUserId(),
false,
$defaultPermissions,
['network' => Protocol::DFRN],
'value' => ['profile_field[new][value]', DI::l10n()->t('Value:')],
'acl' => ACL::getFullSelectorHTML(
DI::page(),
- $a->getUserId(),
+ $a->getLoggedInUserId(),
false,
['allow_cid' => []],
['network' => Protocol::DFRN],
{
public function __construct(App $a, L10n $l10n, BaseURL $baseUrl, array $item, string $toAddress, string $authorThumb)
{
- $user = User::getById($a->getUserId());
+ $user = User::getById($a->getLoggedInUserId());
$disclaimer = '<hr />' . $l10n->t('This message was sent to you by %s, a member of the Friendica social network.', $user['username'])
. '<br />';
return '';
}
- $owner = User::getOwnerDataById($a->getUserId());
+ $owner = User::getOwnerDataById($a->getLoggedInUserId());
if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
return '';
// this isn't optimal because the contact query will be done now twice
$fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'];
if ($a->isLoggedIn()) {
- $remoteUser = Contact::selectFirst($fields, ['uid' => $a->getUserId(), 'self' => true]);
+ $remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]);
} elseif (!local_user() && remote_user()) {
$remoteUser = Contact::getById(remote_user(), $fields);
$nav_info['nav']['remote'] = DI::l10n()->t('Guest');