Skip to content

Commit

Permalink
allow admin to set user password on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
amosfolz committed Jul 19, 2019
1 parent a8217f3 commit acf4d60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/sprinkles/admin/schema/requests/user/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ group_id:
label: "&GROUP"
domain: server
message: VALIDATE.INTEGER
value:
password:
validators:
required:
domain: client
Expand Down
4 changes: 2 additions & 2 deletions app/sprinkles/admin/src/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ public function create(Request $request, Response $response, $args)
}

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

// All checks passed! log events/activities, create user, and send verification email (if required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<label>{{translate('PASSWORD')}}</label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
<input type="password" class="form-control" name="value" autocomplete="off" value="" placeholder="{{translate('PASSWORD.BETWEEN', {min: 12, max: 50})}}">
<input type="password" class="form-control" name="password" autocomplete="off" value="" placeholder="{{translate('PASSWORD.BETWEEN', {min: 12, max: 50})}}">
</div>
</div>
<div class="form-group">
Expand All @@ -34,4 +34,4 @@
</div>
</div>
</div>
</div>
</div>

0 comments on commit acf4d60

Please sign in to comment.