Skip to content

Commit 420c10b

Browse files
committed
Update Style - PSR-1/2
1 parent dc668d8 commit 420c10b

3 files changed

Lines changed: 29 additions & 29 deletions

File tree

app/sprinkles/admin/assets/userfrosting/js/widgets/users.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function attachUserForm() {
2222
// Reload page on success
2323
window.location.reload();
2424
});
25-
26-
toggleSetPasswordMode(modal, 'link');
25+
26+
toggleSetPasswordMode(modal, 'link');
2727

2828
// On submission, submit either the PUT request, or POST for a password reset, depending on the toggle state
2929
modal.find("input[name='change_password_mode']").click(function() {
@@ -104,7 +104,7 @@ function toggleChangePasswordMode(el, userName, changePasswordMode) {
104104
* Update user field(s)
105105
*/
106106
function updateUser(userName, fieldName, fieldValue) {
107-
var data = {
107+
var data = {
108108
'value': fieldValue
109109
};
110110

@@ -136,7 +136,7 @@ function updateUser(userName, fieldName, fieldValue) {
136136
}
137137
}
138138
}
139-
}).fail(function (jqXHR) {
139+
}).fail(function (jqXHR) {
140140
// Error messages
141141
if (debugAjax && jqXHR.responseText) {
142142
document.write(jqXHR.responseText);

app/sprinkles/admin/src/Controller/UserController.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ public function create($request, $response, $args)
118118
}
119119

120120
$data['flag_verified'] = 1;
121-
if(!isset($data['value'])){
122-
// Set password as empty on initial creation. We will then send email so new user can set it themselves via a verification token
123-
$data['password'] = '';
124-
}else{
125-
$data['password'] = Password::hash($data['value']);
126-
}
127-
121+
if(!isset($data['value'])){
122+
// Set password as empty on initial creation. We will then send email so new user can set it themselves via a verification token
123+
$data['password'] = '';
124+
}else{
125+
$data['password'] = Password::hash($data['value']);
126+
}
127+
128128
// All checks passed! log events/activities, create user, and send verification email (if required)
129129
// Begin transaction - DB will be rolled back if an exception occurs
130130
Capsule::transaction( function() use ($classMapper, $data, $ms, $config, $currentUser) {
@@ -139,7 +139,7 @@ public function create($request, $response, $args)
139139
'type' => 'account_create',
140140
'user_id' => $currentUser->id
141141
]);
142-
142+
143143
// Load default roles
144144
$defaultRoleSlugs = $classMapper->staticMethod('role', 'getDefaultSlugs');
145145
$defaultRoles = $classMapper->staticMethod('role', 'whereIn', 'slug', $defaultRoleSlugs)->get();
@@ -151,22 +151,22 @@ public function create($request, $response, $args)
151151
// Try to generate a new password request
152152
$passwordRequest = $this->ci->repoPasswordReset->create($user, $config['password_reset.timeouts.create']);
153153

154-
// If the password_mode is manual, do not send an email to set it. Else, send the email.
155-
if(!isset($data['value'])){
156-
// Create and send welcome email with password set link
157-
$message = new TwigMailMessage($this->ci->view, 'mail/password-create.html.twig');
158-
159-
$message->from($config['address_book.admin'])
160-
->addEmailRecipient(new EmailRecipient($user->email, $user->full_name))
161-
->addParams([
162-
'user' => $user,
163-
'create_password_expiration' => $config['password_reset.timeouts.create'] / 3600 . ' hours',
164-
'token' => $passwordRequest->getToken()
165-
]);
166-
167-
$this->ci->mailer->send($message);
168-
}
169-
154+
// If the password_mode is manual, do not send an email to set it. Else, send the email.
155+
if(!isset($data['value'])){
156+
// Create and send welcome email with password set link
157+
$message = new TwigMailMessage($this->ci->view, 'mail/password-create.html.twig');
158+
159+
$message->from($config['address_book.admin'])
160+
->addEmailRecipient(new EmailRecipient($user->email, $user->full_name))
161+
->addParams([
162+
'user' => $user,
163+
'create_password_expiration' => $config['password_reset.timeouts.create'] / 3600 . ' hours',
164+
'token' => $passwordRequest->getToken()
165+
]);
166+
167+
$this->ci->mailer->send($message);
168+
}
169+
170170
$ms->addMessageTranslated('success', 'USER.CREATED', $data);
171171
});
172172

app/sprinkles/admin/templates/forms/user.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</div>
110110
{% endif %}
111111
{% if 'password' not in form.fields.hidden %}
112-
{% include "forms/partials/user-set-password.html.twig" %}
112+
{% include "forms/partials/user-set-password.html.twig" %}
113113
{% endif %}
114114
{% endblock %}
115115
</div><br>

0 commit comments

Comments
 (0)