summaryrefslogtreecommitdiff
path: root/app/Controller/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/User.php')
-rw-r--r--app/Controller/User.php24
1 files changed, 5 insertions, 19 deletions
diff --git a/app/Controller/User.php b/app/Controller/User.php
index 7444ed82..85b80d79 100644
--- a/app/Controller/User.php
+++ b/app/Controller/User.php
@@ -86,7 +86,6 @@ class User extends Base
list($valid, $errors) = $this->user->validateCreation($values);
if ($valid) {
-
$project_id = empty($values['project_id']) ? 0 : $values['project_id'];
unset($values['project_id']);
@@ -101,8 +100,7 @@ class User extends Base
$this->session->flash(t('User created successfully.'));
$this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user_id)));
- }
- else {
+ } else {
$this->session->flashError(t('Unable to create your user.'));
$values['project_id'] = $project_id;
}
@@ -240,7 +238,6 @@ class User extends Base
$switch = $this->request->getStringParam('switch');
if ($switch === 'enable' || $switch === 'disable') {
-
$this->checkCSRFParam();
if ($this->user->{$switch.'PublicAccess'}($user['id'])) {
@@ -270,16 +267,13 @@ class User extends Base
$errors = array();
if ($this->request->isPost()) {
-
$values = $this->request->getValues();
list($valid, $errors) = $this->user->validatePasswordModification($values);
if ($valid) {
-
if ($this->user->update($values)) {
$this->session->flash(t('Password modified successfully.'));
- }
- else {
+ } else {
$this->session->flashError(t('Unable to change the password.'));
}
@@ -308,13 +302,11 @@ class User extends Base
unset($values['password']);
if ($this->request->isPost()) {
-
$values = $this->request->getValues();
if ($this->userSession->isAdmin()) {
$values += array('is_admin' => 0, 'is_project_admin' => 0);
- }
- else {
+ } else {
// Regular users can't be admin
if (isset($values['is_admin'])) {
unset($values['is_admin']);
@@ -328,11 +320,9 @@ class User extends Base
list($valid, $errors) = $this->user->validateModification($values);
if ($valid) {
-
if ($this->user->update($values)) {
$this->session->flash(t('User updated successfully.'));
- }
- else {
+ } else {
$this->session->flashError(t('Unable to update your user.'));
}
@@ -363,16 +353,13 @@ class User extends Base
unset($values['password']);
if ($this->request->isPost()) {
-
$values = $this->request->getValues() + array('disable_login_form' => 0, 'is_ldap_user' => 0);
list($valid, $errors) = $this->user->validateModification($values);
if ($valid) {
-
if ($this->user->update($values)) {
$this->session->flash(t('User updated successfully.'));
- }
- else {
+ } else {
$this->session->flashError(t('Unable to update your user.'));
}
@@ -397,7 +384,6 @@ class User extends Base
$user = $this->getUser();
if ($this->request->getStringParam('confirmation') === 'yes') {
-
$this->checkCSRFParam();
if ($this->user->remove($user['id'])) {