diff --git a/include/api.php b/include/api.php index e419e3ad2..7b649da7d 100644 --- a/include/api.php +++ b/include/api.php @@ -322,7 +322,7 @@ function api_call(App $a, App\Arguments $args = null) if (!empty($info['auth']) && api_user() === false) { api_login($a); - Logger::info(API_LOG_PREFIX . 'nickname {nickname}', ['module' => 'api', 'action' => 'call', 'nickname' => $a->getNickname()]); + Logger::info(API_LOG_PREFIX . 'nickname {nickname}', ['module' => 'api', 'action' => 'call', 'nickname' => $a->getUserNickname()]); } Logger::debug(API_LOG_PREFIX . 'parameters', ['module' => 'api', 'action' => 'call', 'parameters' => $_REQUEST]); diff --git a/mod/display.php b/mod/display.php index ad61134e5..7ac4f38ce 100644 --- a/mod/display.php +++ b/mod/display.php @@ -62,7 +62,7 @@ function display_init(App $a) if (local_user()) { $item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => local_user()]); if (DBA::isResult($item)) { - $nick = $a->getNickname(); + $nick = $a->getUserNickname(); } } diff --git a/mod/editpost.php b/mod/editpost.php index 5197708b4..e522522e3 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -68,7 +68,7 @@ function editpost_content(App $a) DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [ '$ispublic' => ' ', // DI::l10n()->t('Visible to everybody'), '$geotag' => $geotag, - '$nickname' => $a->getNickname(), + '$nickname' => $a->getUserNickname(), '$is_mobile' => DI::mode()->isMobile(), ]); diff --git a/mod/events.php b/mod/events.php index 71e14fc86..25a937632 100644 --- a/mod/events.php +++ b/mod/events.php @@ -280,7 +280,7 @@ function events_content(App $a) $tabs = ''; // tabs if ($a->getThemeInfoValue('events_in_profile')) { - $tabs = BaseProfile::getTabsHTML($a, 'events', true, $a->getNickname(), false); + $tabs = BaseProfile::getTabsHTML($a, 'events', true, $a->getUserNickname(), false); } $mode = 'view'; diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 2f4b2eef5..5d086e0bf 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -88,7 +88,7 @@ function fbrowser_content(App $a) } return [ - DI::baseUrl() . '/photos/' . $a->getNickname() . '/image/' . $rr['resource-id'], + DI::baseUrl() . '/photos/' . $a->getUserNickname() . '/image/' . $rr['resource-id'], $filename_e, DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext ]; @@ -103,7 +103,7 @@ function fbrowser_content(App $a) '$folders' => $albums, '$files' => $files, '$cancel' => DI::l10n()->t('Cancel'), - '$nickname' => $a->getNickname(), + '$nickname' => $a->getUserNickname(), '$upload' => DI::l10n()->t('Upload') ]); @@ -132,7 +132,7 @@ function fbrowser_content(App $a) '$folders' => false, '$files' => $files, '$cancel' => DI::l10n()->t('Cancel'), - '$nickname' => $a->getNickname(), + '$nickname' => $a->getUserNickname(), '$upload' => DI::l10n()->t('Upload') ]); } diff --git a/mod/follow.php b/mod/follow.php index d655bc2bf..d7b01e619 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -175,7 +175,7 @@ function follow_process(App $a, string $url) { $return_path = 'follow?url=' . urlencode($url); - $result = Contact::createFromProbe($a->getUserId(), $url); + $result = Contact::createFromProbeForUser($a->getUserId(), $url); if ($result['success'] == false) { // Possibly it is a remote item and not an account diff --git a/mod/message.php b/mod/message.php index e862a469b..c8e5f4290 100644 --- a/mod/message.php +++ b/mod/message.php @@ -112,7 +112,7 @@ function message_content(App $a) return Login::form(); } - $myprofile = DI::baseUrl() . '/profile/' . $a->getNickname(); + $myprofile = DI::baseUrl() . '/profile/' . $a->getUserNickname(); $tpl = Renderer::getMarkupTemplate('mail_head.tpl'); if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new') { @@ -179,7 +179,7 @@ function message_content(App $a) $tpl = Renderer::getMarkupTemplate('msg-header.tpl'); DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [ '$baseurl' => DI::baseUrl()->get(true), - '$nickname' => $a->getNickname(), + '$nickname' => $a->getUserNickname(), '$linkurl' => DI::l10n()->t('Please enter a link URL:') ]); @@ -292,7 +292,7 @@ function message_content(App $a) $tpl = Renderer::getMarkupTemplate('msg-header.tpl'); DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [ '$baseurl' => DI::baseUrl()->get(true), - '$nickname' => $a->getNickname(), + '$nickname' => $a->getUserNickname(), '$linkurl' => DI::l10n()->t('Please enter a link URL:') ]); @@ -431,7 +431,7 @@ function render_messages(array $msg, $t) $tpl = Renderer::getMarkupTemplate($t); $rslt = ''; - $myprofile = DI::baseUrl() . '/profile/' . $a->getNickname(); + $myprofile = DI::baseUrl() . '/profile/' . $a->getUserNickname(); foreach ($msg as $rr) { if ($rr['unknown']) { diff --git a/mod/notes.php b/mod/notes.php index fd8763b96..1c160a2f2 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -45,7 +45,7 @@ function notes_content(App $a, $update = false) return; } - $o = BaseProfile::getTabsHTML($a, 'notes', true, $a->getNickname(), false); + $o = BaseProfile::getTabsHTML($a, 'notes', true, $a->getUserNickname(), false); if (!$update) { $o .= '
".DI::l10n()->t("Keep this window open until done.")."
"; - Contact::createFromProbe($a->getUserId(), $r[0]["url"]); + Contact::createFromProbeForUser($a->getUserId(), $r[0]["url"]); DI::page()['htmlhead'] = ''; diff --git a/mod/settings.php b/mod/settings.php index 63ad55fa9..5ad884e88 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -594,7 +594,7 @@ function settings_content(App $a) $username = $user['username']; $email = $user['email']; - $nickname = $a->getNickname(); + $nickname = $a->getUserNickname(); $timezone = $user['timezone']; $language = $user['language']; $notify = $user['notify-flags']; diff --git a/src/App.php b/src/App.php index d779a48d6..ff8c059de 100644 --- a/src/App.php +++ b/src/App.php @@ -166,7 +166,7 @@ class App * Fetch the user nick name * @return string */ - public function getNickname() + public function getUserNickname() { return $this->nickname; } diff --git a/src/App/Page.php b/src/App/Page.php index 97b70cf5c..75107df6d 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -277,8 +277,8 @@ class Page implements ArrayAccess // If you're just visiting, let javascript take you home if (!empty($_SESSION['visitor_home'])) { $homebase = $_SESSION['visitor_home']; - } elseif (!empty($app->getNickname())) { - $homebase = 'profile/' . $app->getNickname(); + } elseif (!empty($app->getUserNickname())) { + $homebase = 'profile/' . $app->getUserNickname(); } if (isset($homebase)) { diff --git a/src/BaseModule.php b/src/BaseModule.php index f6dbedfa7..28cce09e0 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -183,7 +183,7 @@ abstract class BaseModule public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token') { if (!self::checkFormSecurityToken($typename, $formname)) { - Logger::log('checkFormSecurityToken failed: user ' . DI::app()->getNickname() . ' - form element ' . $typename); + Logger::log('checkFormSecurityToken failed: user ' . DI::app()->getUserNickname() . ' - form element ' . $typename); Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA); notice(self::getFormSecurityStandardErrorMessage()); DI::baseUrl()->redirect($err_redirect); @@ -193,7 +193,7 @@ abstract class BaseModule public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token') { if (!self::checkFormSecurityToken($typename, $formname)) { - Logger::log('checkFormSecurityToken failed: user ' . DI::app()->getNickname() . ' - form element ' . $typename); + Logger::log('checkFormSecurityToken failed: user ' . DI::app()->getUserNickname() . ' - form element ' . $typename); Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA); throw new \Friendica\Network\HTTPException\ForbiddenException(); diff --git a/src/Console/Contact.php b/src/Console/Contact.php index 7a4299c7b..ba65c0025 100644 --- a/src/Console/Contact.php +++ b/src/Console/Contact.php @@ -164,7 +164,7 @@ HELP; $network = CliPrompt::prompt(); } - $result = ContactModel::createFromProbe($user['uid'], $url, $network); + $result = ContactModel::createFromProbeForUser($user['uid'], $url, $network); if ($result['success']) { $this->out('User ' . $user['nickname'] . ' now connected to ' . $url . ', contact ID ' . $result['cid']); diff --git a/src/Content/Nav.php b/src/Content/Nav.php index 3504b9e5a..4ed25cdad 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -154,7 +154,7 @@ class Nav * Display the current site location as a navigation aid. */ - $myident = !empty($a->getNickname() ? $a->getNickname() . '@' : ''); + $myident = !empty($a->getUserNickname()) ? $a->getUserNickname() . '@' : ''; $sitelocation = $myident . substr(DI::baseUrl()->get($ssl_state), strpos(DI::baseUrl()->get($ssl_state), '//') + 2); @@ -187,10 +187,10 @@ class Nav if ($a->isLoggedIn()) { // user menu - $nav['usermenu'][] = ['profile/' . $a->getNickname(), DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')]; - $nav['usermenu'][] = ['profile/' . $a->getNickname() . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')]; - $nav['usermenu'][] = ['photos/' . $a->getNickname(), DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')]; - $nav['usermenu'][] = ['videos/' . $a->getNickname(), DI::l10n()->t('Videos'), '', DI::l10n()->t('Your videos')]; + $nav['usermenu'][] = ['profile/' . $a->getUserNickname(), DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')]; + $nav['usermenu'][] = ['profile/' . $a->getUserNickname() . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')]; + $nav['usermenu'][] = ['photos/' . $a->getUserNickname(), DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')]; + $nav['usermenu'][] = ['videos/' . $a->getUserNickname(), DI::l10n()->t('Videos'), '', DI::l10n()->t('Your videos')]; $nav['usermenu'][] = ['events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')]; $nav['usermenu'][] = ['notes/', DI::l10n()->t('Personal notes'), '', DI::l10n()->t('Your personal notes')]; @@ -267,10 +267,10 @@ class Nav } // The following nav links are only show to logged in users - if (local_user() && !empty($a->getNickname())) { + if (local_user() && !empty($a->getUserNickname())) { $nav['network'] = ['network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')]; - $nav['home'] = ['profile/' . $a->getNickname(), DI::l10n()->t('Home'), '', DI::l10n()->t('Your posts and conversations')]; + $nav['home'] = ['profile/' . $a->getUserNickname(), DI::l10n()->t('Home'), '', DI::l10n()->t('Your posts and conversations')]; // Don't show notifications for public communities if (Session::get('page_flags', '') != User::PAGE_FLAGS_COMMUNITY) { diff --git a/src/Factory/Notification/Introduction.php b/src/Factory/Notification/Introduction.php index 5bbdbd2eb..a153e5a56 100644 --- a/src/Factory/Notification/Introduction.php +++ b/src/Factory/Notification/Introduction.php @@ -68,7 +68,7 @@ class Introduction extends BaseFactory $this->l10n = $l10n; $this->pConfig = $pConfig; $this->session = $session; - $this->nick = $app->getNickname() ?? ''; + $this->nick = $app->getUserNickname() ?? ''; } /** diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 9e870d505..c5b10dd8e 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2319,7 +2319,7 @@ class Contact * @throws HTTPException\NotFoundException * @throws \ImagickException */ - public static function createFromProbe(int $uid, $url, $network = '') + public static function createFromProbeForUser(int $uid, $url, $network = '') { $result = ['cid' => -1, 'success' => false, 'message' => '']; @@ -2580,7 +2580,7 @@ class Contact { $contact = self::getById($cid, ['url']); - $result = self::createFromProbe($uid, $contact['url']); + $result = self::createFromProbeForUser($uid, $contact['url']); return $result['cid']; } @@ -2738,7 +2738,7 @@ class Contact } } elseif (DBA::isResult($user) && in_array($user['page-flags'], [User::PAGE_FLAGS_SOAPBOX, User::PAGE_FLAGS_FREELOVE, User::PAGE_FLAGS_COMMUNITY])) { if (($user['page-flags'] == User::PAGE_FLAGS_FREELOVE) && ($network != Protocol::DIASPORA)) { - self::createFromProbe($importer['uid'], $url, $network); + self::createFromProbeForUser($importer['uid'], $url, $network); } $condition = ['uid' => $importer['uid'], 'url' => $url, 'pending' => true]; diff --git a/src/Model/Mail.php b/src/Model/Mail.php index 7afd95547..7b18ac3c3 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -173,7 +173,7 @@ class Mail $recip_host = substr($recip_host, 0, strpos($recip_host, '/')); $recip_handle = (($contact['addr']) ? $contact['addr'] : $contact['nick'] . '@' . $recip_host); - $sender_handle = $a->getNickname() . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3); + $sender_handle = $a->getUserNickname() . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3); $conv_guid = System::createUUID(); $convuri = $recip_handle . ':' . $conv_guid; diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 9685d090e..4863e7101 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -168,7 +168,7 @@ class Contact extends BaseModule } if ($contact['network'] == Protocol::OSTATUS) { - $result = Model\Contact::createFromProbe($contact['uid'], $contact['url'], $contact['network']); + $result = Model\Contact::createFromProbeForUser($contact['uid'], $contact['url'], $contact['network']); if ($result['success']) { DBA::update('contact', ['subhub' => 1], ['id' => $contact_id]); diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index 7ee9b4972..ac662ecbd 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -109,7 +109,7 @@ class Delegation extends BaseModule $ret = []; Hook::callAll('home_init', $ret); - DI::baseUrl()->redirect('profile/' . DI::app()->getNickname()); + DI::baseUrl()->redirect('profile/' . DI::app()->getUserNickname()); // NOTREACHED } @@ -130,7 +130,7 @@ class Delegation extends BaseModule $identities[$key]['thumb'] = Contact::getAvatarUrlForId($self['id'], Proxy::SIZE_THUMB, $self['updated']); - $identities[$key]['selected'] = ($identity['nickname'] === DI::app()->getNickname()); + $identities[$key]['selected'] = ($identity['nickname'] === DI::app()->getUserNickname()); $condition = ["`uid` = ? AND `msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", $identity['uid'], Notification\Type::INTRO, Notification\Type::MAIL]; $params = ['distinct' => true, 'expression' => 'parent']; diff --git a/src/Module/HCard.php b/src/Module/HCard.php index e5547188b..c43e3975c 100644 --- a/src/Module/HCard.php +++ b/src/Module/HCard.php @@ -40,7 +40,7 @@ class HCard extends BaseModule if ((local_user()) && ($parameters['action'] ?? '') === 'view') { // A logged in user views a profile of a user - $nickname = $a->getNickname(); + $nickname = $a->getUserNickname(); } elseif (empty($parameters['action'])) { // Show the profile hCard $nickname = $parameters['profile']; diff --git a/src/Module/Home.php b/src/Module/Home.php index 38a881f29..76c4736cf 100644 --- a/src/Module/Home.php +++ b/src/Module/Home.php @@ -42,7 +42,7 @@ class Home extends BaseModule Hook::callAll('home_init', $ret); - if (local_user() && ($app->getNickname())) { + if (local_user() && ($app->getUserNickname())) { DI::baseUrl()->redirect('network'); } diff --git a/src/Module/Invite.php b/src/Module/Invite.php index 3b3e56eb4..48926a1fb 100644 --- a/src/Module/Invite.php +++ b/src/Module/Invite.php @@ -171,7 +171,7 @@ class Invite extends BaseModule DI::l10n()->t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n" . $linkTxt . "\r\n" . "\r\n" . (($inviteOnly) ? DI::l10n()->t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') . DI::l10n()->t('Once you have registered, please connect with me via my profile page at:') - . "\r\n" . "\r\n" . DI::baseUrl()->get() . '/profile/' . $app->getNickname() + . "\r\n" . "\r\n" . DI::baseUrl()->get() . '/profile/' . $app->getUserNickname() . "\r\n" . "\r\n" . DI::l10n()->t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n", ], '$submit' => DI::l10n()->t('Submit') diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index b308ae14c..9c7b9ec8b 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -45,7 +45,7 @@ class NoScrape extends BaseModule $which = $parameters['nick']; } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') { // view infos about a known profile (needs a login) - $which = $a->getNickname(); + $which = $a->getUserNickname(); } else { System::jsonError(403, 'Authentication required'); } diff --git a/src/Module/Profile/Schedule.php b/src/Module/Profile/Schedule.php index 5c5581d57..ee468f815 100644 --- a/src/Module/Profile/Schedule.php +++ b/src/Module/Profile/Schedule.php @@ -58,7 +58,7 @@ class Schedule extends BaseProfile $a = DI::app(); - $o = self::getTabsHTML($a, 'schedule', true, $a->getNickname(), false); + $o = self::getTabsHTML($a, 'schedule', true, $a->getUserNickname(), false); $schedule = []; $delayed = DBA::select('delayed-post', [], ['uid' => local_user()]); diff --git a/src/Module/Settings/Profile/Photo/Crop.php b/src/Module/Settings/Profile/Photo/Crop.php index f90b16f0e..d6c89e237 100644 --- a/src/Module/Settings/Profile/Photo/Crop.php +++ b/src/Module/Settings/Profile/Photo/Crop.php @@ -56,7 +56,7 @@ class Crop extends BaseSettings $selectionW = intval($_POST['width'] ?? 0); $selectionH = intval($_POST['height'] ?? 0); - $path = 'profile/' . DI::app()->getNickname(); + $path = 'profile/' . DI::app()->getUserNickname(); $base_image = Photo::selectFirst([], ['resource-id' => $resource_id, 'uid' => local_user(), 'scale' => $scale]); if (DBA::isResult($base_image)) { @@ -184,7 +184,7 @@ class Crop extends BaseSettings info(DI::l10n()->t('Profile picture successfully updated.')); - DI::baseUrl()->redirect('profile/' . DI::app()->getNickname()); + DI::baseUrl()->redirect('profile/' . DI::app()->getUserNickname()); } $Image = Photo::getImageForPhoto($photos[0]); diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php index 5a7bae168..3b4d33a01 100644 --- a/src/Module/Settings/Profile/Photo/Index.php +++ b/src/Module/Settings/Profile/Photo/Index.php @@ -133,7 +133,7 @@ class Index extends BaseSettings DI::l10n()->t('or'), ($newuser) ? '' . DI::l10n()->t('skip this step') . '' - : '' + : '' . DI::l10n()->t('select a photo from your photo albums') . '' ), ]); diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index a2a6dc2d2..fe3dd2690 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -100,17 +100,17 @@ class UserExport extends BaseSettings switch ($action) { case "backup": header("Content-type: application/json"); - header('Content-Disposition: attachment; filename="' . DI::app()->getNickname() . '.' . $action . '"'); + header('Content-Disposition: attachment; filename="' . DI::app()->getUserNickname() . '.' . $action . '"'); self::exportAll(local_user()); break; case "account": header("Content-type: application/json"); - header('Content-Disposition: attachment; filename="' . DI::app()->getNickname() . '.' . $action . '"'); + header('Content-Disposition: attachment; filename="' . DI::app()->getUserNickname() . '.' . $action . '"'); self::exportAccount(local_user()); break; case "contact": header("Content-type: application/csv"); - header('Content-Disposition: attachment; filename="' . DI::app()->getNickname() . '-contacts.csv' . '"'); + header('Content-Disposition: attachment; filename="' . DI::app()->getUserNickname() . '-contacts.csv' . '"'); self::exportContactsAsCSV(local_user()); break; } diff --git a/src/Object/EMail/ItemCCEMail.php b/src/Object/EMail/ItemCCEMail.php index e70625bb9..ddaf76608 100644 --- a/src/Object/EMail/ItemCCEMail.php +++ b/src/Object/EMail/ItemCCEMail.php @@ -41,14 +41,14 @@ class ItemCCEMail extends Email $disclaimer = '