]> git.mxchange.org Git - friendica.git/commitdiff
The notice and info have been moved
authorMichael <heluecht@pirati.ca>
Mon, 17 Oct 2022 18:55:22 +0000 (18:55 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 17 Oct 2022 18:55:22 +0000 (18:55 +0000)
73 files changed:
boot.php
mod/lostpass.php
mod/match.php
mod/ostatus_subscribe.php
mod/photos.php
mod/repair_ostatus.php
mod/settings.php
mod/uimport.php
mod/unfollow.php
mod/wall_attach.php
mod/wall_upload.php
mod/wallmessage.php
src/BaseModule.php
src/Core/UserImport.php
src/Model/Group.php
src/Model/Profile.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Blocklist/Contact.php
src/Module/Admin/DBSync.php
src/Module/Admin/Item/Delete.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Storage.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Admin/Users/Active.php
src/Module/Admin/Users/Blocked.php
src/Module/Admin/Users/Create.php
src/Module/Admin/Users/Index.php
src/Module/Admin/Users/Pending.php
src/Module/Apps.php
src/Module/BaseAdmin.php
src/Module/BaseSearch.php
src/Module/Contact.php
src/Module/Contact/Advanced.php
src/Module/Contact/Profile.php
src/Module/Contact/Revoke.php
src/Module/Conversation/Community.php
src/Module/Conversation/Network.php
src/Module/Debug/Feed.php
src/Module/Directory.php
src/Module/Filer/SaveTag.php
src/Module/FollowConfirm.php
src/Module/FriendSuggest.php
src/Module/Group.php
src/Module/Invite.php
src/Module/Notifications/Introductions.php
src/Module/Notifications/Notification.php
src/Module/Profile/Profile.php
src/Module/Profile/Status.php
src/Module/Register.php
src/Module/RemoteFollow.php
src/Module/Search/Directory.php
src/Module/Search/Index.php
src/Module/Search/Saved.php
src/Module/Security/Logout.php
src/Module/Security/OpenID.php
src/Module/Security/TwoFactor/Recovery.php
src/Module/Security/TwoFactor/SignOut.php
src/Module/Security/TwoFactor/Trust.php
src/Module/Settings/Account.php
src/Module/Settings/Delegation.php
src/Module/Settings/Display.php
src/Module/Settings/Profile/Index.php
src/Module/Settings/Profile/Photo/Crop.php
src/Module/Settings/Profile/Photo/Index.php
src/Module/Settings/TwoFactor/AppSpecific.php
src/Module/Settings/TwoFactor/Index.php
src/Module/Settings/TwoFactor/Recovery.php
src/Module/Settings/TwoFactor/Trusted.php
src/Module/Settings/TwoFactor/Verify.php
src/Security/Authentication.php

index 6336c2e411b65a7936b4f690b0c697b5227006f9..24486f413c0b3888c537429c396016dcfff07873 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -126,33 +126,3 @@ function remote_user()
 
        return false;
 }
-
-/**
- * Show an error message to user.
- *
- * This function save text in session, to be shown to the user at next page load
- *
- * @param string $s - Text of notice
- *
- * @return void
- * @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead
- */
-function notice(string $s)
-{
-       \Friendica\DI::sysmsg()->addNotice($s);
-}
-
-/**
- * Show an info message to user.
- *
- * This function save text in session, to be shown to the user at next page load
- *
- * @param string $s - Text of notice
- *
- * @return void
- * @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead
- */
-function info(string $s)
-{
-       \Friendica\DI::sysmsg()->addInfo($s);
-}
index 150c170d7a47b53bae77ca428e7a523bde016db6..62b621b8ce24a66a7fa3ed3330144b40f85f79fb 100644 (file)
@@ -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');
@@ -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('
index 5a5d3be93d9941e67ce7ae6d8eb32eee8ad62d23..a1f7be77ce551b4b1fc86c94893484b35effaa53 100644 (file)
@@ -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');
index 781de3493addf9aa77a0ce4a58e9d36d1310b815..2ecea601668b2db5b975300243e1a5fafd3b6280 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Protocol\ActivityPub;
 function ostatus_subscribe_content(App $a)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect('ostatus_subscribe');
                // NOTREACHED
        }
index 6a4596bf2427616f8030383a14f521d7062ae9d0..047328aa53f168208884b775184eeebb52418ede 100644 (file)
@@ -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]);
                        }
 
@@ -633,21 +633,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);
@@ -663,7 +663,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);
@@ -671,7 +671,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);
@@ -686,7 +686,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);
@@ -712,7 +712,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;
        }
 
@@ -799,12 +799,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;
        }
 
@@ -873,7 +873,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;
        }
 
@@ -888,7 +888,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;
                }
 
@@ -1088,9 +1088,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;
                }
index b2ca6121853fea1f2e59aee1015da20cc3055f4f..bc2c8bba2d9ce36e147ebe30e67ed7611a863531 100644 (file)
@@ -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
        }
index 2e21c26824cda40987c484c45a278426fb5e150f..093572f18a2f4b8d59eecba6414d993efe96506e 100644 (file)
@@ -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 '';
        }
 
index fb1ef25c34c11186aa1bb2c9d7f9eab1a6500893..da024a56ecc0914548556d3763bb10bc0d196e12 100644 (file)
@@ -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;
                }
        }
index 10830bd103d29c51fb0d6f0bfb1bfa862e58bc17..61c88ee9e750ee261c58d1b0a6b33759b0ec6fd5 100644 (file)
@@ -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);
 }
index 43f4681df336e226c346f559f22bbf5ba66157d5..8341d72527ec602fd22668e7312e81a1b883c941 100644 (file)
@@ -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.') . EOL );
                System::exit();
        }
 
@@ -95,7 +95,7 @@ function wall_attach_post(App $a) {
                if ($r_json) {
                        System::jsonExit(['error' => $msg]);
                } else {
-                       notice($msg);
+                       DI::sysmsg()->addNotice($msg);
                }
                System::exit();
        }
index 4554c55aa88a2303ab99f291193f81512085ec85..befb0fceb5e80987c9e8409c4f5b1fa1762fddd2 100644 (file)
@@ -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();
        }
 
index e8f7d24e31e37abc4b2e45d60537a389972bbbbc..2b4b8d2a505ba1f630ac0aac73cd1777be682ed7 100644 (file)
@@ -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;
        }
 
index 99c297b7564fd36a98430f0e5413590d7b15191b..e532b95362dfc150d3e360be40b306c165af5170 100644 (file)
@@ -397,7 +397,7 @@ abstract class BaseModule implements ICanHandleRequests
                if (!self::checkFormSecurityToken($typename, $formname)) {
                        Logger::notice('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename);
                        Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
-                       notice(self::getFormSecurityStandardErrorMessage());
+                       DI::sysmsg()->addNotice(self::getFormSecurityStandardErrorMessage());
                        DI::baseUrl()->redirect($err_redirect);
                }
        }
index f8485fc293e08cc9a1a4d6c13ecf8eb01442899b..be7bbf0b575b44cf8d3561ad905dc3d3eedb7e76 100644 (file)
@@ -123,13 +123,13 @@ class UserImport
 
                $account = json_decode(file_get_contents($file['tmp_name']), true);
                if ($account === null) {
-                       notice(DI::l10n()->t("Error decoding account file"));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("Error decoding account file"));
                        return;
                }
 
 
                if (empty($account['version'])) {
-                       notice(DI::l10n()->t("Error! No version data in file! This is not a Friendica account file?"));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("Error! No version data in file! This is not a Friendica account file?"));
                        return;
                }
 
@@ -137,7 +137,7 @@ class UserImport
                // check if username matches deleted account
                if (DBA::exists('user', ['nickname' => $account['user']['nickname']])
                        || DBA::exists('userd', ['username' => $account['user']['nickname']])) {
-                       notice(DI::l10n()->t("User '%s' already exists on this server!", $account['user']['nickname']));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("User '%s' already exists on this server!", $account['user']['nickname']));
                        return;
                }
 
@@ -173,7 +173,7 @@ class UserImport
                $r = self::dbImportAssoc('user', $account['user']);
                if ($r === false) {
                        Logger::warning("uimport:insert user : ERROR : " . DBA::errorMessage());
-                       notice(DI::l10n()->t("User creation error"));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("User creation error"));
                        return;
                }
                $newuid = self::lastInsertId();
@@ -218,7 +218,7 @@ class UserImport
                        }
                }
                if ($errorcount > 0) {
-                       notice(DI::l10n()->tt("%d contact not imported", "%d contacts not imported", $errorcount));
+                       DI::sysmsg()->addNotice(DI::l10n()->tt("%d contact not imported", "%d contacts not imported", $errorcount));
                }
 
                foreach ($account['group'] as &$group) {
@@ -271,7 +271,7 @@ class UserImport
 
                                if ($r === false) {
                                        Logger::warning("uimport:insert profile: ERROR : " . DBA::errorMessage());
-                                       notice(DI::l10n()->t("User profile creation error"));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t("User profile creation error"));
                                        DBA::delete('user', ['uid' => $newuid]);
                                        DBA::delete('profile_field', ['uid' => $newuid]);
                                        return;
@@ -324,7 +324,7 @@ class UserImport
                // send relocate messages
                Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid);
 
-               info(DI::l10n()->t("Done. You can now login with your username and password"));
+               DI::sysmsg()->addInfo(DI::l10n()->t("Done. You can now login with your username and password"));
                DI::baseUrl()->redirect('login');
        }
 }
