Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set password manually when creating new user #1017

Merged
merged 10 commits into from Jul 20, 2019
Next

Refactored 'user-set-password.html.twig'

Refactored the modal 'user-set-password.html.twig'. Created 'forms/user-set-password.html.twig' and included it in the modal. Also created 'forms/partials/user-set-password.html.twig' to seperate the controls for setting the users password for reuse elsewhere.
  • Loading branch information...
zharding committed Jul 9, 2017
commit ccda2a968b6a58dafd1ff5dc4459a0bd579069d3
@@ -0,0 +1,37 @@
<!-- Prevent browsers from trying to autofill the password field. See http://stackoverflow.com/a/23234498/2970321 -->
<input type="text" style="display:none">
<input type="password" style="display:none">
<div class="col-sm-12">
<div class="radio">
<label for="change_password_mode_link">
<input type="radio" name="change_password_mode" id="change_password_mode_link" value="link" checked>
{{translate("USER.ADMIN.SEND_PASSWORD_LINK")}}
</label>
</div>
</div>
<div class="col-sm-12">
<div class="radio">
<label for="change_password_mode_manual">
<input type="radio" name="change_password_mode" id="change_password_mode_manual" value="manual">
{{translate("USER.ADMIN.SET_PASSWORD")}}:
</label>
</div>
<div class="row controls-password">
<div class="col-sm-11 col-sm-offset-1">
<div class="form-group">
<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})}}">
</div>
</div>
<div class="form-group">
<label>{{translate('PASSWORD.CONFIRM')}}</label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
<input type="password" class="form-control" name="passwordc" autocomplete="off" value="" placeholder="{{translate('PASSWORD.CONFIRM')}}">
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,21 @@
<form class="js-form" method="PUT" action="{{site.uri.public}}/api/users/u/{{user.user_name}}">
{% include "forms/csrf.html.twig" %}
<div class="js-form-alerts">
</div>
<div class="row">
{% include "forms/partials/user-set-password.html.twig" %}
</div>
<br>
<div class="row">
<div class="col-xs-8 col-sm-4">
<button type="submit" class="btn btn-block btn-lg btn-success">{{translate('SUBMIT')}}</button>
</div>
<div class="col-xs-4 col-sm-3 pull-right">
<button type="button" class="btn btn-block btn-lg btn-link" data-dismiss="modal">{{translate('CANCEL')}}</button>
</div>
</div>
</form>
<!-- Include validation rules -->
<script>
{% include "pages/partials/page.js.twig" %}
</script>
@@ -3,60 +3,5 @@
{% block modal_title %}{{translate("USER.ADMIN.CHANGE_PASSWORD")}}{% endblock %}

{% block modal_body %}
<form class="js-form" method="PUT" action="{{site.uri.public}}/api/users/u/{{user.user_name}}">
{% include "forms/csrf.html.twig" %}
<!-- Prevent browsers from trying to autofill the password field. See http://stackoverflow.com/a/23234498/2970321 -->
<input type="text" style="display:none">
<input type="password" style="display:none">
<div class="js-form-alerts">
</div>
<div class="row">
<div class="col-sm-12">
<div class="radio">
<label for="change_password_mode_link">
<input type="radio" name="change_password_mode" id="change_password_mode_link" value="link" checked>
{{translate("USER.ADMIN.SEND_PASSWORD_LINK")}}
</label>
</div>
</div>
<div class="col-sm-12">
<div class="radio">
<label for="change_password_mode_manual">
<input type="radio" name="change_password_mode" id="change_password_mode_manual" value="manual">
{{translate("USER.ADMIN.SET_PASSWORD")}}:
</label>
</div>
<div class="row controls-password">
<div class="col-sm-11 col-sm-offset-1">
<div class="form-group">
<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})}}">
</div>
</div>
<div class="form-group">
<label>{{translate('PASSWORD.CONFIRM')}}</label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
<input type="password" class="form-control" name="passwordc" autocomplete="off" value="" placeholder="{{translate('PASSWORD.CONFIRM')}}">
</div>
</div>
</div>
</div>
</div>
</div><br>
<div class="row">
<div class="col-xs-8 col-sm-4">
<button type="submit" class="btn btn-block btn-lg btn-success">{{translate('SUBMIT')}}</button>
</div>
<div class="col-xs-4 col-sm-3 pull-right">
<button type="button" class="btn btn-block btn-lg btn-link" data-dismiss="modal">{{translate('CANCEL')}}</button>
</div>
</div>
</form>
<!-- Include validation rules -->
<script>
{% include "pages/partials/page.js.twig" %}
</script>
{% include "forms/user-set-password.html.twig" %}
{% endblock %}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.