$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;
}
if ($mode == 'export') {
if (!$owner_uid) {
- notice(DI::l10n()->t('User not found'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
return;
}
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
$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;
}
$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;
}
$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.'));
}
}
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.'));
}
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();
}
}
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');
$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
}
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 = '';
}
}
// 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' => ''];
}
$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 = '';
}
$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
}
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);
}
}
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);
}
// 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);
}
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);
}
$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);
}
$item = Post::selectFirstForUser(local_user(), $fields, ['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');
}
item_redirect_after_action($item, $return);
} 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
}
$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();
}
$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();
}
];
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();
}
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 '';
}
function message_post(App $a)
{
if (!local_user()) {
- notice(DI::l10n()->t('Permission denied.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
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;
}
Nav::setSelected('messages');
if (!local_user()) {
- notice(DI::l10n()->t('Permission denied.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
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()]);
$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');
$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;
}
}
if (!DBA::isResult($messages)) {
- notice(DI::l10n()->t('Message not available.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Message not available.'));
return $o;
}
function notes_content(App $a, $update = false)
{
if (!local_user()) {
- notice(DI::l10n()->t('Permission denied.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
$ret = [];
Hook::callAll('home_init', $ret);
- notice($this->t('You are now logged in as %s', $user['username']));
+ DI::sysmsg()->addNotice($this->t('You are now logged in as %s', $user['username']));
DI::baseUrl()->redirect('network');
}