index 4dec84c3a3cb0ed7c826bbf5911f5f6ce6e586a0..3487ab53d2682fdd2dd8faf10b23d1b13754e263 100644 (file)
@@ -102,7 +102,7 @@ class Group
                                $group = DBA::selectFirst('group', ['deleted'], ['id' => $gid]);
                                if (DBA::isResult($group) && $group['deleted']) {
                                        DBA::update('group', ['deleted' => 0], ['id' => $gid]);
-                                       notice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.'));
                                }
                                return true;
                        }
index f6d189a103e50dffb8e3aa35be40f8fd8b7042bf..b58de4efb14b1daf8b427627a6ebc9a7f0483124 100644 (file)
@@ -865,7 +865,7 @@ class Profile
 
                $a->setContactId($arr['visitor']['id']);
 
-               info(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
+               DI::sysmsg()->addInfo(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
 
                Logger::info('OpenWebAuth: auth success from ' . $visitor['addr']);
        }
index 28435c545b0912819bd51cb16d53a90b03fd6c3f..be0e59e329e6b2f41eb412f8376f8885af089da7 100644 (file)
@@ -62,7 +62,7 @@ class Details extends BaseAdmin
 
                $addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
                if (!is_file("addon/$addon/$addon.php")) {
-                       notice(DI::l10n()->t('Addon not found.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Addon not found.'));
                        Addon::uninstall($addon);
                        DI::baseUrl()->redirect('admin/addons');
                }
@@ -73,10 +73,10 @@ class Details extends BaseAdmin
                        // Toggle addon status
                        if (Addon::isEnabled($addon)) {
                                Addon::uninstall($addon);
-                               info(DI::l10n()->t('Addon %s disabled.', $addon));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon));
                        } else {
                                Addon::install($addon);
-                               info(DI::l10n()->t('Addon %s enabled.', $addon));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s enabled.', $addon));
                        }
 
                        DI::baseUrl()->redirect('admin/addons/' . $addon);
index b9198ee361c26d8fb779c4d61610b29d617d8269..8db0b70ed4ed12f82c5c74ce1809425fb1ab4570 100644 (file)
@@ -39,18 +39,18 @@ class Index extends BaseAdmin
                        switch ($_GET['action']) {
                                case 'reload':
                                        Addon::reload();
-                                       info(DI::l10n()->t('Addons reloaded'));
+                                       DI::sysmsg()->addInfo(DI::l10n()->t('Addons reloaded'));
                                        break;
 
                                case 'toggle' :
                                        $addon = $_GET['addon'] ?? '';
                                        if (Addon::isEnabled($addon)) {
                                                Addon::uninstall($addon);
-                                               info(DI::l10n()->t('Addon %s disabled.', $addon));
+                                               DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon));
                                        } elseif (Addon::install($addon)) {
-                                               info(DI::l10n()->t('Addon %s enabled.', $addon));
+                                               DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s enabled.', $addon));
                                        } else {
-                                               notice(DI::l10n()->t('Addon %s failed to install.', $addon));
+                                               DI::sysmsg()->addNotice(DI::l10n()->t('Addon %s failed to install.', $addon));
                                        }
 
                                        break;
index 35a8a151d53be12a499a674412f144e7e68109f5..85e7f2146a9ad0d273baed9981000e4bb1d9d9a1 100644 (file)
@@ -46,12 +46,12 @@ class Contact extends BaseAdmin
                if (!empty($_POST['page_contactblock_block'])) {
                        $contact = Model\Contact::getByURL($contact_url, null, ['id', 'nurl']);
                        if (empty($contact)) {
-                               notice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url));
                                DI::baseUrl()->redirect('admin/blocklist/contact');
                        }
 
                        if (Network::isLocalLink($contact['nurl'])) {
-                               notice(DI::l10n()->t('You can\'t block a local contact, please block the user instead'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t block a local contact, please block the user instead'));
                                DI::baseUrl()->redirect('admin/blocklist/contact');
                        }
 
@@ -63,14 +63,14 @@ class Contact extends BaseAdmin
                                }
                        }
 
-                       info(DI::l10n()->t('The contact has been blocked from the node'));
+                       DI::sysmsg()->addInfo(DI::l10n()->t('The contact has been blocked from the node'));
                }
 
                if (!empty($_POST['page_contactblock_unblock'])) {
                        foreach ($contacts as $uid) {
                                Model\Contact::unblock($uid);
                        }
-                       info(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
                }
 
                DI::baseUrl()->redirect('admin/blocklist/contact');
index d5a16f9be293e79b17910888c0ffba5a0874dfe2..bb1fa903305552b7aa3af6c8a01d95e9b6abcf83 100644 (file)
@@ -48,7 +48,7 @@ class DBSync extends BaseAdmin
                                                DI::config()->set('system', 'build', intval($curr) + 1);
                                        }
 
-                                       info(DI::l10n()->t('Update has been marked successful'));
+                                       DI::sysmsg()->addInfo(DI::l10n()->t('Update has been marked successful'));
                                }
 
                                break;
index e5215605149b2d370264f066f0615dc39e3e6a54..d291e7b840a165cc2464753bc5994276cf5e5d89 100644 (file)
@@ -50,7 +50,7 @@ class Delete extends BaseAdmin
                        Item::markForDeletion(['guid' => $guid]);
                }
 
-               info(DI::l10n()->t('Item marked for deletion.'));
+               DI::sysmsg()->addInfo(DI::l10n()->t('Item marked for deletion.'));
                DI::baseUrl()->redirect('admin/item/delete');
        }
 
index 9dbc8f3528ab7844b1d928430aa4bb1d9a19ed26..e5324e6f68db77941e4b563eaf154f48063169e0 100644 (file)
@@ -44,7 +44,7 @@ class Settings extends BaseAdmin
 
                if (is_file($logfile) &&
                !is_writeable($logfile)) {
-                       notice(DI::l10n()->t('The logfile \'%s\' is not writable. No logging possible', $logfile));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('The logfile \'%s\' is not writable. No logging possible', $logfile));
                        return;
                }
 
index f54344f478a958e7cb218c8b89df837ede085083..2075534372e1169a6c2d306ded8211dab4ab381f 100644 (file)
@@ -43,7 +43,7 @@ class Storage extends BaseAdmin
                        /** @var ICanConfigureStorage|false $newStorageConfig */
                        $newStorageConfig = DI::storageManager()->getConfigurationByName($storagebackend);
                } catch (InvalidClassStorageException $storageException) {
-                       notice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend));
                        DI::baseUrl()->redirect('admin/storage');
                }
 
@@ -70,7 +70,7 @@ class Storage extends BaseAdmin
                        $storage_form_errors = $newStorageConfig->saveOptions($storage_opts_data);
                        if (count($storage_form_errors)) {
                                foreach ($storage_form_errors as $name => $err) {
-                                       notice(DI::l10n()->t('Storage backend %s error: %s', $storage_opts[$name][1], $err));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Storage backend %s error: %s', $storage_opts[$name][1], $err));
                                }
                                DI::baseUrl()->redirect('admin/storage');
                        }
@@ -81,10 +81,10 @@ class Storage extends BaseAdmin
                                $newstorage = DI::storageManager()->getWritableStorageByName($storagebackend);
 
                                if (!DI::storageManager()->setBackend($newstorage)) {
-                                       notice(DI::l10n()->t('Invalid storage backend setting value.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Invalid storage backend setting value.'));
                                }
                        } catch (InvalidClassStorageException $storageException) {
-                               notice(DI::l10n()->t('Invalid storage backend setting value.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Invalid storage backend setting value.'));
                        }
                }
 
index dc6bf58184496c60bc5e0f27cb8c283ec36f0e31..45573cbe6ec1a36c72e0db0c1eb6567b68e4dea8 100644 (file)
@@ -36,7 +36,7 @@ class Details extends BaseAdmin
 
                $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (!is_dir("view/theme/$theme")) {
-                       notice(DI::l10n()->t("Item not found."));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("Item not found."));
                        return '';
                }
 
@@ -54,11 +54,11 @@ class Details extends BaseAdmin
 
                        if ($isEnabled) {
                                Theme::uninstall($theme);
-                               info(DI::l10n()->t('Theme %s disabled.', $theme));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s disabled.', $theme));
                        } elseif (Theme::install($theme)) {
-                               info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s successfully enabled.', $theme));
                        } else {
-                               notice(DI::l10n()->t('Theme %s failed to install.', $theme));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Theme %s failed to install.', $theme));
                        }
 
                        DI::baseUrl()->redirect('admin/themes/' . $theme);
index 439e78e64258bda8863f3c0bef276d88f368acb4..756b90afa52cd942586581c0cdf2081c0e0eb45b 100644 (file)
@@ -77,7 +77,7 @@ class Embed extends BaseAdmin
 
                $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (!is_dir("view/theme/$theme")) {
-                       notice($this->t('Unknown theme.'));
+                       DI::sysmsg()->addNotice($this->t('Unknown theme.'));
                        return '';
                }
 
index cf0ddcfc6ea7a604067dbafdac81ed1f75517f4e..4dde4f856b4117f4ccf93ae648fe365cc1e89790 100644 (file)
@@ -48,7 +48,7 @@ class Index extends BaseAdmin
                                        }
                                        Theme::setAllowedList($allowed_themes);
 
