Run php-cs-fixer on the code base

This commit is contained in:
Frederic Guillot
2015-10-17 10:09:03 -04:00
parent b40190ee9f
commit 8c532efd5f
147 changed files with 465 additions and 772 deletions

View File

@@ -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'])) {