summaryrefslogtreecommitdiff
path: root/app/Controller/User.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
committerFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
commita675271ad71b7713d1b33bdba3c51b2b04813229 (patch)
treee54d8a95e16ca521193b9fd5a5eb071aa2910823 /app/Controller/User.php
parent2fc402f6733573627ad25394d109b9f848ef04f6 (diff)
Rewrite of session management
Diffstat (limited to 'app/Controller/User.php')
-rw-r--r--app/Controller/User.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/Controller/User.php b/app/Controller/User.php
index 8526fb57..22622d17 100644
--- a/app/Controller/User.php
+++ b/app/Controller/User.php
@@ -99,10 +99,10 @@ class User extends Base
$this->userNotificationType->saveSelectedTypes($user_id, array(MailNotification::TYPE));
}
- $this->session->flash(t('User created successfully.'));
+ $this->flash->success(t('User created successfully.'));
$this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user_id)));
} else {
- $this->session->flashError(t('Unable to create your user.'));
+ $this->flash->failure(t('Unable to create your user.'));
$values['project_id'] = $project_id;
}
}
@@ -201,7 +201,7 @@ class User extends Base
if ($this->request->isPost()) {
$values = $this->request->getValues();
$this->userNotification->saveSettings($user['id'], $values);
- $this->session->flash(t('User updated successfully.'));
+ $this->flash->success(t('User updated successfully.'));
$this->response->redirect($this->helper->url->to('user', 'notifications', array('user_id' => $user['id'])));
}
@@ -226,7 +226,7 @@ class User extends Base
if ($this->request->isPost()) {
$values = $this->request->getValues();
$this->userMetadata->save($user['id'], $values);
- $this->session->flash(t('User updated successfully.'));
+ $this->flash->success(t('User updated successfully.'));
$this->response->redirect($this->helper->url->to('user', 'integrations', array('user_id' => $user['id'])));
}
@@ -264,9 +264,9 @@ class User extends Base
$this->checkCSRFParam();
if ($this->user->{$switch.'PublicAccess'}($user['id'])) {
- $this->session->flash(t('User updated successfully.'));
+ $this->flash->success(t('User updated successfully.'));
} else {
- $this->session->flashError(t('Unable to update this user.'));
+ $this->flash->failure(t('Unable to update this user.'));
}
$this->response->redirect($this->helper->url->to('user', 'share', array('user_id' => $user['id'])));
@@ -295,9 +295,9 @@ class User extends Base
if ($valid) {
if ($this->user->update($values)) {
- $this->session->flash(t('Password modified successfully.'));
+ $this->flash->success(t('Password modified successfully.'));
} else {
- $this->session->flashError(t('Unable to change the password.'));
+ $this->flash->failure(t('Unable to change the password.'));
}
$this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user['id'])));
@@ -344,9 +344,9 @@ class User extends Base
if ($valid) {
if ($this->user->update($values)) {
- $this->session->flash(t('User updated successfully.'));
+ $this->flash->success(t('User updated successfully.'));
} else {
- $this->session->flashError(t('Unable to update your user.'));
+ $this->flash->failure(t('Unable to update your user.'));
}
$this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user['id'])));
@@ -381,9 +381,9 @@ class User extends Base
if ($valid) {
if ($this->user->update($values)) {
- $this->session->flash(t('User updated successfully.'));
+ $this->flash->success(t('User updated successfully.'));
} else {
- $this->session->flashError(t('Unable to update your user.'));
+ $this->flash->failure(t('Unable to update your user.'));
}
$this->response->redirect($this->helper->url->to('user', 'authentication', array('user_id' => $user['id'])));
@@ -410,9 +410,9 @@ class User extends Base
$this->checkCSRFParam();
if ($this->user->remove($user['id'])) {
- $this->session->flash(t('User removed successfully.'));
+ $this->flash->success(t('User removed successfully.'));
} else {
- $this->session->flashError(t('Unable to remove this user.'));
+ $this->flash->failure(t('Unable to remove this user.'));
}
$this->response->redirect($this->helper->url->to('user', 'index'));