-                                       info(DI::l10n()->t('Themes reloaded'));
+                                       DI::sysmsg()->addInfo(DI::l10n()->t('Themes reloaded'));
                                        break;
 
                                case 'toggle' :
@@ -56,17 +56,17 @@ class Index extends BaseAdmin
                                        if ($theme) {
                                                $theme = Strings::sanitizeFilePathItem($theme);
                                                if (!is_dir("view/theme/$theme")) {
-                                                       notice(DI::l10n()->t('Item not found.'));
+                                                       DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
                                                        return '';
                                                }
 
                                                if (in_array($theme, Theme::getAllowedList())) {
                                                        Theme::uninstall($theme);
-                                                       info(DI::l10n()->t('Theme %s disabled.', $theme));
+                                                       DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s disabled.', $theme));
                                                } elseif (Theme::install($theme)) {
-                                                       info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
+                                                       DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s successfully enabled.', $theme));
                                                } else {
-                                                       notice(DI::l10n()->t('Theme %s failed to install.', $theme));
+                                                       DI::sysmsg()->addNotice(DI::l10n()->t('Theme %s failed to install.', $theme));
                                                }
                                        }
 
index eac12063e45269f4277130c5ae4bbfe8be52fd3d..2188d4a5919bf71af56839d65393a91337b1fef7 100644 (file)
@@ -42,7 +42,7 @@ class Active extends BaseUsers
                        foreach ($users as $uid) {
                                User::block($uid);
                        }
-                       info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
                }
 
                if (!empty($_POST['page_users_delete'])) {
@@ -50,11 +50,11 @@ class Active extends BaseUsers
                                if (local_user() != $uid) {
                                        User::remove($uid);
                                } else {
-                                       notice(DI::l10n()->t('You can\'t remove yourself'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
                                }
                        }
 
-                       info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
                }
 
                DI::baseUrl()->redirect(DI::args()->getQueryString());
@@ -70,7 +70,7 @@ class Active extends BaseUsers
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
                        if (!DBA::isResult($user)) {
-                               notice(DI::l10n()->t('User not found'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
                                DI::baseUrl()->redirect('admin/users');
                                return ''; // NOTREACHED
                        }
@@ -83,9 +83,9 @@ class Active extends BaseUsers
                                        // delete user
                                        User::remove($uid);
 
-                                       notice(DI::l10n()->t('User "%s" deleted', $user['username']));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username']));
                                } else {
-                                       notice(DI::l10n()->t('You can\'t remove yourself'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
                                }
 
                                DI::baseUrl()->redirect('admin/users/active');
@@ -93,7 +93,7 @@ class Active extends BaseUsers
                        case 'block':
                                self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't');
                                User::block($uid);
-                               notice(DI::l10n()->t('User "%s" blocked', $user['username']));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" blocked', $user['username']));
                                DI::baseUrl()->redirect('admin/users/active');
                                break;
                }
index 63294f17c2aad258087807f62f779a77d9e577af..e8434d5e09063a877e86882bc321a0f86b698f17 100644 (file)
@@ -43,7 +43,7 @@ class Blocked extends BaseUsers
                        foreach ($users as $uid) {
                                User::block($uid, false);
                        }
-                       info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
                }
 
                if (!empty($_POST['page_users_delete'])) {
@@ -51,11 +51,11 @@ class Blocked extends BaseUsers
                                if (local_user() != $uid) {
                                        User::remove($uid);
                                } else {
-                                       notice(DI::l10n()->t('You can\'t remove yourself'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
                                }
                        }
 
-                       info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
                }
 
                DI::baseUrl()->redirect('admin/users/blocked');
@@ -71,7 +71,7 @@ class Blocked extends BaseUsers
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
                        if (!DBA::isResult($user)) {
-                               notice(DI::l10n()->t('User not found'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
                                DI::baseUrl()->redirect('admin/users');
                                return ''; // NOTREACHED
                        }
@@ -84,16 +84,16 @@ class Blocked extends BaseUsers
                                        // delete user
                                        User::remove($uid);
 
-                                       notice(DI::l10n()->t('User "%s" deleted', $user['username']));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username']));
                                } else {
-                                       notice(DI::l10n()->t('You can\'t remove yourself'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
                                }
                                DI::baseUrl()->redirect('admin/users/blocked');
                                break;
                        case 'unblock':
                                self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
                                User::block($uid, false);
-                               notice(DI::l10n()->t('User "%s" unblocked', $user['username']));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" unblocked', $user['username']));
                                DI::baseUrl()->redirect('admin/users/blocked');
                                break;
                }
index 5ab443b14811349d62843db932309a83755b0d66..29dbf5d7ee822ff69372aba1846b05b4295922a0 100644 (file)
@@ -44,7 +44,7 @@ class Create extends BaseUsers
                                User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language);
                                DI::baseUrl()->redirect('admin/users');
                        } catch (\Exception $ex) {
-                               notice($ex->getMessage());
+                               DI::sysmsg()->addNotice($ex->getMessage());
                        }
                }
 
index 8dfac505735aa0312975d4ad4df5ef33c807995f..e8356720d4eb9a5abfa7bc143a9d53a64c8bdfe9 100644 (file)
@@ -42,14 +42,14 @@ class Index extends BaseUsers
                        foreach ($users as $uid) {
                                User::block($uid);
                        }
-                       info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
                }
 
                if (!empty($_POST['page_users_unblock'])) {
                        foreach ($users as $uid) {
                                User::block($uid, false);
                        }
-                       info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
                }
 
                if (!empty($_POST['page_users_delete'])) {
@@ -57,11 +57,11 @@ class Index extends BaseUsers
                                if (local_user() != $uid) {
                                        User::remove($uid);
                                } else {
-                                       notice(DI::l10n()->t('You can\'t remove yourself'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
                                }
                        }
 
-                       info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
                }
 
                DI::baseUrl()->redirect(DI::args()->getQueryString());
@@ -77,7 +77,7 @@ class Index extends BaseUsers
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
                        if (!DBA::isResult($user)) {
-                               notice(DI::l10n()->t('User not found'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
                                DI::baseUrl()->redirect('admin/users');
                                return ''; // NOTREACHED
                        }
@@ -90,9 +90,9 @@ class Index extends BaseUsers
                                        // delete user
                                        User::remove($uid);
 
-                                       notice(DI::l10n()->t('User "%s" deleted', $user['username']));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username']));
                                } else {
-                                       notice(DI::l10n()->t('You can\'t remove yourself'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
                                }
 
                                DI::baseUrl()->redirect('admin/users');
@@ -100,13 +100,13 @@ class Index extends BaseUsers
                        case 'block':
                                self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't');
                                User::block($uid);
-                               notice(DI::l10n()->t('User "%s" blocked', $user['username']));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" blocked', $user['username']));
                                DI::baseUrl()->redirect('admin/users');
                                break;
                        case 'unblock':
                                self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't');
                                User::block($uid, false);
-                               notice(DI::l10n()->t('User "%s" unblocked', $user['username']));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" unblocked', $user['username']));
                                DI::baseUrl()->redirect('admin/users');
                                break;
                }
index b5b164bb578464cb8170724848f6245b00bd7ff8..484a128ebf7aa2b3555d195a876fb31c6889791c 100644 (file)
@@ -45,14 +45,14 @@ class Pending extends BaseUsers
                        foreach ($pending as $hash) {
                                User::allow($hash);
                        }
-                       info(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
                }
 
                if (!empty($_POST['page_users_deny'])) {
                        foreach ($pending as $hash) {
                                User::deny($hash);
                        }
-                       info(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
                }
 
                DI::baseUrl()->redirect('admin/users/pending');
@@ -68,7 +68,7 @@ class Pending extends BaseUsers
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
                        if (!DBA::isResult($user)) {
-                               notice(DI::l10n()->t('User not found'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
                                DI::baseUrl()->redirect('admin/users');
                                return ''; // NOTREACHED
                        }
@@ -78,13 +78,13 @@ class Pending extends BaseUsers
                        case 'allow':
                                self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
                                User::allow(Register::getPendingForUser($uid)['hash'] ?? '');
-                               notice(DI::l10n()->t('Account approved.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Account approved.'));
                                DI::baseUrl()->redirect('admin/users/pending');
                                break;
                        case 'deny':
                                self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
                                User::deny(Register::getPendingForUser($uid)['hash'] ?? '');
-                               notice(DI::l10n()->t('Registration revoked'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Registration revoked'));
                                DI::baseUrl()->redirect('admin/users/pending');
                                break;
                }
index db5636bf9645e6f6602c8419f60136cfa9c64f59..9ef4268de53a348ab2a3e23780b4065e28745783 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Content\Nav;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Util\Profiler;
 use Psr\Log\LoggerInterface;
 
@@ -51,7 +52,7 @@ class Apps extends BaseModule
                $apps = Nav::getAppMenu();
 
                if (count($apps) == 0) {
-                       notice($this->t('No installed applications.'));
+                       DI::sysmsg()->addNotice($this->t('No installed applications.'));
                }
 
                $tpl = Renderer::getMarkupTemplate('apps.tpl');
index 713c44cc200ccfb5c413159d86f3bfb0943a593f..dd4e108e77677432ff5f7f7c1cd26b509ace93aa 100644 (file)
@@ -54,7 +54,7 @@ abstract class BaseAdmin extends BaseModule
        {
                if (!local_user()) {
                        if ($interactive) {
-                               notice(DI::l10n()->t('Please login to continue.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Please login to continue.'));
                                Session::set('return_path', DI::args()->getQueryString());
                                DI::baseUrl()->redirect('login');
                        } else {
index 276598131b6411513fef1eb3b1fae9655bf519d1..f14a93b0ff5148dec89cdaf6eb71b179dd270208 100644 (file)
@@ -116,7 +116,7 @@ class BaseSearch extends BaseModule
        protected static function printResult(ResultList $results, Pager $pager, string $header = ''): string
        {
                if ($results->getTotal() == 0) {
-                       notice(DI::l10n()->t('No matches'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No matches'));
                        return '';
                }
 
index 4f565a87176d7448a2ae9e9f32207ceea1bf1cbf..97f4b7e258b3f85e753e96c4f25dec2797b82851 100644 (file)
@@ -85,7 +85,7 @@ class Contact extends BaseModule
                        }
                }
                if ($count_actions > 0) {
-                       info(DI::l10n()->tt('%d contact edited.', '%d contacts edited.', $count_actions));
+                       DI::sysmsg()->addInfo(DI::l10n()->tt('%d contact edited.', '%d contacts edited.', $count_actions));
                }
 
                DI::baseUrl()->redirect($redirectUrl);
index bbb1d59e0d671142987449790811b6af76c22f2c..d722691ff7a6d878ba7ba064e751305030942253 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\Database\Database;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module\Contact;
 use Friendica\Module\Response;
@@ -96,7 +97,7 @@ class Advanced extends BaseModule
                }
 
                if (!$r) {
-                       notice($this->t('Contact update failed.'));
+                       DI::sysmsg()->addNotice($this->t('Contact update failed.'));
                }
        }
 
index 793d0fa4a9c84ea027f81c64d8dd591a310155d0..3af591a066fe62555feea1c24e7a8280a7924be8 100644 (file)
@@ -35,6 +35,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Module;
@@ -124,7 +125,7 @@ class Profile extends BaseModule
                }
 
                if (!Contact::update($fields, ['id' => $cdata['user'], 'uid' => local_user()])) {
-                       notice($this->t('Failed to update contact record.'));
+                       DI::sysmsg()->addNotice($this->t('Failed to update contact record.'));
                }
        }
 
@@ -182,7 +183,7 @@ class Profile extends BaseModule
                                }
 
                                // @TODO: add $this->localRelationship->save($localRelationship);
-                               info($message);
+                               DI::sysmsg()->addInfo($message);
                        }
 
                        if ($cmd === 'ignore') {
@@ -198,7 +199,7 @@ class Profile extends BaseModule
                                }
 
                                // @TODO: add $this->localRelationship->save($localRelationship);
-                               info($message);
+                               DI::sysmsg()->addInfo($message);
                        }
 
                        $this->baseUrl->redirect('contact/' . $contact['id']);
index 35cb48149543686a6d1a046ee2926009fea18d66..4ade2b146a25781d91af4a0ee735b766146de719 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Database\Database;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module\Contact;
 use Friendica\Module\Response;
@@ -87,7 +88,7 @@ class Revoke extends BaseModule
 
                Model\Contact::revokeFollow($this->contact);
 
-               notice($this->t('Follow was successfully revoked.'));
+               DI::sysmsg()->addNotice($this->t('Follow was successfully revoked.'));
 
                $this->baseUrl->redirect('contact/' . $this->parameters['id']);
        }
index 3ba95e1effeb1e0067e8adb851dfee91b58ead9c..a5bfe41908bb267cf9f2b4168eee1716c2fcc3d6 100644 (file)
@@ -155,7 +155,7 @@ class Community extends BaseModule
                $items = self::getItems();
 
                if (!DBA::isResult($items)) {
-                       notice(DI::l10n()->t('No results.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No results.'));
                        return $o;
                }
 
index c36876b3479a9be374fafe431f474eef1766c1f2..cc6146a8934d30aed87220240921674adfc10dc1 100644 (file)
@@ -170,7 +170,7 @@ class Network extends BaseModule
                if (self::$groupId) {
                        $group = DBA::selectFirst('group', ['name'], ['id' => self::$groupId, 'uid' => local_user()]);
                        if (!DBA::isResult($group)) {
-                               notice(DI::l10n()->t('No such group'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('No such group'));
                        }
 
                        $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
@@ -184,7 +184,7 @@ class Network extends BaseModule
                                        'id' => DI::args()->get(0),
                                ]) . $o;
                        } else {
-                               notice(DI::l10n()->t('Invalid contact.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Invalid contact.'));
                        }
                } elseif (!DI::config()->get('theme', 'hide_eventlist')) {
                        $o .= Profile::getBirthdays();
index 46ded4236b6aaba31595d1de4648b85f82782953..fc9f95f07c713a3c5ee1d1ee95626feb857c146b 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module\Response;
 use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
@@ -48,7 +49,7 @@ class Feed extends BaseModule
                $this->httpClient = $httpClient;
 
                if (!local_user()) {
-                       notice($this->t('You must be logged in to use this module'));
+                       DI::sysmsg()->addNotice($this->t('You must be logged in to use this module'));
                        $baseUrl->redirect();
                }
        }
index 9fac9db302c72fe4ba54969de63d41a58fb5c9b9..f48e2bf7e3b7c8f314b00056fd62857ac5f710ee 100644 (file)
@@ -72,7 +72,7 @@ class Directory extends BaseModule
                $profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search);
 
                if ($profiles['total'] === 0) {
-                       notice(DI::l10n()->t('No entries (some entries may be hidden).'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No entries (some entries may be hidden).'));
                } else {
                        foreach ($profiles['entries'] as $entry) {
                                $contact = Model\Contact::getByURLForUser($entry['url'], local_user());
index 3dfd7877c59c629f86abc27f81f183d40777d860..c3b9acadd3c05066e2dad16d3e07bf7defc33b10 100644 (file)
@@ -26,6 +26,7 @@ use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module\Response;
 use Friendica\Network\HTTPException;
@@ -43,7 +44,7 @@ class SaveTag extends BaseModule
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
                if (!local_user()) {
-                       notice($this->t('You must be logged in to use this module'));
+                       DI::sysmsg()->addNotice($this->t('You must be logged in to use this module'));
                        $baseUrl->redirect();
                }
        }
index b61cfd4326daa4140f7fb3874fb0c1cec26807c5..0254bfae3469a6abde0fff3d65bcdb6c6743bcfe 100644 (file)
@@ -35,7 +35,7 @@ class FollowConfirm extends BaseModule
                parent::post($request);
                $uid = local_user();
                if (!$uid) {
-                       notice(DI::l10n()->t('Permission denied.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                        return;
                }
 
index d8a42d8de9f1da127bf07adc37adcd8f34bb5e18..815c4e1ec89c2ca1453e644898d245159c93026e 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\Worker;
 use Friendica\Database\Database;
+use Friendica\DI;
 use Friendica\Model\Contact as ContactModel;
 use Friendica\Network\HTTPException\ForbiddenException;
 use Friendica\Network\HTTPException\NotFoundException;
@@ -78,7 +79,7 @@ class FriendSuggest extends BaseModule
                // We do query the "uid" as well to ensure that it is our contact
                $contact = $this->dba->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]);
                if (empty($contact)) {
-                       notice($this->t('Suggested contact not found.'));
+                       DI::sysmsg()->addNotice($this->t('Suggested contact not found.'));
                        return;
                }
 
@@ -96,7 +97,7 @@ class FriendSuggest extends BaseModule
 
                Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id);
 
-               info($this->t('Friend suggestion sent.'));
+               DI::sysmsg()->addInfo($this->t('Friend suggestion sent.'));
        }
 
        protected function content(array $request = []): string
@@ -105,7 +106,7 @@ class FriendSuggest extends BaseModule
 
                $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
-                       notice($this->t('Contact not found.'));
+                       DI::sysmsg()->addNotice($this->t('Contact not found.'));
                        $this->baseUrl->redirect();
                }
 
index cd07e978123b7a2db3cdebac8b4614a2a4bfb4cc..06ee555a74af728d2b4da220d61cff1913934a29 100644 (file)
@@ -39,7 +39,7 @@ class Group extends BaseModule
                }
 
                if (!local_user()) {
-                       notice(DI::l10n()->t('Permission denied.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                        DI::baseUrl()->redirect();
                }
 
@@ -55,7 +55,7 @@ class Group extends BaseModule
                                        DI::baseUrl()->redirect('group/' . $r);
                                }
                        } else {
-                               notice(DI::l10n()->t('Could not create group.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Could not create group.'));
                        }
                        DI::baseUrl()->redirect('group');
                }
@@ -66,13 +66,13 @@ class Group extends BaseModule
 
                        $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => local_user()]);
                        if (!DBA::isResult($group)) {
-                               notice(DI::l10n()->t('Group not found.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.'));
                                DI::baseUrl()->redirect('contact');
                        }
                        $groupname = trim($_POST['groupname']);
                        if (strlen($groupname) && ($groupname != $group['name'])) {
                                if (!Model\Group::update($group['id'], $groupname)) {
-                                       notice(DI::l10n()->t('Group name was not changed.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Group name was not changed.'));
                                }
                        }
                }
@@ -132,10 +132,10 @@ class Group extends BaseModule
                                throw new \Exception(DI::l10n()->t('Bad request.'), 400);
                        }
 
-                       info($message);
+                       DI::sysmsg()->addInfo($message);
                        System::jsonExit(['status' => 'OK', 'message' => $message]);
                } catch (\Exception $e) {
-                       notice($e->getMessage());
+                       DI::sysmsg()->addNotice($e->getMessage());
                        System::jsonError($e->getCode(), ['status' => 'error', 'message' => $e->getMessage()]);
                }
        }
@@ -212,12 +212,12 @@ class Group extends BaseModule
                        // @TODO: Replace with parameter from router
                        if (intval(DI::args()->getArgv()[2])) {
                                if (!Model\Group::exists(DI::args()->getArgv()[2], local_user())) {
-                                       notice(DI::l10n()->t('Group not found.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.'));
                                        DI::baseUrl()->redirect('contact');
                                }
 
                                if (!Model\Group::remove(DI::args()->getArgv()[2])) {
-                                       notice(DI::l10n()->t('Unable to remove group.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to remove group.'));
                                }
                        }
                        DI::baseUrl()->redirect('group');
@@ -236,7 +236,7 @@ class Group extends BaseModule
                if ((DI::args()->getArgc() > 1) && intval(DI::args()->getArgv()[1])) {
                        $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => local_user(), 'deleted' => false]);
                        if (!DBA::isResult($group)) {
-                               notice(DI::l10n()->t('Group not found.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.'));
                                DI::baseUrl()->redirect('contact');
                        }
 
index 77a7585bd48f1e37b248ab8d525b054d0fc2d58b..c36a8ad7d8915337986640983caf44092985242a 100644 (file)
@@ -79,7 +79,7 @@ class Invite extends BaseModule
                        $recipient = trim($recipient);
 
                        if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
-                               notice(DI::l10n()->t('%s : Not a valid email address.', $recipient));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('%s : Not a valid email address.', $recipient));
                                continue;
                        }
 
@@ -114,15 +114,15 @@ class Invite extends BaseModule
                                $current_invites++;
                                DI::pConfig()->set(local_user(), 'system', 'sent_invites', $current_invites);
                                if ($current_invites > $max_invites) {
-                                       notice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.'));
                                        return;
                                }
                        } else {
-                               notice(DI::l10n()->t('%s : Message delivery failed.', $recipient));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('%s : Message delivery failed.', $recipient));
                        }
 
                }
-               info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
+               DI::sysmsg()->addInfo(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
        }
 
        protected function content(array $request = []): string
index 42ec3b6f75c6ab1c300d610efeeb756fa56afe87..ffe5d212fa3f88ee68c8533b99d6b93e184edd0d 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Content\Text\BBCode;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Module\BaseNotifications;
 use Friendica\Module\Response;
@@ -211,7 +212,7 @@ class Introductions extends BaseNotifications
                }
 
                if (count($notifications['notifications']) == 0) {
-                       notice($this->t('No introductions.'));
+                       DI::sysmsg()->addNotice($this->t('No introductions.'));
                        $notificationNoContent = $this->t('No more %s notifications.', $notifications['ident']);
                }
 
index a28b5d6f65c102505c435bf1863eeaf1f3661c4c..cacf57ec0987cb02b0768f57bbf26bb26db9326e 100644 (file)
@@ -27,6 +27,7 @@ use Friendica\Contact\Introduction\Repository\Introduction;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\System;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Module\Response;
 use Friendica\Module\Security\Login;
