Accounts: Add edit and delete pages; implement forms (no real actions yet)
This commit is contained in:
parent
4e8d879008
commit
7859ef77ee
9 changed files with 258 additions and 23 deletions
44
templates/account_delete.html.twig
Normal file
44
templates/account_delete.html.twig
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block title %}Delete account{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Account: {{ accountUsername }}</h2>
|
||||
|
||||
<p>
|
||||
<b>Actions:</b>
|
||||
<a href="/accounts/{{ id }}">View</a> |
|
||||
<a href="/accounts/{{ id }}/edit">Edit</a> |
|
||||
<span>Delete</span> |
|
||||
<a href="mailto:{{ accountUsername }}">Send mail</a>
|
||||
</p>
|
||||
|
||||
<h3>Delete account</h3>
|
||||
|
||||
<p>You are about to delete the mail account "{{ accountUsername }}" including the following aliases:</p>
|
||||
<ul>
|
||||
{% for alias in aliases %}
|
||||
<li>{{ alias['mail_address'] }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<p><b>Note:</b> This will only delete the user entry from the database. Mail data will not be deleted!</p>
|
||||
|
||||
{% if error is defined %}
|
||||
<div class="error_box">
|
||||
<h4>Error:</h4>
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="confirmation_box">
|
||||
<p><b>Please confirm that you want to delete this account by entering your password.</b></p>
|
||||
<form action="/accounts/{{ id }}/delete" method="POST">
|
||||
<p>
|
||||
<label for="admin_password">Your password:</label>
|
||||
<input type="password" id="admin_password" name="admin_password"/>
|
||||
</p>
|
||||
<button type="submit">Delete account</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -1,18 +1,21 @@
|
|||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block title %}Accounts{% endblock %}
|
||||
{% block title %}View account{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Account: {{ accountUsername }}</h2>
|
||||
|
||||
<p>
|
||||
<b>Actions:</b>
|
||||
<span>View</span> |
|
||||
<a href="/accounts/{{ id }}/edit">Edit</a> |
|
||||
<a href="/accounts/{{ id }}/delete">Delete</a> |
|
||||
<a href="mailto:{{ accountUsername }}">Send mail</a>
|
||||
</p>
|
||||
|
||||
<table class="vertical_table_headers">
|
||||
<h3>View account details</h3>
|
||||
|
||||
<table class="bordered_table vertical_table_headers">
|
||||
<tr>
|
||||
<th style="min-width: 10em">User ID</th>
|
||||
<td style="min-width: 20em">{{ accountData['user_id'] }}</td>
|
||||
|
|
@ -62,7 +65,7 @@
|
|||
<h3>Aliases</h3>
|
||||
|
||||
{% if aliases %}
|
||||
<table>
|
||||
<table class="bordered_table">
|
||||
<tr>
|
||||
<th>Address</th>
|
||||
<th>Created at</th>
|
||||
|
|
|
|||
115
templates/account_edit.html.twig
Normal file
115
templates/account_edit.html.twig
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
{% 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">
|
||||
{% if error is defined %}
|
||||
<div class="error_box">
|
||||
<h4>Error</h4>
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="edit_box">
|
||||
<h4>Username</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Current username:</td>
|
||||
<td>{{ accountData['username'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="edit_username">New username:</label></td>
|
||||
<td><input id="edit_username" name="username"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label><input type="checkbox" name="username_create_alias"> Create alias for old username</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label><input type="checkbox" name="username_replace_alias"> Replace existing alias</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="edit_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"/></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>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="edit_box">
|
||||
<h4>Account status</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Current status:</td>
|
||||
<td>{{ accountData['is_active'] == '1' ? '<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" {{ accountData['is_active'] == '1' ? 'checked' : '' }}/> Active
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="edit_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>{{ accountData['home_dir'] }}</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"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="edit_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;">{{ accountData['memo'] }}</textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button type="submit">Save changes</button>
|
||||
<button type="reset">Reset form</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
@ -5,7 +5,12 @@
|
|||
{% block content %}
|
||||
<h2>Accounts</h2>
|
||||
|
||||
<p>List of all mail accounts.</p>
|
||||
<p>
|
||||
<b>Actions:</b>
|
||||
<a href="/accounts/new">Create account</a>
|
||||
</p>
|
||||
|
||||
<h3>List of accounts</h3>
|
||||
|
||||
<div class="filter_options">
|
||||
<form action="/accounts" method="GET">
|
||||
|
|
@ -19,7 +24,7 @@
|
|||
|
||||
<input type="checkbox" id="show_details_checkbox"><label for="show_details_checkbox"> Show detail columns</label>
|
||||
|
||||
<table>
|
||||
<table class="bordered_table">
|
||||
<tr>
|
||||
<th style="min-width: 15em">Username</th>
|
||||
<th style="min-width: 10em">Domain</th>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<p>This is a list of all domains auto-generated from the existing mail accounts and aliases. As such it is read-only.</p>
|
||||
|
||||
<table>
|
||||
<table class="bordered_table">
|
||||
<tr>
|
||||
<th style="min-width: 12em">Domain</th>
|
||||
<th>Accounts</th>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<form action="/login" method="POST">
|
||||
{% if error is defined %}
|
||||
<div class="error">{{ error }}</div>
|
||||
<div class="error_box">{{ error }}</div>
|
||||
{% endif %}
|
||||
|
||||
<table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue