Skip to content

Commit acf4d60

Browse files
committed
allow admin to set user password on creation
1 parent a8217f3 commit acf4d60

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/sprinkles/admin/schema/requests/user/create.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ group_id:
7070
label: "&GROUP"
7171
domain: server
7272
message: VALIDATE.INTEGER
73-
value:
73+
password:
7474
validators:
7575
required:
7676
domain: client

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ public function create(Request $request, Response $response, $args)
133133
}
134134

135135
$data['flag_verified'] = 1;
136-
if (!isset($data['value'])) {
136+
if (!isset($data['password'])) {
137137
// Set password as empty on initial creation. We will then send email so new user can set it themselves via a verification token
138138
$data['password'] = '';
139139
} else {
140-
$data['password'] = Password::hash($data['value']);
140+
$data['password'] = Password::hash($data['password']);
141141
}
142142

143143
// All checks passed! log events/activities, create user, and send verification email (if required)

app/sprinkles/admin/templates/forms/partials/user-set-password.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<label>{{translate('PASSWORD')}}</label>
2323
<div class="input-group">
2424
<span class="input-group-addon"><i class="fa fa-key"></i></span>
25-
<input type="password" class="form-control" name="value" autocomplete="off" value="" placeholder="{{translate('PASSWORD.BETWEEN', {min: 12, max: 50})}}">
25+
<input type="password" class="form-control" name="password" autocomplete="off" value="" placeholder="{{translate('PASSWORD.BETWEEN', {min: 12, max: 50})}}">
2626
</div>
2727
</div>
2828
<div class="form-group">
@@ -34,4 +34,4 @@
3434
</div>
3535
</div>
3636
</div>
37-
</div>
37+
</div>

0 commit comments

Comments
 (0)