@@ -131,7 +132,7 @@ class Notification extends BaseModule
        protected function content(array $request = []): string
        {
                if (!local_user()) {
-                       notice($this->l10n->t('You must be logged in to show this page.'));
+                       DI::sysmsg()->addNotice($this->l10n->t('You must be logged in to show this page.'));
                        return Login::form();
                }
 
index ccc3208b60bc3b02561ec97887115ef129214b3b..f5e904544c3f24242794439c172476fbc6900068 100644 (file)
@@ -106,7 +106,7 @@ class Profile extends BaseProfile
                $o = self::getTabsHTML($a, 'profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact_id) {
-                       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 '';
                }
 
index d851d5f474772f2b7485bd3071eb7590c62a4c5c..99f5fe6bae84f3e5fbca28a435c80579f2a6cbf7 100644 (file)
@@ -107,7 +107,7 @@ class Status extends BaseProfile
                $last_updated_key = "profile:" . $profile['uid'] . ":" . local_user() . ":" . $remote_contact;
 
                if (!empty($profile['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 '';
                }
 
index 95cea145881925f93c5275e821ca7db75e9afa27..35faaa7dffb65a762ebc8b6b906aa1623d498a24 100644 (file)
@@ -74,20 +74,20 @@ class Register extends BaseModule
                $block = DI::config()->get('system', 'block_extended_register');
 
                if (local_user() && $block) {
-                       notice(DI::l10n()->t('Permission denied.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                        return '';
                }
 
                if (local_user()) {
                        $user = DBA::selectFirst('user', ['parent-uid'], ['uid' => local_user()]);
                        if (!empty($user['parent-uid'])) {
-                               notice(DI::l10n()->t('Only parent users can create additional accounts.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Only parent users can create additional accounts.'));
                                return '';
                        }
                }
 
                if (!local_user() && (intval(DI::config()->get('config', 'register_policy')) === self::CLOSED)) {
-                       notice(DI::l10n()->t('Permission denied.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                        return '';
                }
 
@@ -96,7 +96,7 @@ class Register extends BaseModule
                        $count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']);
                        if ($count >= $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 '';
                        }
                }
@@ -203,19 +203,19 @@ class Register extends BaseModule
                $additional_account = false;
 
                if (!local_user() && !empty($arr['post']['parent_password'])) {
-                       notice(DI::l10n()->t('Permission denied.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                        return;
                } elseif (local_user() && !empty($arr['post']['parent_password'])) {
                        try {
                                Model\User::getIdFromPasswordAuthentication(local_user(), $arr['post']['parent_password']);
                        } catch (\Exception $ex) {
-                               notice(DI::l10n()->t("Password doesn't match."));
+                               DI::sysmsg()->addNotice(DI::l10n()->t("Password doesn't match."));
                                $regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
                                DI::baseUrl()->redirect('register?' . http_build_query($regdata));
                        }
                        $additional_account = true;
                } elseif (local_user()) {
-                       notice(DI::l10n()->t('Please enter your password.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Please enter your password.'));
                        $regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
                        DI::baseUrl()->redirect('register?' . http_build_query($regdata));
                }
@@ -242,7 +242,7 @@ class Register extends BaseModule
                        case self::CLOSED:
                        default:
                                if (empty($_SESSION['authenticated']) && empty($_SESSION['administrator'])) {
-                                       notice(DI::l10n()->t('Permission denied.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                                        return;
                                }
                                $blocked = 1;
@@ -257,14 +257,14 @@ class Register extends BaseModule
                // Is there text in the tar pit?
                if (!empty($arr['email'])) {
                        Logger::info('Tar pit', $arr);
-                       notice(DI::l10n()->t('You have entered too much information.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('You have entered too much information.'));
                        DI::baseUrl()->redirect('register/');
                }
 
                if ($additional_account) {
                        $user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]);
                        if (!DBA::isResult($user)) {
-                               notice(DI::l10n()->t('User not found.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found.'));
                                DI::baseUrl()->redirect('register');
                        }
 
@@ -280,7 +280,7 @@ class Register extends BaseModule
 
                if ($arr['email'] != $arr['repeat']) {
                        Logger::info('Mail mismatch', $arr);
-                       notice(DI::l10n()->t('Please enter the identical mail address in the second field.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Please enter the identical mail address in the second field.'));
                        $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']];
                        DI::baseUrl()->redirect('register?' . http_build_query($regdata));
                }
@@ -292,7 +292,7 @@ class Register extends BaseModule
                try {
                        $result = Model\User::create($arr);
                } catch (\Exception $e) {
-                       notice($e->getMessage());
+                       DI::sysmsg()->addNotice($e->getMessage());
                        return;
                }
 
@@ -307,7 +307,7 @@ class Register extends BaseModule
 
                if ($additional_account) {
                        DBA::update('user', ['parent-uid' => local_user()], ['uid' => $user['uid']]);
-                       info(DI::l10n()->t('The additional account was created.'));
+                       DI::sysmsg()->addInfo(DI::l10n()->t('The additional account was created.'));
                        DI::baseUrl()->redirect('delegation');
                }
 
@@ -332,28 +332,28 @@ class Register extends BaseModule
                                );
 
                                if ($res) {
-                                       info(DI::l10n()->t('Registration successful. Please check your email for further instructions.'));
+                                       DI::sysmsg()->addInfo(DI::l10n()->t('Registration successful. Please check your email for further instructions.'));
                                        DI::baseUrl()->redirect();
                                } else {
-                                       notice(
+                                       DI::sysmsg()->addNotice(
                                                DI::l10n()->t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
                                                        $user['email'],
                                                        $result['password'])
                                        );
                                }
                        } else {
-                               info(DI::l10n()->t('Registration successful.'));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Registration successful.'));
                                DI::baseUrl()->redirect();
                        }
                } elseif (intval(DI::config()->get('config', 'register_policy')) === self::APPROVE) {
                        if (!strlen(DI::config()->get('config', 'admin_email'))) {
-                               notice(DI::l10n()->t('Your registration can not be processed.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Your registration can not be processed.'));
                                DI::baseUrl()->redirect();
                        }
 
                        // Check if the note to the admin is actually filled out
                        if (empty($_POST['permonlybox'])) {
-                               notice(DI::l10n()->t('You have to leave a request note for the admin.')
+                               DI::sysmsg()->addNotice(DI::l10n()->t('You have to leave a request note for the admin.')
                                        . DI::l10n()->t('Your registration can not be processed.'));
 
                                DI::baseUrl()->redirect('register/');
@@ -399,7 +399,7 @@ class Register extends BaseModule
                                $result['password']
                        );
 
-                       info(DI::l10n()->t('Your registration is pending approval by the site owner.'));
+                       DI::sysmsg()->addInfo(DI::l10n()->t('Your registration is pending approval by the site owner.'));
                        DI::baseUrl()->redirect();
                }
 
index 130c76319c12b43c073d3fd7bcd9971a0f5e6825..05239440de10b94396304d8c6aff0093467749ee 100644 (file)
@@ -31,6 +31,7 @@ use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\Search;
 use Friendica\Core\System;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 use Friendica\Model\User;
@@ -68,25 +69,25 @@ class RemoteFollow extends BaseModule
                }
        
                if (empty($this->owner)) {
-                       notice($this->t('Profile unavailable.'));
+                       DI::sysmsg()->addNotice($this->t('Profile unavailable.'));
                        return;
                }
                
                $url = Probe::cleanURI($_POST['dfrn_url']);
                if (!strlen($url)) {
-                       notice($this->t("Invalid locator"));
+                       DI::sysmsg()->addNotice($this->t("Invalid locator"));
                        return;
                }
 
                // Detect the network, make sure the provided URL is valid
                $data = Contact::getByURL($url);
                if (!$data) {
-                       notice($this->t("The provided profile link doesn't seem to be valid"));
+                       DI::sysmsg()->addNotice($this->t("The provided profile link doesn't seem to be valid"));
                        return;
                }
 
                if (empty($data['subscribe'])) {
-                       notice($this->t("Remote subscription can't be done for your network. Please subscribe directly on your system."));
+                       DI::sysmsg()->addNotice($this->t("Remote subscription can't be done for your network. Please subscribe directly on your system."));
                        return;
                }
 
index 496a3e0985d9e66637540aa0ba59a623aa9b317b..a088282cbe10922f7e3c45ad49f328c415ecfcba 100644 (file)
@@ -34,7 +34,7 @@ class Directory extends BaseSearch
        protected function content(array $request = []): string
        {
                if (!local_user()) {
-                       notice(DI::l10n()->t('Permission denied.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                        return Login::form();
                }
 
index db20dd0a3d76e616e74e93dd8866adf3adb46b1d..7dfdca39b42bba441fed4c9bd8cd75b89d0e60b5 100644 (file)
@@ -149,7 +149,7 @@ class Index extends BaseSearch
                // Tags don't look like an URL and the fulltext search does only work with natural words
                if (parse_url($search, PHP_URL_SCHEME) && parse_url($search, PHP_URL_HOST)) {
                        Logger::info('Skipping tag and fulltext search since the search looks like a URL.', ['q' => $search]);
-                       notice(DI::l10n()->t('No results.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No results.'));
                        return $o;
                }
 
@@ -191,7 +191,7 @@ class Index extends BaseSearch
 
                if (empty($items)) {
                        if (empty($last_uriid)) {
-                               notice(DI::l10n()->t('No results.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('No results.'));
                        }
                        return $o;
                }
index 4256ffcd44ec4904cd68b785eab258c02083809f..cea0a9b1a5d5a6f438f6cf6a848b745c9bda9aec 100644 (file)
@@ -26,6 +26,7 @@ use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Search;
 use Friendica\Database\Database;
+use Friendica\DI;
 use Friendica\Module\Response;
 use Friendica\Util\Profiler;
 use Psr\Log\LoggerInterface;
@@ -55,16 +56,16 @@ class Saved extends BaseModule
                                        $fields = ['uid' => local_user(), 'term' => $search];
                                        if (!$this->dba->exists('search', $fields)) {
                                                if (!$this->dba->insert('search', $fields)) {
-                                                       notice($this->t('Search term was not saved.'));
+                                                       DI::sysmsg()->addNotice($this->t('Search term was not saved.'));
                                                }
                                        } else {
-                                               notice($this->t('Search term already saved.'));
+                                               DI::sysmsg()->addNotice($this->t('Search term already saved.'));
                                        }
                                        break;
 
                                case 'remove':
                                        if (!$this->dba->delete('search', ['uid' => local_user(), 'term' => $search])) {
-                                               notice($this->t('Search term was not removed.'));
+                                               DI::sysmsg()->addNotice($this->t('Search term was not removed.'));
                                        }
                                        break;
                        }
index 004292cb5cce85d87812d9a0c879d8521aab6f1c..82c176feb606791a84dd6c0fbd0980913b78b949 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Session\Capability\IHandleSessions;
 use Friendica\Core\System;
+use Friendica\DI;
 use Friendica\Model\Profile;
 use Friendica\Model\User\Cookie;
 use Friendica\Module\Response;
@@ -80,7 +81,7 @@ class Logout extends BaseModule
                if ($visitor_home) {
                        System::externalRedirect($visitor_home);
                } else {
-                       info($this->t('Logged out.'));
+                       DI::sysmsg()->addInfo($this->t('Logged out.'));
                        $this->baseUrl->redirect();
                }
        }
index 7dbb765c6d83bb3b5763eeaae3acc523f9bd3a1b..2675f1fec335af80af3fa9c6911f855c845f5753 100644 (file)
@@ -87,9 +87,9 @@ class OpenID extends BaseModule
                                $session->set('openid_server', $open_id_obj->discover($open_id_obj->identity));
 
                                if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED) {
-                                       notice($l10n->t('Account not found. Please login to your existing account to add the OpenID to it.'));
+                                       DI::sysmsg()->addNotice($l10n->t('Account not found. Please login to your existing account to add the OpenID to it.'));
                                } else {
-                                       notice($l10n->t('Account not found. Please register a new account or login to your existing account to add the OpenID to it.'));
+                                       DI::sysmsg()->addNotice($l10n->t('Account not found. Please register a new account or login to your existing account to add the OpenID to it.'));
                                }
 
                                DI::baseUrl()->redirect('login');
index 6d8d91dbea02d3c37690198c483cfbc06ee49e1a..38b341dad9c264be001ad4d07f346e9b23429036 100644 (file)
@@ -26,6 +26,7 @@ use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Module\Response;
 use Friendica\Security\Authentication;
@@ -70,13 +71,13 @@ class Recovery extends BaseModule
                        if (RecoveryCode::existsForUser(local_user(), $recovery_code)) {
                                RecoveryCode::markUsedForUser(local_user(), $recovery_code);
                                $this->session->set('2fa', true);
-                               info($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
+                               DI::sysmsg()->addInfo($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
 
                                $this->auth->setForUser($this->app, User::getById($this->app->getLoggedInUserId()), true, true);
 
                                $this->baseUrl->redirect($this->session->pop('return_path', ''));
                        } else {
-                               notice($this->t('Invalid code, please retry.'));
+                               DI::sysmsg()->addNotice($this->t('Invalid code, please retry.'));
                        }
                }
        }
index 75efc9e60be4a86b92265cfca1ebb7d9359730c7..ac6e9321f439528a53b00f0ea95194b2d1e0e3e5 100644 (file)
@@ -26,6 +26,7 @@ use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\DI;
 use Friendica\Model\User\Cookie;
 use Friendica\Module\Response;
 use Friendica\Network\HTTPException\NotFoundException;
@@ -75,7 +76,7 @@ class SignOut extends BaseModule
                                        $this->cookie->reset(['2fa_cookie_hash' => $trusted]);
                                        $this->session->clear();
 
-                                       info($this->t('Logged out.'));
+                                       DI::sysmsg()->addInfo($this->t('Logged out.'));
                                        $this->baseUrl->redirect();
                                        break;
                                case 'sign_out':
@@ -83,7 +84,7 @@ class SignOut extends BaseModule
                                        $this->cookie->clear();
                                        $this->session->clear();
 
-                                       info($this->t('Logged out.'));
+                                       DI::sysmsg()->addInfo($this->t('Logged out.'));
                                        $this->baseUrl->redirect();
                                        break;
                                default:
@@ -105,14 +106,14 @@ class SignOut extends BaseModule
                                $this->cookie->reset(['2fa_cookie_hash' => $trusted]);
                                $this->session->clear();
 
-                               info($this->t('Logged out.'));
+                               DI::sysmsg()->addInfo($this->t('Logged out.'));
                                $this->baseUrl->redirect();
                        }
                } catch (TwoFactor\Exception\TrustedBrowserNotFoundException $exception) {
                        $this->cookie->clear();
                        $this->session->clear();
 
-                       info($this->t('Logged out.'));
+                       DI::sysmsg()->addInfo($this->t('Logged out.'));
                        $this->baseUrl->redirect();
                }
 
index 1f5fb7418f5b24c1885ed72a487137a981df29e8..ed24c6b14cad489ca827749a53bcef69c0cacfad 100644 (file)
@@ -26,6 +26,7 @@ use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Model\User\Cookie;
 use Friendica\Module\Response;
@@ -92,7 +93,7 @@ class Trust extends BaseModule
 
                                                // The string is sent to the browser to be sent back with each request
                                                if (!$this->cookie->set('2fa_cookie_hash', $trustedBrowser->cookie_hash)) {
-                                                       notice($this->t('Couldn\'t save browser to Cookie.'));
+                                                       DI::sysmsg()->addNotice($this->t('Couldn\'t save browser to Cookie.'));
                                                };
                                        } catch (TrustedBrowserPersistenceException $exception) {
                                                $this->logger->warning('Unexpected error when saving the trusted browser.', ['trustedBrowser' => $trustedBrowser, 'exception' => $exception]);
index 62ad08a4c82aacd67b7d529a0dfc137b79f6e0f8..bb262ab1ab8f3404d647d3234c069660ec7e5246 100644 (file)
@@ -75,10 +75,10 @@ class Account extends BaseSettings
                                        throw new Exception(DI::l10n()->t('Password update failed. Please try again.'));
                                }
 
-                               info(DI::l10n()->t('Password changed.'));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Password changed.'));
                        } catch (Exception $e) {
-                               notice($e->getMessage());
-                               notice(DI::l10n()->t('Password unchanged.'));
+                               DI::sysmsg()->addNotice($e->getMessage());
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Password unchanged.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -123,7 +123,7 @@ class Account extends BaseSettings
                        }
 
                        if (strlen($err)) {
-                               notice($err);
+                               DI::sysmsg()->addNotice($err);
                                return;
                        }
 
@@ -146,7 +146,7 @@ class Account extends BaseSettings
                        }
 
                        if (!User::update($fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        // clear session language
@@ -198,7 +198,7 @@ class Account extends BaseSettings
                        ];
 
                        if (!User::update($fields, local_user()) || !Profile::update($profile_fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -218,7 +218,7 @@ class Account extends BaseSettings
                        DI::pConfig()->set(local_user(), 'expire', 'network_only', $expire_network_only);
 
                        if (!User::update(['expire' => $expire], local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -302,7 +302,7 @@ class Account extends BaseSettings
                        ];
 
                        if (!User::update($fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -351,7 +351,7 @@ class Account extends BaseSettings
                        ]);
 
                        if (!User::update($fields, local_user()) || !empty($profile_fields) && !Profile::update($profile_fields, local_user())) {
-                               notice(DI::l10n()->t('Settings were not updated.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
                        }
 
                        DI::baseUrl()->redirect($redirectUrl);
@@ -363,7 +363,7 @@ class Account extends BaseSettings
                                // was there an error
                                if ($_FILES['importcontact-filename']['error'] > 0) {
                                        Logger::notice('Contact CSV file upload error', ['error' => $_FILES['importcontact-filename']['error']]);
-                                       notice(DI::l10n()->t('Contact CSV file upload error'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Contact CSV file upload error'));
                                } else {
                                        $csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name']));
                                        Logger::notice('Import started', ['lines' => count($csvArray)]);
@@ -382,7 +382,7 @@ class Account extends BaseSettings
                                        }
                                        Logger::notice('Import done');
 
-                                       info(DI::l10n()->t('Importing Contacts done'));
+                                       DI::sysmsg()->addInfo(DI::l10n()->t('Importing Contacts done'));
                                        // delete temp file
                                        unlink($_FILES['importcontact-filename']['tmp_name']);
                                }
@@ -395,7 +395,7 @@ class Account extends BaseSettings
 
                if (!empty($request['relocate-submit'])) {
                        Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
-                       info(DI::l10n()->t("Relocate message has been send to your contacts"));
+                       DI::sysmsg()->addInfo(DI::l10n()->t("Relocate message has been send to your contacts"));
                        DI::baseUrl()->redirect($redirectUrl);
                }
 
@@ -412,7 +412,7 @@ class Account extends BaseSettings
 
                $profile = DBA::selectFirst('profile', [], ['uid' => local_user()]);
                if (!DBA::isResult($profile)) {
-                       notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
                        return '';
                }
 
index 75e683e60a179b3190538f154a4d7075427357eb..aeada0871e68e0dc105c2b43c9446725d216e447 100644 (file)
@@ -50,13 +50,13 @@ class Delegation extends BaseSettings
                if ($parent_uid != 0) {
                        try {
                                User::getIdFromPasswordAuthentication($parent_uid, $parent_password);
-                               info(DI::l10n()->t('Delegation successfully granted.'));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Delegation successfully granted.'));
                        } catch (\Exception $ex) {
-                               notice(DI::l10n()->t('Parent user not found, unavailable or password doesn\'t match.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Parent user not found, unavailable or password doesn\'t match.'));
                                return;
                        }
                } else {
-                       info(DI::l10n()->t('Delegation successfully revoked.'));
+                       DI::sysmsg()->addInfo(DI::l10n()->t('Delegation successfully revoked.'));
                }
 
                DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
@@ -78,7 +78,7 @@ class Delegation extends BaseSettings
 
                if ($action === 'add' && $user_id) {
                        if (Session::get('submanage')) {
-                               notice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.'));
                                DI::baseUrl()->redirect('settings/delegation');
                        }
 
@@ -92,7 +92,7 @@ class Delegation extends BaseSettings
                                        DBA::insert('manage', ['uid' => $user_id, 'mid' => local_user()]);
                                }
                        } else {
-                               notice(DI::l10n()->t('Delegate user not found.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Delegate user not found.'));
                        }
 
                        DI::baseUrl()->redirect('settings/delegation');
@@ -100,7 +100,7 @@ class Delegation extends BaseSettings
 
                if ($action === 'remove' && $user_id) {
                        if (Session::get('submanage')) {
-                               notice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.'));
                                DI::baseUrl()->redirect('settings/delegation');
                        }
 
index 4670bf500d108eed55635f311f9d7412c4416e10..fe42b8718d3720ab5d1abc81786ea564b15a1aa6 100644 (file)
@@ -104,7 +104,7 @@ class Display extends BaseSettings
                                DBA::update('user', ['theme' => $theme], ['uid' => local_user()]);
                        }
                } else {
-                       notice(DI::l10n()->t('The theme you chose isn\'t available.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('The theme you chose isn\'t available.'));
                }
 
                Hook::callAll('display_settings_post', $_POST);
index 49130e8c574cceb95940fa577fb1ebd74a88b5b3..eec7468d06e09a1319227d1d5a6500b9fb068966 100644 (file)
@@ -80,7 +80,7 @@ class Index extends BaseSettings
 
                $name = trim($_POST['name'] ?? '');
                if (!strlen($name)) {
-                       notice(DI::l10n()->t('Profile Name is required.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Profile Name is required.'));
                        return;
                }
 
@@ -128,7 +128,7 @@ class Index extends BaseSettings
                );
 
                if (!$result) {
-                       notice(DI::l10n()->t('Profile couldn\'t be updated.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Profile couldn\'t be updated.'));
                        return;
                }
 
@@ -138,7 +138,7 @@ class Index extends BaseSettings
        protected function content(array $request = []): string
        {
                if (!local_user()) {
-                       notice(DI::l10n()->t('You must be logged in to use this module'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('You must be logged in to use this module'));
                        return Login::form();
                }
 
index ee9ac3246f8b56dfc2dacc69ce0b88c7f91ac0f5..5afab95035d985d025e6e71311a0a1a6190e1a76 100644 (file)
@@ -105,7 +105,7 @@ class Crop extends BaseSettings
                                        Photo::USER_AVATAR
                                );
                                if ($r === false) {
-                                       notice(DI::l10n()->t('Image size reduction [%s] failed.', '300'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '300'));
                                } else {
                                        Photo::update(['profile' => true], array_merge($condition, ['scale' => 4]));
                                }
@@ -123,7 +123,7 @@ class Crop extends BaseSettings
                                        Photo::USER_AVATAR
                                );
                                if ($r === false) {
-                                       notice(DI::l10n()->t('Image size reduction [%s] failed.', '80'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '80'));
                                } else {
                                        Photo::update(['profile' => true], array_merge($condition, ['scale' => 5]));
                                }
@@ -141,19 +141,19 @@ class Crop extends BaseSettings
                                        Photo::USER_AVATAR
                                );
                                if ($r === false) {
-                                       notice(DI::l10n()->t('Image size reduction [%s] failed.', '48'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '48'));
                                } else {
                                        Photo::update(['profile' => true], array_merge($condition, ['scale' => 6]));
                                }
 
                                Contact::updateSelfFromUserID(local_user(), true);
 
-                               info(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.'));
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.'));
 
                                // Update global directory in background
                                Profile::publishUpdate(local_user());
                        } else {
-                               notice(DI::l10n()->t('Unable to process image'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image'));
                        }
                }
 
@@ -194,7 +194,7 @@ class Crop extends BaseSettings
                        // Update global directory in background
                        Profile::publishUpdate(local_user());
 
-                       info(DI::l10n()->t('Profile picture successfully updated.'));
+                       DI::sysmsg()->addInfo(DI::l10n()->t('Profile picture successfully updated.'));
 
                        DI::baseUrl()->redirect('profile/' . DI::app()->getLoggedInUserNickname());
                }
index ff2a239b5b38c2cbe969cdb80cb3023ef9fc74a9..4f0b5ddadf38e2c20a6261798d6e13730030b909 100644 (file)
@@ -43,7 +43,7 @@ class Index extends BaseSettings
                self::checkFormSecurityTokenRedirectOnError('/settings/profile/photo', 'settings_profile_photo');
 
                if (empty($_FILES['userfile'])) {
-                       notice(DI::l10n()->t('Missing uploaded image.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Missing uploaded image.'));
                        return;
                }
 
@@ -57,7 +57,7 @@ class Index extends BaseSettings
                $maximagesize = DI::config()->get('system', 'maximagesize', 0);
 
                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);
                        return;
                }
@@ -66,7 +66,7 @@ class Index extends BaseSettings
                $Image = new Image($imagedata, $filetype);
 
                if (!$Image->isValid()) {
-                       notice(DI::l10n()->t('Unable to process image.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image.'));
                        @unlink($src);
                        return;
                }
@@ -93,13 +93,13 @@ class Index extends BaseSettings
                $filename = '';
 
                if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 0, Photo::USER_AVATAR)) {
-                       notice(DI::l10n()->t('Image upload failed.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Image upload failed.'));
                }
 
                if ($width > 640 || $height > 640) {
                        $Image->scaleDown(640);
                        if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 1, Photo::USER_AVATAR)) {
-                               notice(DI::l10n()->t('Image size reduction [%s] failed.', '640'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '640'));
                        }
                }
 
index 5fc513393ee725233e00d3667c35e6912d4d87bc..69b509131a957883ec697c0fee270b23631d5092 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Module\Response;
 use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
 use Friendica\Module\BaseSettings;
@@ -61,7 +62,7 @@ class AppSpecific extends BaseSettings
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice($this->t('Please enter your password to access this page.'));
+                       DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.'));
                        $this->baseUrl->redirect('settings/2fa');
                }
        }
