1
0
Fork 0

Merge remote-tracking branch 'upstream/develop' into personal-copy

This commit is contained in:
Michael 2020-07-28 05:40:37 +00:00
commit e6cd5a4d66
165 changed files with 1879 additions and 3326 deletions

View file

@ -47,12 +47,12 @@ function oauth_get_client(OAuthRequest $request)
function api_post(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
if (count($a->user) && !empty($a->user['uid']) && $a->user['uid'] != local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
}
@ -107,7 +107,7 @@ function api_content(App $a)
if (!local_user()) {
/// @TODO We need login form to redirect to this page
notice(DI::l10n()->t('Please login to continue.') . EOL);
notice(DI::l10n()->t('Please login to continue.'));
return Login::form(DI::args()->getQueryString(), false, $request->get_parameters());
}
//FKOAuth1::loginUser(4);

View file

@ -134,7 +134,7 @@ function cal_content(App $a)
$is_owner = local_user() == $a->profile['uid'];
if ($a->profile['hidewall'] && !$is_owner && !$remote_contact) {
notice(DI::l10n()->t('Access to this profile has been restricted.') . EOL);
notice(DI::l10n()->t('Access to this profile has been restricted.'));
return;
}

View file

@ -40,7 +40,7 @@ function common_content(App $a)
$zcid = 0;
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -103,7 +103,7 @@ function common_content(App $a)
}
if ($total < 1) {
notice(DI::l10n()->t('No contacts in common.') . EOL);
notice(DI::l10n()->t('No contacts in common.'));
return $o;
}

View file

@ -45,7 +45,6 @@ use Friendica\Model\User;
use Friendica\Protocol\Activity;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\XML;
@ -76,13 +75,13 @@ function dfrn_confirm_post(App $a, $handsfree = null)
if (empty($_POST['source_url'])) {
$uid = ($handsfree['uid'] ?? 0) ?: local_user();
if (!$uid) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
$user = DBA::selectFirst('user', [], ['uid' => $uid]);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('Profile not found.') . EOL);
notice(DI::l10n()->t('Profile not found.'));
return;
}
@ -137,8 +136,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
);
if (!DBA::isResult($r)) {
Logger::log('Contact not found in DB.');
notice(DI::l10n()->t('Contact not found.') . EOL);
notice(DI::l10n()->t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
notice(DI::l10n()->t('Contact not found.'));
notice(DI::l10n()->t('This may occasionally happen if contact was requested by both persons and it has already been approved.'));
return;
}
@ -224,7 +223,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
*
*/
$res = Network::post($dfrn_confirm, $params, [], 120)->getBody();
$res = DI::httpRequest()->post($dfrn_confirm, $params, [], 120)->getBody();
Logger::log(' Confirm: received data: ' . $res, Logger::DATA);
@ -239,20 +238,20 @@ function dfrn_confirm_post(App $a, $handsfree = null)
// We shouldn't proceed, because the xml parser might choke,
// and $status is going to be zero, which indicates success.
// We can hardly call this a success.
notice(DI::l10n()->t('Response from remote site was not understood.') . EOL);
notice(DI::l10n()->t('Response from remote site was not understood.'));
return;
}
if (strlen($leading_junk) && DI::config()->get('system', 'debugging')) {
// This might be more common. Mixed error text and some XML.
// If we're configured for debugging, show the text. Proceed in either case.
notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);
notice(DI::l10n()->t('Unexpected response from remote site: ') . $leading_junk);
}
if (stristr($res, "<status") === false) {
// wrong xml! stop here!
Logger::log('Unexpected response posting to ' . $dfrn_confirm);
notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL);
notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res));
return;
}
@ -261,7 +260,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$message = XML::unescape($xml->message); // human readable text of what may have gone wrong.
switch ($status) {
case 0:
info(DI::l10n()->t("Confirmation completed successfully.") . EOL);
info(DI::l10n()->t("Confirmation completed successfully."));
break;
case 1:
// birthday paradox - generate new dfrn-id and fall through.
@ -273,15 +272,15 @@ function dfrn_confirm_post(App $a, $handsfree = null)
);
case 2:
notice(DI::l10n()->t("Temporary failure. Please wait and try again.") . EOL);
notice(DI::l10n()->t("Temporary failure. Please wait and try again."));
break;
case 3:
notice(DI::l10n()->t("Introduction failed or was revoked.") . EOL);
notice(DI::l10n()->t("Introduction failed or was revoked."));
break;
}
if (strlen($message)) {
notice(DI::l10n()->t('Remote site reported: ') . $message . EOL);
notice(DI::l10n()->t('Remote site reported: ') . $message);
}
if (($status == 0) && $intro_id) {
@ -305,7 +304,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
*
* We will also update the contact record with the nature and scope of the relationship.
*/
Contact::updateAvatar($contact['photo'], $uid, $contact_id);
Contact::updateAvatar($contact_id, $contact['photo']);
Logger::log('dfrn_confirm: confirm - imported photos');
@ -485,7 +484,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$photo = DI::baseUrl() . '/images/person-300.jpg';
}
Contact::updateAvatar($photo, $local_uid, $dfrn_record);
Contact::updateAvatar($dfrn_record, $photo);
Logger::log('dfrn_confirm: request - photos imported');

View file

@ -21,13 +21,12 @@
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\OStatus;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\XML;
@ -115,7 +114,7 @@ function dfrn_poll_init(App $a)
);
if (DBA::isResult($r)) {
$s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
$s = DI::httpRequest()->fetch($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
Logger::log("dfrn_poll: old profile returns " . $s, Logger::DATA);
@ -133,7 +132,7 @@ function dfrn_poll_init(App $a)
Session::setVisitorsContacts();
if (!$quiet) {
info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']));
}
// Visitors get 1 day session.
@ -499,20 +498,20 @@ function dfrn_poll_content(App $a)
// URL reply
if ($dfrn_version < 2.2) {
$s = Network::fetchUrl($r[0]['poll']
. '?dfrn_id=' . $encrypted_id
. '&type=profile-check'
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
. '&challenge=' . $challenge
. '&sec=' . $sec
$s = DI::httpRequest()->fetch($r[0]['poll']
. '?dfrn_id=' . $encrypted_id
. '&type=profile-check'
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
. '&challenge=' . $challenge
. '&sec=' . $sec
);
} else {
$s = Network::post($r[0]['poll'], [
'dfrn_id' => $encrypted_id,
'type' => 'profile-check',
$s = DI::httpRequest()->post($r[0]['poll'], [
'dfrn_id' => $encrypted_id,
'type' => 'profile-check',
'dfrn_version' => DFRN_PROTOCOL_VERSION,
'challenge' => $challenge,
'sec' => $sec
'challenge' => $challenge,
'sec' => $sec
])->getBody();
}
@ -536,7 +535,7 @@ function dfrn_poll_content(App $a)
Session::setVisitorsContacts();
if (!$quiet) {
info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']));
}
// Visitors get 1 day session.

View file

@ -29,8 +29,8 @@ use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
use Friendica\Core\System;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@ -110,7 +110,7 @@ function dfrn_request_post(App $a)
if (DBA::isResult($r)) {
if (strlen($r[0]['dfrn-id'])) {
// We don't need to be here. It has already happened.
notice(DI::l10n()->t("This introduction has already been accepted.") . EOL);
notice(DI::l10n()->t("This introduction has already been accepted."));
return;
} else {
$contact_record = $r[0];
@ -128,18 +128,18 @@ function dfrn_request_post(App $a)
$parms = Probe::profile($dfrn_url);
if (!count($parms)) {
notice(DI::l10n()->t('Profile location is not valid or does not contain profile information.') . EOL);
notice(DI::l10n()->t('Profile location is not valid or does not contain profile information.'));
return;
} else {
if (empty($parms['fn'])) {
notice(DI::l10n()->t('Warning: profile location has no identifiable owner name.') . EOL);
notice(DI::l10n()->t('Warning: profile location has no identifiable owner name.'));
}
if (empty($parms['photo'])) {
notice(DI::l10n()->t('Warning: profile location has no profile photo.') . EOL);
notice(DI::l10n()->t('Warning: profile location has no profile photo.'));
}
$invalid = Probe::validDfrn($parms);
if ($invalid) {
notice(DI::l10n()->tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
notice(DI::l10n()->tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid));
return;
}
}
@ -177,7 +177,7 @@ function dfrn_request_post(App $a)
}
if ($r) {
info(DI::l10n()->t("Introduction complete.") . EOL);
info(DI::l10n()->t("Introduction complete."));
}
$r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `site-pubkey` = '%s' LIMIT 1",
@ -189,7 +189,7 @@ function dfrn_request_post(App $a)
Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
if (isset($photo)) {
Contact::updateAvatar($photo, local_user(), $r[0]["id"], true);
Contact::updateAvatar($r[0]["id"], $photo, true);
}
$forward_path = "contact/" . $r[0]['id'];
@ -203,7 +203,7 @@ function dfrn_request_post(App $a)
}
if (!empty($dfrn_request) && strlen($confirm_key)) {
Network::fetchUrl($dfrn_request . '?confirm_key=' . $confirm_key);
DI::httpRequest()->fetch($dfrn_request . '?confirm_key=' . $confirm_key);
}
// (ignore reply, nothing we can do it failed)
@ -213,7 +213,7 @@ function dfrn_request_post(App $a)
}
// invalid/bogus request
notice(DI::l10n()->t('Unrecoverable protocol error.') . EOL);
notice(DI::l10n()->t('Unrecoverable protocol error.'));
DI::baseUrl()->redirect();
return; // NOTREACHED
}
@ -240,7 +240,7 @@ function dfrn_request_post(App $a)
*
*/
if (empty($a->profile['uid'])) {
notice(DI::l10n()->t('Profile unavailable.') . EOL);
notice(DI::l10n()->t('Profile unavailable.'));
return;
}
@ -261,9 +261,9 @@ function dfrn_request_post(App $a)
intval($uid)
);
if (DBA::isResult($r) && count($r) > $maxreq) {
notice(DI::l10n()->t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
notice(DI::l10n()->t('Spam protection measures have been invoked.') . EOL);
notice(DI::l10n()->t('Friends are advised to please try again in 24 hours.') . EOL);
notice(DI::l10n()->t('%s has received too many connection requests today.', $a->profile['name']));
notice(DI::l10n()->t('Spam protection measures have been invoked.'));
notice(DI::l10n()->t('Friends are advised to please try again in 24 hours.'));
return;
}
}
@ -287,7 +287,7 @@ function dfrn_request_post(App $a)
$url = trim($_POST['dfrn_url']);
if (!strlen($url)) {
notice(DI::l10n()->t("Invalid locator") . EOL);
notice(DI::l10n()->t("Invalid locator"));
return;
}
@ -323,10 +323,10 @@ function dfrn_request_post(App $a)
if (DBA::isResult($ret)) {
if (strlen($ret[0]['issued-id'])) {
notice(DI::l10n()->t('You have already introduced yourself here.') . EOL);
notice(DI::l10n()->t('You have already introduced yourself here.'));
return;
} elseif ($ret[0]['rel'] == Contact::FRIEND) {
notice(DI::l10n()->t('Apparently you are already friends with %s.', $a->profile['name']) . EOL);
notice(DI::l10n()->t('Apparently you are already friends with %s.', $a->profile['name']));
return;
} else {
$contact_record = $ret[0];
@ -346,19 +346,19 @@ function dfrn_request_post(App $a)
} else {
$url = Network::isUrlValid($url);
if (!$url) {
notice(DI::l10n()->t('Invalid profile URL.') . EOL);
notice(DI::l10n()->t('Invalid profile URL.'));
DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (!Network::isUrlAllowed($url)) {
notice(DI::l10n()->t('Disallowed profile URL.') . EOL);
notice(DI::l10n()->t('Disallowed profile URL.'));
DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (Network::isUrlBlocked($url)) {
notice(DI::l10n()->t('Blocked domain') . EOL);
notice(DI::l10n()->t('Blocked domain'));
DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
@ -366,18 +366,18 @@ function dfrn_request_post(App $a)
$parms = Probe::profile(($hcard) ? $hcard : $url);
if (!count($parms)) {
notice(DI::l10n()->t('Profile location is not valid or does not contain profile information.') . EOL);
notice(DI::l10n()->t('Profile location is not valid or does not contain profile information.'));
DI::baseUrl()->redirect(DI::args()->getCommand());
} else {
if (empty($parms['fn'])) {
notice(DI::l10n()->t('Warning: profile location has no identifiable owner name.') . EOL);
notice(DI::l10n()->t('Warning: profile location has no identifiable owner name.'));
}
if (empty($parms['photo'])) {
notice(DI::l10n()->t('Warning: profile location has no profile photo.') . EOL);
notice(DI::l10n()->t('Warning: profile location has no profile photo.'));
}
$invalid = Probe::validDfrn($parms);
if ($invalid) {
notice(DI::l10n()->tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
notice(DI::l10n()->tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid));
return;
}
@ -420,12 +420,12 @@ function dfrn_request_post(App $a)
);
if (DBA::isResult($r)) {
$contact_record = $r[0];
Contact::updateAvatar($photo, $uid, $contact_record["id"], true);
Contact::updateAvatar($contact_record["id"], $photo, true);
}
}
}
if ($r === false) {
notice(DI::l10n()->t('Failed to update contact record.') . EOL);
notice(DI::l10n()->t('Failed to update contact record.'));
return;
}
@ -445,7 +445,7 @@ function dfrn_request_post(App $a)
// This notice will only be seen by the requestor if the requestor and requestee are on the same server.
if (!$failed) {
info(DI::l10n()->t('Your introduction has been sent.') . EOL);
info(DI::l10n()->t('Your introduction has been sent.'));
}
// "Homecoming" - send the requestor back to their site to record the introduction.
@ -477,7 +477,7 @@ function dfrn_request_post(App $a)
// NOTREACHED
// END $network != Protocol::PHANTOM
} else {
notice(DI::l10n()->t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL);
notice(DI::l10n()->t("Remote subscription can't be done for your network. Please subscribe directly on your system."));
return;
}
} return;
@ -493,7 +493,7 @@ function dfrn_request_content(App $a)
// to send us to the post section to record the introduction.
if (!empty($_GET['dfrn_url'])) {
if (!local_user()) {
info(DI::l10n()->t("Please login to confirm introduction.") . EOL);
info(DI::l10n()->t("Please login to confirm introduction."));
/* setup the return URL to come back to this page if they use openid */
return Login::form();
}
@ -501,7 +501,7 @@ function dfrn_request_content(App $a)
// Edge case, but can easily happen in the wild. This person is authenticated,
// but not as the person who needs to deal with this request.
if ($a->user['nickname'] != $a->argv[1]) {
notice(DI::l10n()->t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
notice(DI::l10n()->t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile."));
return Login::form();
}
@ -603,7 +603,7 @@ function dfrn_request_content(App $a)
// Normal web request. Display our user's introduction form.
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
if (!DI::config()->get('system', 'local_block')) {
notice(DI::l10n()->t('Public access denied.') . EOL);
notice(DI::l10n()->t('Public access denied.'));
return;
}
}

View file

@ -35,14 +35,14 @@ function editpost_content(App $a)
$o = '';
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if (!$post_id) {
notice(DI::l10n()->t('Item not found') . EOL);
notice(DI::l10n()->t('Item not found'));
return;
}
@ -52,7 +52,7 @@ function editpost_content(App $a)
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
if (!DBA::isResult($item)) {
notice(DI::l10n()->t('Item not found') . EOL);
notice(DI::l10n()->t('Item not found'));
return;
}

View file

@ -132,7 +132,7 @@ function events_post(App $a)
$onerror_path = 'events/' . $action . '?' . http_build_query($params, null, null, PHP_QUERY_RFC3986);
if (strcmp($finish, $start) < 0 && !$nofinish) {
notice(DI::l10n()->t('Event can not end before it has started.') . EOL);
notice(DI::l10n()->t('Event can not end before it has started.'));
if (intval($_REQUEST['preview'])) {
echo DI::l10n()->t('Event can not end before it has started.');
exit();
@ -141,7 +141,7 @@ function events_post(App $a)
}
if (!$summary || ($start === DBA::NULL_DATETIME)) {
notice(DI::l10n()->t('Event title and start time are required.') . EOL);
notice(DI::l10n()->t('Event title and start time are required.'));
if (intval($_REQUEST['preview'])) {
echo DI::l10n()->t('Event title and start time are required.');
exit();
@ -225,7 +225,7 @@ function events_post(App $a)
function events_content(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
@ -583,9 +583,7 @@ function events_content(App $a)
}
if (Item::exists(['id' => $ev[0]['itemid']])) {
notice(DI::l10n()->t('Failed to remove event') . EOL);
} else {
info(DI::l10n()->t('Event removed') . EOL);
notice(DI::l10n()->t('Failed to remove event'));
}
DI::baseUrl()->redirect('events');

View file

@ -62,7 +62,7 @@ function follow_post(App $a)
DI::baseUrl()->redirect('contact/' . $result['cid']);
}
info(DI::l10n()->t('The contact could not be added.'));
notice(DI::l10n()->t('The contact could not be added.'));
DI::baseUrl()->redirect($return_path);
// NOTREACHED

View file

@ -333,7 +333,7 @@ function item_post(App $a) {
System::jsonExit(['preview' => '']);
}
info(DI::l10n()->t('Empty post discarded.'));
notice(DI::l10n()->t('Empty post discarded.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -703,7 +703,6 @@ function item_post(App $a) {
// update filetags in pconfig
FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
info(DI::l10n()->t('Post updated.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -725,7 +724,7 @@ function item_post(App $a) {
$post_id = Item::insert($datarray);
if (!$post_id) {
info(DI::l10n()->t('Item wasn\'t stored.'));
notice(DI::l10n()->t('Item wasn\'t stored.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -826,7 +825,6 @@ function item_post(App $a) {
return $post_id;
}
info(DI::l10n()->t('Post published.'));
item_post_return(DI::baseUrl(), $api_source, $return_path);
// NOTREACHED
}
@ -890,7 +888,7 @@ function drop_item(int $id, string $return = '')
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
if (!DBA::isResult($item)) {
notice(DI::l10n()->t('Item not found.') . EOL);
notice(DI::l10n()->t('Item not found.'));
DI::baseUrl()->redirect('network');
}

View file

@ -1,161 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Group;
use Friendica\Model\Item;
function lockview_content(App $a)
{
$type = (($a->argc > 1) ? $a->argv[1] : 0);
if (is_numeric($type)) {
$item_id = intval($type);
$type = 'item';
} else {
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
}
if (!$item_id) {
exit();
}
if (!in_array($type, ['item','photo','event'])) {
exit();
}
$fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
$condition = ['id' => $item_id];
if ($type != 'item') {
$item = DBA::selectFirst($type, $fields, $condition);
} else {
$fields[] = 'private';
$item = Item::selectFirst($fields, $condition);
}
if (!DBA::isResult($item)) {
exit();
}
Hook::callAll('lockview_content', $item);
if ($item['uid'] != local_user()) {
echo DI::l10n()->t('Remote privacy information not available.') . '<br />';
exit();
}
if (isset($item['private'])
&& $item['private'] == Item::PRIVATE
&& empty($item['allow_cid'])
&& empty($item['allow_gid'])
&& empty($item['deny_cid'])
&& empty($item['deny_gid']))
{
echo DI::l10n()->t('Remote privacy information not available.') . '<br />';
exit();
}
$aclFormatter = DI::aclFormatter();
$allowed_users = $aclFormatter->expand($item['allow_cid']);
$allowed_groups = $aclFormatter->expand($item['allow_gid']);
$deny_users = $aclFormatter->expand($item['deny_cid']);
$deny_groups = $aclFormatter->expand($item['deny_gid']);
$o = DI::l10n()->t('Visible to:') . '<br />';
$l = [];
if (count($allowed_groups)) {
$key = array_search(Group::FOLLOWERS, $allowed_groups);
if ($key !== false) {
$l[] = '<b>' . DI::l10n()->t('Followers') . '</b>';
unset($allowed_groups[$key]);
}
$key = array_search(Group::MUTUALS, $allowed_groups);
if ($key !== false) {
$l[] = '<b>' . DI::l10n()->t('Mutuals') . '</b>';
unset($allowed_groups[$key]);
}
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
DBA::escape(implode(', ', $allowed_groups))
);
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$l[] = '<b>' . $rr['name'] . '</b>';
}
}
}
if (count($allowed_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
DBA::escape(implode(', ', $allowed_users))
);
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$l[] = $rr['name'];
}
}
}
if (count($deny_groups)) {
$key = array_search(Group::FOLLOWERS, $deny_groups);
if ($key !== false) {
$l[] = '<b><strike>' . DI::l10n()->t('Followers') . '</strike></b>';
unset($deny_groups[$key]);
}
$key = array_search(Group::MUTUALS, $deny_groups);
if ($key !== false) {
$l[] = '<b><strike>' . DI::l10n()->t('Mutuals') . '</strike></b>';
unset($deny_groups[$key]);
}
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
DBA::escape(implode(', ', $deny_groups))
);
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
}
}
}
if (count($deny_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
DBA::escape(implode(', ', $deny_users))
);
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$l[] = '<strike>' . $rr['name'] . '</strike>';
}
}
}
echo $o . implode(', ', $l);
exit();
}

View file

@ -37,7 +37,7 @@ function lostpass_post(App $a)
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('No valid account found.') . EOL);
notice(DI::l10n()->t('No valid account found.'));
DI::baseUrl()->redirect();
}
@ -49,7 +49,7 @@ function lostpass_post(App $a)
];
$result = DBA::update('user', $fields, ['uid' => $user['uid']]);
if ($result) {
info(DI::l10n()->t('Password reset request issued. Check your email.') . EOL);
info(DI::l10n()->t('Password reset request issued. Check your email.'));
}
$sitename = DI::config()->get('config', 'sitename');
@ -152,7 +152,7 @@ function lostpass_generate_password($user)
'$newpass' => $new_password,
]);
info("Your password has been reset." . EOL);
info(DI::l10n()->t("Your password has been reset."));
$sitename = DI::config()->get('config', 'sitename');
$preamble = Strings::deindent(DI::l10n()->t('

View file

@ -27,7 +27,6 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
/**
@ -60,7 +59,7 @@ function match_content(App $a)
return '';
}
if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) {
notice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.') . EOL);
notice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
return '';
}
@ -76,7 +75,7 @@ function match_content(App $a)
$host = DI::baseUrl();
}
$msearch_json = Network::post($host . '/msearch', $params)->getBody();
$msearch_json = DI::httpRequest()->post($host . '/msearch', $params)->getBody();
$msearch = json_decode($msearch_json);
@ -141,7 +140,7 @@ function match_content(App $a)
}
if (empty($entries)) {
info(DI::l10n()->t('No matches') . EOL);
info(DI::l10n()->t('No matches'));
}
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');

View file

@ -68,7 +68,7 @@ function message_init(App $a)
function message_post(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -82,20 +82,18 @@ function message_post(App $a)
switch ($ret) {
case -1:
notice(DI::l10n()->t('No recipient selected.') . EOL);
notice(DI::l10n()->t('No recipient selected.'));
$norecip = true;
break;
case -2:
notice(DI::l10n()->t('Unable to locate contact information.') . EOL);
notice(DI::l10n()->t('Unable to locate contact information.'));
break;
case -3:
notice(DI::l10n()->t('Message could not be sent.') . EOL);
notice(DI::l10n()->t('Message could not be sent.'));
break;
case -4:
notice(DI::l10n()->t('Message collection failure.') . EOL);
notice(DI::l10n()->t('Message collection failure.'));
break;
default:
info(DI::l10n()->t('Message sent.') . EOL);
}
// fake it to go back to the input form if no recipient listed
@ -113,7 +111,7 @@ function message_content(App $a)
Nav::setSelected('messages');
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
@ -178,17 +176,16 @@ function message_content(App $a)
if ($cmd === 'drop') {
$message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
if(!DBA::isResult($message)){
info(DI::l10n()->t('Conversation not found.') . EOL);
notice(DI::l10n()->t('Conversation not found.'));
DI::baseUrl()->redirect('message');
}
if (DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
info(DI::l10n()->t('Message deleted.') . EOL);
if (!DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
notice(DI::l10n()->t('Message was not deleted.'));
}
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
if(!DBA::isResult($conversation)){
info(DI::l10n()->t('Conversation removed.') . EOL);
DI::baseUrl()->redirect('message');
}
@ -201,8 +198,8 @@ function message_content(App $a)
if (DBA::isResult($r)) {
$parent = $r[0]['parent-uri'];
if (DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
info(DI::l10n()->t('Conversation removed.') . EOL);
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
notice(DI::l10n()->t('Conversation was not removed.'));
}
}
DI::baseUrl()->redirect('message');
@ -301,7 +298,7 @@ function message_content(App $a)
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
if (!DBA::isResult($r)) {
info(DI::l10n()->t('No messages.') . EOL);
notice(DI::l10n()->t('No messages.'));
return $o;
}
@ -358,7 +355,7 @@ function message_content(App $a)
}
if (!DBA::isResult($messages)) {
notice(DI::l10n()->t('Message not available.') . EOL);
notice(DI::l10n()->t('Message not available.'));
return $o;
}

View file

@ -47,7 +47,7 @@ use Friendica\Util\Strings;
function network_init(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -305,7 +305,7 @@ function network_content(App $a, $update = 0, $parent = 0)
}
if ($o === '') {
info("No items found");
notice(DI::l10n()->t("No items found"));
}
return $o;
@ -548,7 +548,7 @@ function networkThreadedView(App $a, $update, $parent)
if ($update) {
exit();
}
notice(DI::l10n()->t('No such group') . EOL);
notice(DI::l10n()->t('No such group'));
DI::baseUrl()->redirect('network/0');
// NOTREACHED
}
@ -569,7 +569,7 @@ function networkThreadedView(App $a, $update, $parent)
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . Strings::protectSprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
} else {
$sql_extra3 .= " AND false ";
info(DI::l10n()->t('Group is empty'));
notice(DI::l10n()->t('Group is empty'));
}
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
@ -598,7 +598,7 @@ function networkThreadedView(App $a, $update, $parent)
'id' => 'network',
]) . $o;
} else {
notice(DI::l10n()->t('Invalid contact.') . EOL);
notice(DI::l10n()->t('Invalid contact.'));
DI::baseUrl()->redirect('network');
// NOTREACHED
}

View file

@ -40,7 +40,7 @@ function notes_init(App $a)
function notes_content(App $a, $update = false)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}

View file

@ -23,7 +23,6 @@ use Friendica\App;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Module\Security\Login;
use Friendica\Util\Network;
use Friendica\Util\Strings;
function oexchange_init(App $a) {
@ -45,7 +44,6 @@ function oexchange_content(App $a) {
}
if (($a->argc > 1) && $a->argv[1] === 'done') {
info(DI::l10n()->t('Post successful.') . EOL);
return;
}
@ -58,7 +56,7 @@ function oexchange_content(App $a) {
$tags = ((!empty($_REQUEST['tags']))
? '&tags=' . urlencode(Strings::escapeTags(trim($_REQUEST['tags']))) : '');
$s = Network::fetchUrl(DI::baseUrl() . '/parse_url?url=' . $url . $title . $description . $tags);
$s = DI::httpRequest()->fetch(DI::baseUrl() . '/parse_url?url=' . $url . $title . $description . $tags);
if (!strlen($s)) {
return;

View file

@ -23,12 +23,11 @@ use Friendica\App;
use Friendica\Core\Protocol;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Util\Network;
function ostatus_subscribe_content(App $a)
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('ostatus_subscribe');
// NOTREACHED
}
@ -55,7 +54,7 @@ function ostatus_subscribe_content(App $a)
$api = $contact['baseurl'] . '/api/';
// Fetching friends
$curlResult = Network::curl($api . 'statuses/friends.json?screen_name=' . $contact['nick']);
$curlResult = DI::httpRequest()->get($api . 'statuses/friends.json?screen_name=' . $contact['nick']);
if (!$curlResult->isSuccess()) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');

View file

@ -28,7 +28,7 @@ use Friendica\Content\PageInfo;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Util\Network;
use Friendica\DI;
use Friendica\Util\ParseUrl;
use Friendica\Util\Strings;
@ -85,7 +85,7 @@ function parse_url_content(App $a)
// Check if the URL is an image, video or audio file. If so format
// the URL with the corresponding BBCode media tag
// Fetch the header of the URL
$curlResponse = Network::curl($url, false, ['novalidate' => true, 'nobody' => true]);
$curlResponse = DI::httpRequest()->get($url, false, ['novalidate' => true, 'nobody' => true]);
if ($curlResponse->isSuccess()) {
// Convert the header fields into an array

View file

@ -175,14 +175,14 @@ function photos_post(App $a)
}
if (!$can_post) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
exit();
}
$owner_record = User::getOwnerDataById($page_owner_uid);
if (!$owner_record) {
notice(DI::l10n()->t('Contact information unavailable') . EOL);
notice(DI::l10n()->t('Contact information unavailable'));
Logger::log('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
exit();
}
@ -204,7 +204,7 @@ function photos_post(App $a)
);
if (!DBA::isResult($r)) {
notice(DI::l10n()->t('Album not found.') . EOL);
notice(DI::l10n()->t('Album not found.'));
DI::baseUrl()->redirect('photos/' . $a->data['user']['nickname'] . '/album');
return; // NOTREACHED
}
@ -295,9 +295,8 @@ function photos_post(App $a)
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
notice('Successfully deleted the photo.');
} else {
notice('Failed to delete the photo.');
notice(DI::l10n()->t('Failed to delete the photo.'));
DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
}
@ -676,21 +675,21 @@ function photos_post(App $a)
if ($error !== UPLOAD_ERR_OK) {
switch ($error) {
case UPLOAD_ERR_INI_SIZE:
notice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
notice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize')));
break;
case UPLOAD_ERR_FORM_SIZE:
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)) . EOL);
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)));
break;
case UPLOAD_ERR_PARTIAL:
notice(DI::l10n()->t('Image upload didn\'t complete, please try again') . EOL);
notice(DI::l10n()->t('Image upload didn\'t complete, please try again'));
break;
case UPLOAD_ERR_NO_FILE:
notice(DI::l10n()->t('Image file is missing') . EOL);
notice(DI::l10n()->t('Image file is missing'));
break;
case UPLOAD_ERR_NO_TMP_DIR:
case UPLOAD_ERR_CANT_WRITE:
case UPLOAD_ERR_EXTENSION:
notice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
notice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator'));
break;
}
@unlink($src);
@ -706,7 +705,7 @@ function photos_post(App $a)
$maximagesize = DI::config()->get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) {
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end', $foo);
@ -714,7 +713,7 @@ function photos_post(App $a)
}
if (!$filesize) {
notice(DI::l10n()->t('Image file is empty.') . EOL);
notice(DI::l10n()->t('Image file is empty.'));
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end', $foo);
@ -729,7 +728,7 @@ function photos_post(App $a)
if (!$image->isValid()) {
Logger::log('mod/photos.php: photos_post(): unable to process image' , Logger::DEBUG);
notice(DI::l10n()->t('Unable to process image.') . EOL);
notice(DI::l10n()->t('Unable to process image.'));
@unlink($src);
$foo = 0;
Hook::callAll('photo_post_end',$foo);
@ -758,7 +757,7 @@ function photos_post(App $a)
if (!$r) {
Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG);
notice(DI::l10n()->t('Image upload failed.') . EOL);
notice(DI::l10n()->t('Image upload failed.'));
return;
}
@ -841,12 +840,12 @@ function photos_content(App $a)
// photos/name/image/xxxxx/drop
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
notice(DI::l10n()->t('Public access denied.') . EOL);
notice(DI::l10n()->t('Public access denied.'));
return;
}
if (empty($a->data['user'])) {
notice(DI::l10n()->t('No photos selected') . EOL);
notice(DI::l10n()->t('No photos selected'));
return;
}
@ -912,7 +911,7 @@ function photos_content(App $a)
}
if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
notice(DI::l10n()->t('Access to this item is restricted.') . EOL);
notice(DI::l10n()->t('Access to this item is restricted.'));
return;
}
@ -1137,7 +1136,7 @@ function photos_content(App $a)
if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) {
notice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
} else {
notice(DI::l10n()->t('Photo not available') . EOL);
notice(DI::l10n()->t('Photo not available'));
}
return;
}

View file

@ -24,7 +24,6 @@ use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\PushSubscriber;
use Friendica\Util\Network;
use Friendica\Util\Strings;
function post_var($name) {
@ -126,7 +125,7 @@ function pubsubhubbub_init(App $a) {
$hub_callback = rtrim($hub_callback, ' ?&#');
$separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
$fetchResult = Network::fetchUrlFull($hub_callback . $separator . $params);
$fetchResult = DI::httpRequest()->fetchFull($hub_callback . $separator . $params);
$body = $fetchResult->getBody();
$ret = $fetchResult->getReturnCode();

View file

@ -27,7 +27,6 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\Network;
use Friendica\Util\Strings;
function redir_init(App $a) {
@ -171,7 +170,7 @@ function redir_magic($a, $cid, $url)
}
// Test for magic auth on the target system
$serverret = Network::curl($basepath . '/magic');
$serverret = DI::httpRequest()->get($basepath . '/magic');
if ($serverret->isSuccess()) {
$separator = strpos($target_url, '?') ? '&' : '?';
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);

View file

@ -28,7 +28,7 @@ use Friendica\Model\Contact;
function repair_ostatus_content(App $a) {
if (! local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('ostatus_repair');
// NOTREACHED
}

View file

@ -63,7 +63,7 @@ function settings_post(App $a)
}
if (count($a->user) && !empty($a->user['uid']) && $a->user['uid'] != local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -198,13 +198,10 @@ function settings_post(App $a)
unset($dcrpass);
if (!$mbox) {
$failed = true;
notice(DI::l10n()->t('Failed to connect with email account using the settings provided.') . EOL);
notice(DI::l10n()->t('Failed to connect with email account using the settings provided.'));
}
}
}
if (!$failed) {
info(DI::l10n()->t('Email settings updated.') . EOL);
}
}
}
@ -219,7 +216,6 @@ function settings_post(App $a)
DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
}
}
info(DI::l10n()->t('Features updated') . EOL);
return;
}
@ -231,7 +227,7 @@ function settings_post(App $a)
// was there an error
if ($_FILES['importcontact-filename']['error'] > 0) {
Logger::notice('Contact CSV file upload error');
info(DI::l10n()->t('Contact CSV file upload error'));
notice(DI::l10n()->t('Contact CSV file upload error'));
} else {
$csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name']));
// import contacts
@ -424,10 +420,10 @@ function settings_post(App $a)
$hidewall = 1;
if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) {
if ($def_gid) {
info(DI::l10n()->t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
info(DI::l10n()->t('Private forum has no privacy permissions. Using default privacy group.'));
$str_group_allow = '<' . $def_gid . '>';
} else {
notice(DI::l10n()->t('Private forum has no privacy permissions and no default privacy group.') . EOL);
notice(DI::l10n()->t('Private forum has no privacy permissions and no default privacy group.'));
}
}
}
@ -443,8 +439,8 @@ function settings_post(App $a)
$fields['openidserver'] = '';
}
if (DBA::update('user', $fields, ['uid' => local_user()])) {
info(DI::l10n()->t('Settings updated.') . EOL);
if (!DBA::update('user', $fields, ['uid' => local_user()])) {
notice(DI::l10n()->t('Settings were not updated.'));
}
// clear session language
@ -489,12 +485,12 @@ function settings_content(App $a)
Nav::setSelected('settings');
if (!local_user()) {
//notice(DI::l10n()->t('Permission denied.') . EOL);
//notice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
if (!empty($_SESSION['submanage'])) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -722,7 +718,7 @@ function settings_content(App $a)
$profile = DBA::selectFirst('profile', [], ['uid' => local_user()]);
if (!DBA::isResult($profile)) {
notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.') . EOL);
notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
return;
}

View file

@ -51,7 +51,7 @@ function suggest_content(App $a)
$o = '';
if (! local_user()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}

View file

@ -44,7 +44,6 @@ function tagrm_post(App $a)
$item_id = $_POST['item'] ?? 0;
update_tags($item_id, $tags);
info(DI::l10n()->t('Tag(s) removed') . EOL);
DI::baseUrl()->redirect($_SESSION['photo_return']);
// NOTREACHED

View file

@ -29,7 +29,7 @@ use Friendica\DI;
function uimport_post(App $a)
{
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -42,7 +42,7 @@ function uimport_post(App $a)
function uimport_content(App $a)
{
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.') . EOL);
notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.'));
return;
}
@ -51,7 +51,7 @@ function uimport_content(App $a)
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) {
Logger::log('max daily registrations exceeded.');
notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
return;
}
}

View file

@ -79,7 +79,6 @@ function unfollow_post(App $a)
$return_path = $base_return_path . '/' . $contact['id'];
}
info(DI::l10n()->t('Contact unfollowed'));
DI::baseUrl()->redirect($return_path);
// NOTREACHED
}

View file

@ -126,7 +126,7 @@ function videos_content(App $a)
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
notice(DI::l10n()->t('Public access denied.') . EOL);
notice(DI::l10n()->t('Public access denied.'));
return;
}
@ -179,7 +179,7 @@ function videos_content(App $a)
}
if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
notice(DI::l10n()->t('Access to this item is restricted.') . EOL);
notice(DI::l10n()->t('Access to this item is restricted.'));
return;
}

View file

@ -106,7 +106,7 @@ function wall_attach_post(App $a) {
if ($r_json) {
echo json_encode(['error' => $msg]);
} else {
notice($msg . EOL);
notice($msg);
}
@unlink($src);
exit();

View file

@ -99,7 +99,7 @@ function wall_upload_post(App $a, $desktopmode = true)
echo json_encode(['error' => DI::l10n()->t('Permission denied.')]);
exit();
}
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
exit();
}
@ -159,7 +159,7 @@ function wall_upload_post(App $a, $desktopmode = true)
echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
exit();
}
notice(DI::l10n()->t('Invalid request.').EOL);
notice(DI::l10n()->t('Invalid request.'));
exit();
}

View file

@ -32,7 +32,7 @@ function wallmessage_post(App $a) {
$replyto = Profile::getMyURL();
if (!$replyto) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -56,7 +56,7 @@ function wallmessage_post(App $a) {
$user = $r[0];
if (! intval($user['unkmail'])) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -73,19 +73,17 @@ function wallmessage_post(App $a) {
switch ($ret) {
case -1:
notice(DI::l10n()->t('No recipient selected.') . EOL);
notice(DI::l10n()->t('No recipient selected.'));
break;
case -2:
notice(DI::l10n()->t('Unable to check your home location.') . EOL);
notice(DI::l10n()->t('Unable to check your home location.'));
break;
case -3:
notice(DI::l10n()->t('Message could not be sent.') . EOL);
notice(DI::l10n()->t('Message could not be sent.'));
break;
case -4:
notice(DI::l10n()->t('Message collection failure.') . EOL);
notice(DI::l10n()->t('Message collection failure.'));
break;
default:
info(DI::l10n()->t('Message sent.') . EOL);
}
DI::baseUrl()->redirect('profile/'.$user['nickname']);
@ -95,14 +93,14 @@ function wallmessage_post(App $a) {
function wallmessage_content(App $a) {
if (!Profile::getMyURL()) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}
$recipient = (($a->argc > 1) ? $a->argv[1] : '');
if (!$recipient) {
notice(DI::l10n()->t('No recipient.') . EOL);
notice(DI::l10n()->t('No recipient.'));
return;
}
@ -111,7 +109,7 @@ function wallmessage_content(App $a) {
);
if (! DBA::isResult($r)) {
notice(DI::l10n()->t('No recipient.') . EOL);
notice(DI::l10n()->t('No recipient.'));
Logger::log('wallmessage: no recipient');
return;
}
@ -119,7 +117,7 @@ function wallmessage_content(App $a) {
$user = $r[0];
if (!intval($user['unkmail'])) {
notice(DI::l10n()->t('Permission denied.') . EOL);
notice(DI::l10n()->t('Permission denied.'));
return;
}