133 lines
5.3 KiB
Twig
133 lines
5.3 KiB
Twig
{% extends "base.html.twig" %}
|
|
|
|
{% block title %}Edit account{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2>Account: {{ accountUsername }}</h2>
|
|
|
|
<p>
|
|
<b>Actions:</b>
|
|
<a href="/accounts/{{ id }}">View</a> |
|
|
<span>Edit</span> |
|
|
<a href="/accounts/{{ id }}/delete">Delete</a> |
|
|
<a href="mailto:{{ accountUsername }}">Send mail</a>
|
|
</p>
|
|
|
|
<h3>Edit account data</h3>
|
|
|
|
<form action="/accounts/{{ id }}/edit" method="POST">
|
|
{{ include('includes/form_result_box.html.twig') }}
|
|
|
|
<input type="hidden" name="user_id" value="{{ id }}"/>
|
|
|
|
<div class="form_box">
|
|
<h4>Username</h4>
|
|
<table>
|
|
<tr>
|
|
<td>Current username:</td>
|
|
<td>{{ account.getUsername() }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="edit_username">New username:</label></td>
|
|
<td><input id="edit_username" name="username" value="{{ formData['username'] | default('') }}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<label>
|
|
<input type="checkbox" name="username_create_alias" {{ formData['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" {{ formData['username_replace_alias'] | default('') ? 'checked' : '' }}/>
|
|
Replace existing alias
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="form_box">
|
|
<h4>Password</h4>
|
|
<p>The new password will be hashed using the current default hash algorithm.</p>
|
|
<table>
|
|
<tr>
|
|
<td><label for="edit_password">New password:</label></td>
|
|
<td><input type="password" id="edit_password" name="password" value="{{ formData['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" value="{{ formData['password_repeat'] | default('') }}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<label>
|
|
<input type="checkbox" name="password_generate_random" {{ formData['password_generate_random'] | default('') ? 'checked' : '' }}/>
|
|
Generate new random password
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="form_box">
|
|
<h4>Account status</h4>
|
|
<table>
|
|
<tr>
|
|
<td>Current status:</td>
|
|
<td>{{ account.isActive() ? '<span class="green">Active</span>' : '<span class="red">Inactive</span>' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>New status:</td>
|
|
<td>
|
|
<label>
|
|
<input type="checkbox" name="is_active"
|
|
{%- if formData | default() -%}
|
|
{{ formData['is_active'] | default() ? ' checked' : '' }}
|
|
{%- else -%}
|
|
{{ account.isActive() ? ' checked' : '' }}
|
|
{%- endif -%}
|
|
/> Active
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="form_box">
|
|
<h4>Home directory</h4>
|
|
<p><b>Important:</b> Changing the home directory here will <b>NOT</b> move any existing mail data, this needs to be done
|
|
manually!</p>
|
|
<table>
|
|
<tr>
|
|
<td>Current home directory:</td>
|
|
<td><span class="gray">/srv/vmail/</span>{{ account.getHomeDir() }}</td>
|
|
</tr>
|
|
<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" value="{{ formData['home_dir'] | default('') }}"/>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="form_box">
|
|
<h4><label for="edit_memo">Admin memo</label></h4>
|
|
<p>This field is only readable by admins.</p>
|
|
<table>
|
|
<tr>
|
|
<td><label for="edit_memo">Admin memo:</label></td>
|
|
<td><textarea id="edit_memo" name="memo" style="min-width: 40em;">{{ formData | default() ? formData['memo'] : account.getMemo() }}</textarea></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<button type="submit">Save changes</button>
|
|
<button type="reset">Reset form</button>
|
|
</form>
|
|
{% endblock %}
|