@@ -79,20 +80,20 @@ class AppSpecific extends BaseSettings
                                case 'generate':
                                        $description = $_POST['description'] ?? '';
                                        if (empty($description)) {
-                                               notice($this->t('App-specific password generation failed: The description is empty.'));
+                                               DI::sysmsg()->addNotice($this->t('App-specific password generation failed: The description is empty.'));
                                                $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        } elseif (AppSpecificPassword::checkDuplicateForUser(local_user(), $description)) {
-                                               notice($this->t('App-specific password generation failed: This description already exists.'));
+                                               DI::sysmsg()->addNotice($this->t('App-specific password generation failed: This description already exists.'));
                                                $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        } else {
                                                $this->appSpecificPassword = AppSpecificPassword::generateForUser(local_user(), $_POST['description'] ?? '');
-                                               info($this->t('New app-specific password generated.'));
+                                               DI::sysmsg()->addInfo($this->t('New app-specific password generated.'));
                                        }
 
                                        break;
                                case 'revoke_all' :
                                        AppSpecificPassword::deleteAllForUser(local_user());
-                                       info($this->t('App-specific passwords successfully revoked.'));
+                                       DI::sysmsg()->addInfo($this->t('App-specific passwords successfully revoked.'));
                                        $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        break;
                        }
@@ -102,7 +103,7 @@ class AppSpecific extends BaseSettings
                        self::checkFormSecurityTokenRedirectOnError('settings/2fa/app_specific', 'settings_2fa_app_specific');
 
                        if (AppSpecificPassword::deleteForUser(local_user(), $_POST['revoke_id'])) {
-                               info($this->t('App-specific password successfully revoked.'));
+                               DI::sysmsg()->addInfo($this->t('App-specific password successfully revoked.'));
                        }
 
                        $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
