Implement account edit; add SessionHelper, PasswordHelper and ActionResult
This commit is contained in:
parent
32add30c9d
commit
6ace072841
15 changed files with 637 additions and 68 deletions
|
|
@ -16,13 +16,20 @@
|
|||
<h3>Edit account data</h3>
|
||||
|
||||
<form action="/accounts/{{ id }}/edit" method="POST">
|
||||
{% if error is defined %}
|
||||
{% if success is defined %}
|
||||
<div class="success_box">
|
||||
<h4>Success</h4>
|
||||
{{ success }}
|
||||
</div>
|
||||
{% elseif error is defined %}
|
||||
<div class="error_box">
|
||||
<h4>Error</h4>
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<input type="hidden" name="user_id" value="{{ id }}"/>
|
||||
|
||||
<div class="edit_box">
|
||||
<h4>Username</h4>
|
||||
<table>
|
||||
|
|
@ -32,16 +39,22 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><label for="edit_username">New username:</label></td>
|
||||
<td><input id="edit_username" name="username"/></td>
|
||||
<td><input id="edit_username" name="username" value="{{ editData['username'] | default('') }}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label><input type="checkbox" name="username_create_alias"> Create alias for old username</label>
|
||||
<label>
|
||||
<input type="checkbox" name="username_create_alias" {{ editData['username_create_alias'] | default('') ? 'checked' : '' }}/>
|
||||
Create alias for old username
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label><input type="checkbox" name="username_replace_alias"> Replace existing alias</label>
|
||||
<label>
|
||||
<input type="checkbox" name="username_replace_alias" {{ editData['username_replace_alias'] | default('') ? 'checked' : '' }}/>
|
||||
Replace existing alias
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -53,11 +66,11 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td><label for="edit_password">New password:</label></td>
|
||||
<td><input type="password" id="edit_password" name="password"/></td>
|
||||
<td><input type="password" id="edit_password" name="password" value="{{ editData['password'] | default('') }}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="edit_password_repeat">Repeat password:</label></td>
|
||||
<td><input type="password" id="edit_password_repeat" name="password_repeat"/></td>
|
||||
<td><input type="password" id="edit_password_repeat" name="password_repeat" value="{{ editData['password_repeat'] | default('') }}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -73,7 +86,13 @@
|
|||
<td>New status:</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" name="is_active" {{ account.isActive() ? 'checked' : '' }}/> Active
|
||||
<input type="checkbox" name="is_active"
|
||||
{%- if editData | default() -%}
|
||||
{{ editData['is_active'] ? ' checked' : '' }}
|
||||
{%- else -%}
|
||||
{{ account.isActive() ? ' checked' : '' }}
|
||||
{%- endif -%}
|
||||
/> Active
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -92,7 +111,7 @@
|
|||
<tr>
|
||||
<td><label for="edit_home_dir">New home directory:</label></td>
|
||||
<td>
|
||||
<span class="gray">/srv/vmail/</span><input id="edit_home_dir" name="home_dir"/>
|
||||
<span class="gray">/srv/vmail/</span><input id="edit_home_dir" name="home_dir" value="{{ editData['home_dir'] | default('') }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -104,7 +123,7 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td><label for="edit_memo">Admin memo:</label></td>
|
||||
<td><textarea id="edit_memo" name="memo" style="min-width: 40em;">{{ account.getMemo() }}</textarea></td>
|
||||
<td><textarea id="edit_memo" name="memo" style="min-width: 40em;">{{ editData | default() ? editData['memo'] : account.getMemo() }}</textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue