Merge branch 'develop' into rewrite/gravity-constants
This commit is contained in:
commit
26e0469de7
181 changed files with 2408 additions and 2405 deletions
|
@ -119,7 +119,7 @@ function cal_content(App $a)
|
|||
$is_owner = local_user() == $owner['uid'];
|
||||
|
||||
if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
|
||||
notice(DI::l10n()->t('Access to this profile has been restricted.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ function cal_content(App $a)
|
|||
|
||||
if ($mode == 'export') {
|
||||
if (!$owner_uid) {
|
||||
notice(DI::l10n()->t('User not found'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -271,9 +271,9 @@ function cal_content(App $a)
|
|||
|
||||
if (!$evexport["success"]) {
|
||||
if ($evexport["content"]) {
|
||||
notice(DI::l10n()->t('This calendar format is not supported'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('This calendar format is not supported'));
|
||||
} else {
|
||||
notice(DI::l10n()->t('No exportable data found'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No exportable data found'));
|
||||
}
|
||||
|
||||
// If it the own calendar return to the events page
|
||||
|
|
|
@ -35,14 +35,14 @@ function editpost_content(App $a)
|
|||
$o = '';
|
||||
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
||||
|
||||
if (!$post_id) {
|
||||
notice(DI::l10n()->t('Item not found'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ function editpost_content(App $a)
|
|||
$item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
|
||||
|
||||
if (!DBA::isResult($item)) {
|
||||
notice(DI::l10n()->t('Item not found'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ function events_post(App $a)
|
|||
$onerror_path = 'events/' . $action . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
|
||||
|
||||
if (strcmp($finish, $start) < 0 && !$nofinish) {
|
||||
notice(DI::l10n()->t('Event can not end before it has started.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Event can not end before it has started.'));
|
||||
if (intval($_REQUEST['preview'])) {
|
||||
System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ function events_post(App $a)
|
|||
}
|
||||
|
||||
if (!$summary || ($start === DBA::NULL_DATETIME)) {
|
||||
notice(DI::l10n()->t('Event title and start time are required.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Event title and start time are required.'));
|
||||
if (intval($_REQUEST['preview'])) {
|
||||
System::httpExit(DI::l10n()->t('Event title and start time are required.'));
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ function events_post(App $a)
|
|||
}
|
||||
|
||||
if (!$cid && $uri_id) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
|
||||
Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
|
||||
}
|
||||
|
||||
DI::baseUrl()->redirect('events');
|
||||
|
@ -215,7 +215,7 @@ function events_post(App $a)
|
|||
function events_content(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return Login::form();
|
||||
}
|
||||
|
||||
|
@ -532,7 +532,7 @@ function events_content(App $a)
|
|||
}
|
||||
|
||||
if (Post::exists(['id' => $ev[0]['itemid']])) {
|
||||
notice(DI::l10n()->t('Failed to remove event'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to remove event'));
|
||||
}
|
||||
|
||||
DI::baseUrl()->redirect('events');
|
||||
|
|
|
@ -53,7 +53,7 @@ function follow_content(App $a)
|
|||
$return_path = 'contact';
|
||||
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ function follow_content(App $a)
|
|||
|
||||
if (DBA::isResult($user_contact)) {
|
||||
if ($user_contact['pending']) {
|
||||
notice(DI::l10n()->t('You already added this contact.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('You already added this contact.'));
|
||||
$submit = '';
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ function follow_content(App $a)
|
|||
// Possibly it is a remote item and not an account
|
||||
follow_remote_item($url);
|
||||
|
||||
notice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
|
||||
$submit = '';
|
||||
$contact = ['url' => $url, 'network' => Protocol::PHANTOM, 'name' => $url, 'keywords' => ''];
|
||||
}
|
||||
|
@ -105,12 +105,12 @@ function follow_content(App $a)
|
|||
$protocol = Contact::getProtocol($contact['url'], $contact['network']);
|
||||
|
||||
if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) {
|
||||
notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
|
||||
$submit = '';
|
||||
}
|
||||
|
||||
if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) {
|
||||
notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
|
||||
$submit = '';
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ function follow_content(App $a)
|
|||
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
if (empty($owner)) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -181,14 +181,14 @@ function follow_process(App $a, string $url)
|
|||
follow_remote_item($url);
|
||||
|
||||
if ($result['message']) {
|
||||
notice($result['message']);
|
||||
DI::sysmsg()->addNotice($result['message']);
|
||||
}
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
} elseif ($result['cid']) {
|
||||
DI::baseUrl()->redirect('contact/' . $result['cid']);
|
||||
}
|
||||
|
||||
notice(DI::l10n()->t('The contact could not be added.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('The contact could not be added.'));
|
||||
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
}
|
||||
|
|
15
mod/item.php
15
mod/item.php
|
@ -36,6 +36,7 @@ use Friendica\Core\Logger;
|
|||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Attach;
|
||||
|
@ -128,7 +129,7 @@ function item_post(App $a) {
|
|||
}
|
||||
|
||||
if (!DBA::isResult($toplevel_item)) {
|
||||
notice(DI::l10n()->t('Unable to locate original post.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate original post.'));
|
||||
if ($return_path) {
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
}
|
||||
|
@ -178,7 +179,7 @@ function item_post(App $a) {
|
|||
// Now check that valid personal details have been provided
|
||||
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
|
||||
Logger::warning('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
if ($return_path) {
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
}
|
||||
|
@ -334,7 +335,7 @@ function item_post(App $a) {
|
|||
System::jsonExit(['preview' => '']);
|
||||
}
|
||||
|
||||
notice(DI::l10n()->t('Empty post discarded.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Empty post discarded.'));
|
||||
if ($return_path) {
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
}
|
||||
|
@ -632,7 +633,7 @@ function item_post(App $a) {
|
|||
unset($datarray['self']);
|
||||
unset($datarray['api_source']);
|
||||
|
||||
Post\Delayed::add($datarray['uri'], $datarray, PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at);
|
||||
Post\Delayed::add($datarray['uri'], $datarray, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at);
|
||||
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
||||
}
|
||||
}
|
||||
|
@ -681,7 +682,7 @@ function item_post(App $a) {
|
|||
$post_id = Item::insert($datarray);
|
||||
|
||||
if (!$post_id) {
|
||||
notice(DI::l10n()->t('Item wasn\'t stored.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Item wasn\'t stored.'));
|
||||
if ($return_path) {
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
}
|
||||
|
@ -837,7 +838,7 @@ function drop_item(int $id, string $return = ''): string
|
|||
$item = Post::selectFirstForUser(local_user(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]);
|
||||
|
||||
if (!DBA::isResult($item)) {
|
||||
notice(DI::l10n()->t('Item not found.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
|
||||
DI::baseUrl()->redirect('network');
|
||||
//NOTREACHED
|
||||
}
|
||||
|
@ -861,7 +862,7 @@ function drop_item(int $id, string $return = ''): string
|
|||
//NOTREACHED
|
||||
} else {
|
||||
Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect('display/' . $item['guid']);
|
||||
//NOTREACHED
|
||||
}
|
||||
|
|
|
@ -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.'));
|
||||
DI::sysmsg()->addNotice(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.'));
|
||||
DI::sysmsg()->addInfo(DI::l10n()->t('Password reset request issued. Check your email.'));
|
||||
}
|
||||
|
||||
$sitename = DI::config()->get('config', 'sitename');
|
||||
|
@ -97,7 +97,7 @@ function lostpass_content(App $a)
|
|||
|
||||
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => hash('sha256', $pwdreset_token)]);
|
||||
if (!DBA::isResult($user)) {
|
||||
notice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
||||
|
||||
return lostpass_form();
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ function lostpass_content(App $a)
|
|||
];
|
||||
DBA::update('user', $fields, ['uid' => $user['uid']]);
|
||||
|
||||
notice(DI::l10n()->t('Request has expired, please make a new one.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Request has expired, please make a new one.'));
|
||||
|
||||
return lostpass_form();
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ function lostpass_generate_password($user)
|
|||
'$newpass' => $new_password,
|
||||
]);
|
||||
|
||||
info(DI::l10n()->t("Your password has been reset."));
|
||||
DI::sysmsg()->addInfo(DI::l10n()->t("Your password has been reset."));
|
||||
|
||||
$sitename = DI::config()->get('config', 'sitename');
|
||||
$preamble = Strings::deindent(DI::l10n()->t('
|
||||
|
|
|
@ -59,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.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ function match_content(App $a)
|
|||
}
|
||||
|
||||
if (empty($entries)) {
|
||||
info(DI::l10n()->t('No matches'));
|
||||
DI::sysmsg()->addInfo(DI::l10n()->t('No matches'));
|
||||
}
|
||||
|
||||
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
|
||||
|
|
|
@ -66,7 +66,7 @@ function message_init(App $a)
|
|||
function message_post(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -80,20 +80,20 @@ function message_post(App $a)
|
|||
|
||||
switch ($ret) {
|
||||
case -1:
|
||||
notice(DI::l10n()->t('No recipient selected.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
|
||||
$norecip = true;
|
||||
break;
|
||||
|
||||
case -2:
|
||||
notice(DI::l10n()->t('Unable to locate contact information.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate contact information.'));
|
||||
break;
|
||||
|
||||
case -3:
|
||||
notice(DI::l10n()->t('Message could not be sent.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
|
||||
break;
|
||||
|
||||
case -4:
|
||||
notice(DI::l10n()->t('Message collection failure.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ function message_content(App $a)
|
|||
Nav::setSelected('messages');
|
||||
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return Login::form();
|
||||
}
|
||||
|
||||
|
@ -146,12 +146,12 @@ function message_content(App $a)
|
|||
if ($cmd === 'drop') {
|
||||
$message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
|
||||
if(!DBA::isResult($message)){
|
||||
notice(DI::l10n()->t('Conversation not found.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.'));
|
||||
DI::baseUrl()->redirect('message');
|
||||
}
|
||||
|
||||
if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => local_user()])) {
|
||||
notice(DI::l10n()->t('Message was not deleted.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.'));
|
||||
}
|
||||
|
||||
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
|
||||
|
@ -166,7 +166,7 @@ function message_content(App $a)
|
|||
$parent = $parentmail['parent-uri'];
|
||||
|
||||
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
|
||||
notice(DI::l10n()->t('Conversation was not removed.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.'));
|
||||
}
|
||||
}
|
||||
DI::baseUrl()->redirect('message');
|
||||
|
@ -222,7 +222,7 @@ function message_content(App $a)
|
|||
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
||||
|
||||
if (!DBA::isResult($r)) {
|
||||
notice(DI::l10n()->t('No messages.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No messages.'));
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ function message_content(App $a)
|
|||
}
|
||||
|
||||
if (!DBA::isResult($messages)) {
|
||||
notice(DI::l10n()->t('Message not available.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Message not available.'));
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ function notes_init(App $a)
|
|||
function notes_content(App $a, bool $update = false)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Protocol\ActivityPub;
|
|||
function ostatus_subscribe_content(App $a): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect('ostatus_subscribe');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
|
|
@ -157,14 +157,14 @@ function photos_post(App $a)
|
|||
}
|
||||
|
||||
if (!$can_post) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
System::exit();
|
||||
}
|
||||
|
||||
$owner_record = User::getOwnerDataById($page_owner_uid);
|
||||
|
||||
if (!$owner_record) {
|
||||
notice(DI::l10n()->t('Contact information unavailable'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Contact information unavailable'));
|
||||
DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
|
||||
System::exit();
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ function photos_post(App $a)
|
|||
$album = hex2bin(DI::args()->getArgv()[3]);
|
||||
|
||||
if (!DBA::exists('photo', ['album' => $album, 'uid' => $page_owner_uid, 'photo-type' => Photo::DEFAULT])) {
|
||||
notice(DI::l10n()->t('Album not found.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Album not found.'));
|
||||
DI::baseUrl()->redirect('photos/' . $user['nickname'] . '/album');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -247,9 +247,9 @@ function photos_post(App $a)
|
|||
|
||||
// Update the photo albums cache
|
||||
Photo::clearAlbumCache($page_owner_uid);
|
||||
notice(DI::l10n()->t('Album successfully deleted'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Album successfully deleted'));
|
||||
} else {
|
||||
notice(DI::l10n()->t('Album was empty.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Album was empty.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ function photos_post(App $a)
|
|||
// Update the photo albums cache
|
||||
Photo::clearAlbumCache($page_owner_uid);
|
||||
} else {
|
||||
notice(DI::l10n()->t('Failed to delete the photo.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to delete the photo.'));
|
||||
DI::baseUrl()->redirect('photos/' . DI::args()->getArgv()[1] . '/image/' . DI::args()->getArgv()[3]);
|
||||
}
|
||||
|
||||
|
@ -629,21 +629,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')));
|
||||
DI::sysmsg()->addNotice(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)));
|
||||
DI::sysmsg()->addNotice(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'));
|
||||
DI::sysmsg()->addNotice(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'));
|
||||
DI::sysmsg()->addNotice(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'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator'));
|
||||
break;
|
||||
}
|
||||
@unlink($src);
|
||||
|
@ -659,7 +659,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)));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
Hook::callAll('photo_post_end', $foo);
|
||||
|
@ -667,7 +667,7 @@ function photos_post(App $a)
|
|||
}
|
||||
|
||||
if (!$filesize) {
|
||||
notice(DI::l10n()->t('Image file is empty.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Image file is empty.'));
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
Hook::callAll('photo_post_end', $foo);
|
||||
|
@ -682,7 +682,7 @@ function photos_post(App $a)
|
|||
|
||||
if (!$image->isValid()) {
|
||||
Logger::notice('unable to process image');
|
||||
notice(DI::l10n()->t('Unable to process image.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image.'));
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
Hook::callAll('photo_post_end',$foo);
|
||||
|
@ -708,7 +708,7 @@ function photos_post(App $a)
|
|||
|
||||
if (!$r) {
|
||||
Logger::warning('image store failed');
|
||||
notice(DI::l10n()->t('Image upload failed.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Image upload failed.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -795,12 +795,12 @@ function photos_content(App $a)
|
|||
}
|
||||
|
||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
||||
notice(DI::l10n()->t('Public access denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($user)) {
|
||||
notice(DI::l10n()->t('No photos selected'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No photos selected'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -869,7 +869,7 @@ function photos_content(App $a)
|
|||
}
|
||||
|
||||
if ($user['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
|
||||
notice(DI::l10n()->t('Access to this item is restricted.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this item is restricted.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -884,7 +884,7 @@ function photos_content(App $a)
|
|||
// Display upload form
|
||||
if ($datatype === 'upload') {
|
||||
if (!$can_post) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1084,9 +1084,9 @@ function photos_content(App $a)
|
|||
|
||||
if (!DBA::isResult($ph)) {
|
||||
if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) {
|
||||
notice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
|
||||
} else {
|
||||
notice(DI::l10n()->t('Photo not available'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Photo not available'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ use Friendica\Model\Contact;
|
|||
function repair_ostatus_content(App $a) {
|
||||
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect('ostatus_repair');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ use Friendica\Protocol\Email;
|
|||
function settings_init(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ function settings_init(App $a)
|
|||
function settings_post(App $a)
|
||||
{
|
||||
if (!$a->isLoggedIn()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ function settings_post(App $a)
|
|||
$mbox = Email::connect($mb, $mail_user, $dcrpass);
|
||||
unset($dcrpass);
|
||||
if (!$mbox) {
|
||||
notice(DI::l10n()->t('Failed to connect with email account using the settings provided.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to connect with email account using the settings provided.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,12 +148,12 @@ function settings_content(App $a)
|
|||
Nav::setSelected('settings');
|
||||
|
||||
if (!local_user()) {
|
||||
//notice(DI::l10n()->t('Permission denied.'));
|
||||
//DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return Login::form();
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['submanage'])) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
|
@ -166,6 +166,6 @@ EOT;
|
|||
|
||||
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
|
||||
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
|
||||
Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
|
||||
System::exit();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\DI;
|
|||
function uimport_post(App $a)
|
||||
{
|
||||
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ function uimport_post(App $a)
|
|||
function uimport_content(App $a)
|
||||
{
|
||||
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
|
||||
notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ function uimport_content(App $a)
|
|||
$total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]);
|
||||
if ($total >= $max_dailies) {
|
||||
Logger::notice('max daily registrations exceeded.');
|
||||
notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ use Friendica\Util\Strings;
|
|||
function unfollow_post(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect('login');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ function unfollow_content(App $a)
|
|||
$base_return_path = 'contact';
|
||||
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect('login');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -62,13 +62,13 @@ function unfollow_content(App $a)
|
|||
$contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition);
|
||||
|
||||
if (!DBA::isResult($contact)) {
|
||||
notice(DI::l10n()->t("You aren't following this contact."));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t("You aren't following this contact."));
|
||||
DI::baseUrl()->redirect($base_return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
if (!Protocol::supportsFollow($contact['network'])) {
|
||||
notice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
|
||||
DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ function unfollow_content(App $a)
|
|||
$self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
|
||||
|
||||
if (!DBA::isResult($self)) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
DI::baseUrl()->redirect($base_return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ function unfollow_process(string $url)
|
|||
$contact = DBA::selectFirst('contact', [], $condition);
|
||||
|
||||
if (!DBA::isResult($contact)) {
|
||||
notice(DI::l10n()->t("You aren't following this contact."));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t("You aren't following this contact."));
|
||||
DI::baseUrl()->redirect($base_return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -146,6 +146,6 @@ function unfollow_process(string $url)
|
|||
$notice_message = DI::l10n()->t('Unable to unfollow this contact, please contact your administrator');
|
||||
}
|
||||
|
||||
notice($notice_message);
|
||||
DI::sysmsg()->addNotice($notice_message);
|
||||
DI::baseUrl()->redirect($return_path);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ function wall_attach_post(App $a) {
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
||||
}
|
||||
notice(DI::l10n()->t('Permission denied.') . EOL );
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
System::exit();
|
||||
}
|
||||
|
||||
|
@ -90,12 +90,12 @@ function wall_attach_post(App $a) {
|
|||
*/
|
||||
|
||||
if ($filesize <= 0) {
|
||||
$msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(DI::l10n()->t('Or - did you try to upload an empty file?'));
|
||||
$msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . '<br />' . (DI::l10n()->t('Or - did you try to upload an empty file?'));
|
||||
@unlink($src);
|
||||
if ($r_json) {
|
||||
System::jsonExit(['error' => $msg]);
|
||||
} else {
|
||||
notice($msg);
|
||||
DI::sysmsg()->addNotice($msg);
|
||||
}
|
||||
System::exit();
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ function wall_attach_post(App $a) {
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => $msg]);
|
||||
} else {
|
||||
echo $msg . EOL;
|
||||
echo $msg . '<br />';
|
||||
}
|
||||
System::exit();
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ function wall_attach_post(App $a) {
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => $msg]);
|
||||
} else {
|
||||
echo $msg . EOL;
|
||||
echo $msg . '<br />';
|
||||
}
|
||||
System::exit();
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
||||
}
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
System::exit();
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||
}
|
||||
notice(DI::l10n()->t('Invalid request.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Invalid request.'));
|
||||
System::exit();
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => $msg]);
|
||||
} else {
|
||||
echo $msg. EOL;
|
||||
echo $msg . '<br />';
|
||||
}
|
||||
System::exit();
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => $msg]);
|
||||
} else {
|
||||
echo $msg. EOL;
|
||||
echo $msg . '<br />';
|
||||
}
|
||||
System::exit();
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
|||
if ($r_json) {
|
||||
System::jsonExit(['error' => $msg]);
|
||||
} else {
|
||||
echo $msg. EOL;
|
||||
echo $msg . '<br />';
|
||||
}
|
||||
System::exit();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ function wallmessage_post(App $a) {
|
|||
|
||||
$replyto = Profile::getMyURL();
|
||||
if (!$replyto) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -53,13 +53,13 @@ function wallmessage_post(App $a) {
|
|||
}
|
||||
|
||||
if (!$user['unkmail']) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
|
||||
if ($total > $user['cntunkmail']) {
|
||||
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -67,16 +67,16 @@ function wallmessage_post(App $a) {
|
|||
|
||||
switch ($ret) {
|
||||
case -1:
|
||||
notice(DI::l10n()->t('No recipient selected.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
|
||||
break;
|
||||
case -2:
|
||||
notice(DI::l10n()->t('Unable to check your home location.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to check your home location.'));
|
||||
break;
|
||||
case -3:
|
||||
notice(DI::l10n()->t('Message could not be sent.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
|
||||
break;
|
||||
case -4:
|
||||
notice(DI::l10n()->t('Message collection failure.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -87,33 +87,33 @@ function wallmessage_post(App $a) {
|
|||
function wallmessage_content(App $a) {
|
||||
|
||||
if (!Profile::getMyURL()) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
|
||||
|
||||
if (!$recipient) {
|
||||
notice(DI::l10n()->t('No recipient.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$user = User::getByNickname($recipient);
|
||||
|
||||
if (empty($user)) {
|
||||
notice(DI::l10n()->t('No recipient.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient.'));
|
||||
Logger::notice('wallmessage: no recipient');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$user['unkmail']) {
|
||||
notice(DI::l10n()->t('Permission denied.'));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
|
||||
if ($total > $user['cntunkmail']) {
|
||||
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue