aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2020-10-05 19:03:33 +0200
committerGravatar GitHub <noreply@github.com> 2020-10-05 19:03:33 +0200
commit76523693592a58c7b15c2860ad95133f551d86a5 (patch)
treea0fc3605396921dbbb225b2ec04559a014d6f156 /app/Controllers/userController.php
parent2f88b267805c71e9859c41bb50c348b1566cfc06 (diff)
Minz: Attach a notification to a request (#3208)
* Minz: Attach a notification to a request Notifications should be attached to a request, not to a global session. Fix https://github.com/FreshRSS/FreshRSS/pull/3096#issuecomment-654891906 Prepare https://github.com/FreshRSS/FreshRSS/pull/3096 * Rename array * Avoid string constants Implement https://github.com/FreshRSS/FreshRSS/pull/3208#issuecomment-703243863 * Improved logic * Simplify storage https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499511213 * Fix notification bug in configuration/system
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 6e7908df3..4dfd11751 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -356,11 +356,11 @@ class FreshRSS_user_Controller extends Minz_ActionController {
FreshRSS_Auth::giveAccess();
}
- $notif = array(
- 'type' => $ok ? 'good' : 'bad',
- 'content' => _t('feedback.user.created' . (!$ok ? '.error' : ''), $new_user_name)
- );
- Minz_Session::_param('notification', $notif);
+ if ($ok) {
+ Minz_Request::setGoodNotification(_t('feedback.user.created', $new_user_name));
+ } else {
+ Minz_Request::setBadNotification(_t('feedback.user.created.error', $new_user_name));
+ }
}
$redirect_url = urldecode(Minz_Request::param('r', false, true));
@@ -546,11 +546,11 @@ class FreshRSS_user_Controller extends Minz_ActionController {
}
invalidateHttpCache();
- $notif = array(
- 'type' => $ok ? 'good' : 'bad',
- 'content' => _t('feedback.user.deleted' . (!$ok ? '.error' : ''), $username)
- );
- Minz_Session::_param('notification', $notif);
+ if ($ok) {
+ Minz_Request::setGoodNotification(_t('feedback.user.deleted', $username));
+ } else {
+ Minz_Request::setBadNotification(_t('feedback.user.deleted.error', $username));
+ }
}
Minz_Request::forward($redirect_url, true);