diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-17 10:09:03 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-17 10:09:03 -0400 |
commit | 8c532efd5f02f7a7e5ea322a07ddcf49d130a8ec (patch) | |
tree | 289222e21420b8d0092f06de097090f179202f6b /app/Controller/User.php | |
parent | b40190ee9fd557d86e594208ed77fa762c7dcfb7 (diff) |
Run php-cs-fixer on the code base
Diffstat (limited to 'app/Controller/User.php')
-rw-r--r-- | app/Controller/User.php | 24 |
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'])) { |