2020-12-09 20:50:11 +01:00
|
|
|
{% extends "users/settings_base.html" %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{{ _("Account and Security | %(username)s", username=user.username) }}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block pane %}
|
|
|
|
<h2 class="mt-0">{{ _("Account and Security") }}</h2>
|
|
|
|
|
2021-01-01 18:02:08 +01:00
|
|
|
{% if form %}
|
|
|
|
<h3>
|
|
|
|
{{ _("Edit Account") }}
|
|
|
|
<small class="fas fa-user-shield ml-2 text-muted"></small>
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
{% from "macros/forms.html" import render_field, render_field_prefix, render_submit_field %}
|
|
|
|
<form action="" method="POST" class="form" role="form">
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
|
|
|
|
{% if user.checkPerm(current_user, "CHANGE_USERNAMES") %}
|
2021-07-24 03:30:43 +02:00
|
|
|
{{ render_field(form.username, tabindex=230) }}
|
2021-01-01 18:02:08 +01:00
|
|
|
{{ render_field(form.display_name, tabindex=230) }}
|
|
|
|
{{ render_field(form.forums_username, tabindex=230) }}
|
|
|
|
{{ render_field_prefix(form.github_username, tabindex=230) }}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if user.checkPerm(current_user, "CHANGE_RANK") %}
|
|
|
|
{{ render_field(form.rank, tabindex=250) }}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<p>
|
|
|
|
{{ render_submit_field(form.submit, tabindex=280) }}
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-12-09 20:50:11 +01:00
|
|
|
<h3>{{ _("Password") }}</h3>
|
|
|
|
{% if user == current_user %}
|
|
|
|
{% if user.password %}
|
|
|
|
<a class="btn btn-primary" href="{{ url_for('users.change_password') }}">Change Password</a>
|
|
|
|
{% else %}
|
|
|
|
<a class="btn btn-primary" href="{{ url_for('users.set_password') }}">Set Password</a>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% if user.password %}
|
|
|
|
<p>{{ _("Has password") }}</p>
|
|
|
|
{% else %}
|
|
|
|
<p class="text-danger">{{ _("Doesn't have password") }}</p>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<h3>{{ _("Linked Accounts") }}</h3>
|
|
|
|
<table class="table">
|
|
|
|
<tr>
|
|
|
|
<td>Forums</td>
|
|
|
|
<td>
|
|
|
|
{% if user.forums_username %}
|
2020-12-10 00:59:01 +01:00
|
|
|
<a class="btn btn-secondary" href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
|
|
|
|
Connected [{{ user.forums_username }}]
|
2020-12-09 20:50:11 +01:00
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
Please <a href="https://forum.minetest.net/ucp.php?i=pm&mode=compose&u=2051">PM rubenwardy</a>
|
|
|
|
on the forums to link your account.
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>GitHub</td>
|
|
|
|
<td>
|
|
|
|
{% if user.github_username %}
|
2020-12-10 00:59:01 +01:00
|
|
|
<a class="btn btn-secondary" href="https://github.com/{{ user.github_username }}">
|
|
|
|
Connected [{{ user.github_username }}]
|
|
|
|
</a>
|
2020-12-09 20:50:11 +01:00
|
|
|
|
|
|
|
{% if user == current_user %}
|
2020-12-10 00:59:01 +01:00
|
|
|
<a class="btn btn-secondary ml-2" href="{{ url_for('github.view_permissions') }}">View ContentDB's GitHub Permissions</a>
|
2020-12-09 20:50:11 +01:00
|
|
|
{% endif %}
|
|
|
|
{% elif user == current_user %}
|
2020-12-10 00:59:01 +01:00
|
|
|
<a class="btn btn-secondary" href="{{ url_for('github.start') }}">Link Github</a>
|
2020-12-09 20:50:11 +01:00
|
|
|
{% else %}
|
|
|
|
None
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2020-12-09 21:21:20 +01:00
|
|
|
{% if current_user.rank.atLeast(current_user.rank.MODERATOR) %}
|
|
|
|
<a class="btn btn-secondary float-right" href="{{ url_for('admin.audit', username=user.username) }}">View All</a>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-12-09 20:59:14 +01:00
|
|
|
<h3>{{ _("Recent Account Actions") }}</h3>
|
|
|
|
|
|
|
|
{% from "macros/audit_log.html" import render_audit_log %}
|
2020-12-10 00:08:39 +01:00
|
|
|
{{ render_audit_log(user.audit_log_entries.limit(10).all(), current_user) }}
|
2020-12-09 20:59:14 +01:00
|
|
|
|
2020-12-09 20:50:11 +01:00
|
|
|
<h3>{{ _("Account Deletion and Deactivation") }}</h3>
|
|
|
|
|
|
|
|
{% if current_user.rank.atLeast(current_user.rank.ADMIN) %}
|
|
|
|
<a class="btn btn-danger" href="{{ url_for('users.delete', username=user.username) }}">Delete or Deactivate</a>
|
|
|
|
{% else %}
|
|
|
|
<p>
|
|
|
|
{{ _("Account Deletion and Deactivation isn't available to users yet.") }}
|
|
|
|
{{ _("Please contact the admin.") }}
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endblock %}
|