Replaced direct calls to App->user

This commit is contained in:
Michael 2021-08-08 11:17:08 +00:00
parent 2d4ecd5ccf
commit e823a1bd05
10 changed files with 12 additions and 12 deletions

View File

@ -200,7 +200,7 @@ function advancedcontentfilter_content(App $a)
}
if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'help') {
$lang = $a->user['language'];
$lang = $a->getUserValue('language');
$default_dir = 'addon/advancedcontentfilter/doc/';
$help_file = 'advancedcontentfilter.md';

View File

@ -57,7 +57,7 @@ function ifttt_settings(App $a, &$s)
$s .= '<div id="ifttt-configuration-wrapper">';
$s .= '<p>' . DI::l10n()->t('Create an account at <a href="http://www.ifttt.com">IFTTT</a>. Create three Facebook recipes that are connected with <a href="https://ifttt.com/maker">Maker</a> (In the form "if Facebook then Maker") with the following parameters:') . '</p>';
$s .= '<h4>URL</h4>';
$s .= '<p>' . DI::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '</p>';
$s .= '<p>' . DI::baseUrl()->get() . '/ifttt/' . $a->getNickname() . '</p>';
$s .= '<h4>Method</h4>';
$s .= '<p>POST</p>';
$s .= '<h4>Content Type</h4>';

View File

@ -283,7 +283,7 @@ function jappixmini_settings(App $a, &$s)
}
if (($username == "") && DI::config()->get("jappixmini", "default_user")) {
$username = $a->user["nickname"];
$username = $a->getNickname();
}
$info_text = DI::config()->get("jappixmini", "infotext");

View File

@ -105,7 +105,7 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
// Never filter own messages
// TODO: find a better way to extract this
$logged_user_profile = DI::baseUrl()->get() . '/profile/' . $a->user['nickname'];
$logged_user_profile = DI::baseUrl()->get() . '/profile/' . $a->getNickname();
if ($logged_user_profile == $hook_data['item']['author-link']) {
return;
}

View File

@ -43,8 +43,8 @@ function opmlexport(App $a)
$head = $xml->createElement('head');
$body = $xml->createElement('body');
$outline = $xml->createElement('outline');
$outline->setAttribute('title', $a->user['username'] . '\'s RSS/Atom contacts');
$outline->setAttribute('text', $a->user['username'] . '\'s RSS/Atom contacts');
$outline->setAttribute('title', $a->getUserValue('username') . '\'s RSS/Atom contacts');
$outline->setAttribute('text', $a->getUserValue('username') . '\'s RSS/Atom contacts');
foreach($data as $c) {
$entry = $xml->createElement('outline');

View File

@ -52,7 +52,7 @@ class SecureTestEmail extends Email
// enable addon for test
$pConfig->set(local_user(), 'securemail', 'enable', 1);
parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'],
parent::__construct($sitename, $sender_email, $sender_email, $a->getUserValue('email'),
$subject, "<p>{$message}</p>", $message,
[], local_user());
}

View File

@ -334,7 +334,7 @@ function statusnet_settings(App $a, &$s)
$s .= '<div id="statusnet-info" ><img id="statusnet-avatar" src="' . $details->profile_image_url . '" /><p id="statusnet-info-block">' . DI::l10n()->t('Currently connected to: ') . '<a href="' . $details->statusnet_profile_url . '" target="_statusnet">' . $details->screen_name . '</a><br /><em>' . $details->description . '</em></p></div>';
}
$s .= '<p>' . DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') . '</p>';
if ($a->user['hidewall']) {
if ($a->getUserValue('hidewall')) {
$s .= '<p>' . DI::l10n()->t('<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '</p>';
}
$s .= '<div id="statusnet-enable-wrapper">';

View File

@ -146,7 +146,7 @@ function twitter_follow(App $a, array &$contact)
$nickname = preg_replace("=https?://twitter.com/(.*)=ism", "$1", $contact["url"]);
$nickname = str_replace("@twitter.com", "", $nickname);
$uid = $a->user["uid"];
$uid = $a->getUserId();
$ckey = DI::config()->get('twitter', 'consumerkey');
$csecret = DI::config()->get('twitter', 'consumersecret');
@ -356,7 +356,7 @@ function twitter_settings(App $a, &$s)
$s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-enable', DI::l10n()->t('Allow posting to Twitter'), $enabled, DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')]
]);
if ($a->user['hidewall']) {
if ($a->getUserValue('hidewall')) {
$s .= '<p>' . DI::l10n()->t('<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '</p>';
}
$s .= Renderer::replaceMacros($field_checkbox, [

View File

@ -460,5 +460,5 @@ function windowsphonepush_login(App $a)
DI::auth()->setForUser($a, $record);
DI::session()->set('allow_api', true);
Hook::callAll('logged_in', $a->user);
Hook::callAll('logged_in', $record);
}

View File

@ -153,7 +153,7 @@ function xmpp_converse(App $a)
DI::pConfig()->set(local_user(), "xmpp", "password", $password);
}
$jid = $a->user["nickname"] . "@" . DI::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5);
$jid = $a->getNickname() . "@" . DI::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5);
$auto_login = "auto_login: true,
authentication: 'login',