index 0da49f3177a5d1ff5820880d89f37df2a0c9df91..be3d8d232c55ebb7bbf6b6864af2f54ca504b282 100644 (file)
@@ -66,7 +66,7 @@ class Index extends BaseSettings
                                                DI::pConfig()->delete(local_user(), '2fa', 'verified');
                                                Session::remove('2fa');
 
-                                               info(DI::l10n()->t('Two-factor authentication successfully disabled.'));
+                                               DI::sysmsg()->addInfo(DI::l10n()->t('Two-factor authentication successfully disabled.'));
                                                DI::baseUrl()->redirect('settings/2fa');
                                        }
                                        break;
@@ -98,7 +98,7 @@ class Index extends BaseSettings
                } catch (FoundException $exception) {
                        // Nothing to do here
                } catch (\Exception $e) {
-                       notice(DI::l10n()->t($e->getMessage()));
+                       DI::sysmsg()->addNotice(DI::l10n()->t($e->getMessage()));
                }
        }
 
index 9d453d5a2de3328689143efc85685c0a8b213c63..04749f2f800194ea8c5bc1f9db7218c82b7a6de4 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Module\Response;
 use Friendica\Security\TwoFactor\Model\RecoveryCode;
 use Friendica\Module\BaseSettings;
@@ -59,7 +60,7 @@ class Recovery extends BaseSettings
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice($this->t('Please enter your password to access this page.'));
+                       DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.'));
                        $this->baseUrl->redirect('settings/2fa');
                }
        }
@@ -75,7 +76,7 @@ class Recovery extends BaseSettings
 
                        if ($_POST['action'] == 'regenerate') {
                                RecoveryCode::regenerateForUser(local_user());
-                               info($this->t('New recovery codes successfully generated.'));
+                               DI::sysmsg()->addInfo($this->t('New recovery codes successfully generated.'));
                                $this->baseUrl->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
                        }
                }
index 140394e077217cabc4ba3c68d79ebfa550962535..61f97dbd1da417c2738927d0c6904309eb2b2a04 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Module\BaseSettings;
 use Friendica\Module\Response;
 use Friendica\Security\TwoFactor;
@@ -62,7 +63,7 @@ class Trusted extends BaseSettings
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice($this->t('Please enter your password to access this page.'));
+                       DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.'));
                        $this->baseUrl->redirect('settings/2fa');
                }
        }
@@ -79,7 +80,7 @@ class Trusted extends BaseSettings
                        switch ($_POST['action']) {
                                case 'remove_all':
                                        $this->trustedBrowserRepo->removeAllForUser(local_user());
-                                       info($this->t('Trusted browsers successfully removed.'));
+                                       DI::sysmsg()->addInfo($this->t('Trusted browsers successfully removed.'));
                                        $this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        break;
                        }
@@ -89,7 +90,7 @@ class Trusted extends BaseSettings
                        self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted');
 
                        if ($this->trustedBrowserRepo->removeForUser(local_user(), $_POST['remove_id'])) {
-                               info($this->t('Trusted browser successfully removed.'));
+                               DI::sysmsg()->addInfo($this->t('Trusted browser successfully removed.'));
                        }
 
                        $this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
index 7b5bea385ebc540d44eef97c2095c9e30c22e9ff..3d7db0118077eb03122894a628c64881d492afcd 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
+use Friendica\DI;
 use Friendica\Module\BaseSettings;
 use Friendica\Module\Response;
 use Friendica\Module\Security\Login;
@@ -65,7 +66,7 @@ class Verify extends BaseSettings
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice($this->t('Please enter your password to access this page.'));
+                       DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.'));
                        $this->baseUrl->redirect('settings/2fa');
                }
        }
@@ -87,11 +88,11 @@ class Verify extends BaseSettings
                                $this->pConfig->set(local_user(), '2fa', 'verified', true);
                                Session::set('2fa', true);
 
-                               info($this->t('Two-factor authentication successfully activated.'));
+                               DI::sysmsg()->addInfo($this->t('Two-factor authentication successfully activated.'));
 
                                $this->baseUrl->redirect('settings/2fa');
                        } else {
-                               notice($this->t('Invalid code, please retry.'));
+                               DI::sysmsg()->addNotice($this->t('Invalid code, please retry.'));
                        }
                }
        }
index 42dc02340490b397864a73a74fc97ee97ea4fd36..3cd7b76bcf0b73485027c26274d67e61bde77bd2 100644 (file)
@@ -223,7 +223,7 @@ class Authentication
 
                // if it's an email address or doesn't resolve to a URL, fail.
                if ($noid || strpos($openid_url, '@') || !Network::isUrlValid($openid_url)) {
-                       notice($this->l10n->t('Login failed.'));
+                       DI::sysmsg()->addNotice($this->l10n->t('Login failed.'));
                        $this->baseUrl->redirect();
                }
 
@@ -237,7 +237,7 @@ class Authentication
                        $openid->optional  = ['namePerson/friendly', 'contact/email', 'namePerson', 'namePerson/first', 'media/image/aspect11', 'media/image/default'];
                        System::externalRedirect($openid->authUrl());
                } catch (Exception $e) {
-                       notice($this->l10n->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br /><br >' . $this->l10n->t('The error message was:') . ' ' . $e->getMessage());
+                       DI::sysmsg()->addNotice($this->l10n->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br /><br >' . $this->l10n->t('The error message was:') . ' ' . $e->getMessage());
                }
        }
 
@@ -268,7 +268,7 @@ class Authentication
                        );
                } catch (Exception $e) {
                        $this->logger->warning('authenticate: failed login attempt', ['action' => 'login', 'username' => $username, 'ip' => $this->remoteAddress]);
-                       notice($this->l10n->t('Login failed. Please check your credentials.'));
+                       DI::sysmsg()->addNotice($this->l10n->t('Login failed. Please check your credentials.'));
                        $this->baseUrl->redirect();
                }
 
@@ -379,8 +379,8 @@ class Authentication
 
                if ($interactive) {
                        if ($user_record['login_date'] <= DBA::NULL_DATETIME) {
-                               info($this->l10n->t('Welcome %s', $user_record['username']));
-                               info($this->l10n->t('Please upload a profile photo.'));
+                               DI::sysmsg()->addInfo($this->l10n->t('Welcome %s', $user_record['username']));
+                               DI::sysmsg()->addInfo($this->l10n->t('Please upload a profile photo.'));
                                $this->baseUrl->redirect('settings/profile/photo/new');
                        }
                }