This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
veridic/acs/templates/list_aliases_and_add.html

99 lines
3.4 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% block content %}
{% if title %}
<h2>{{ title }}</h2>
{% else %}
<h2>{% trans "Add or modify" %}</h2>
{% endif %}
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% if list_any or namespaces_not_in %}
<h3>{% trans "Manage aliases in policies" %}</h3>
{% if list_any %}
<ul>
{% for any, self_admin in list_any %}
<li class="bigbutton">
<p>{% trans "Alias:" %} {{ any }}</p>
<p>
<form method="post" action="/del_any">
<input type="hidden" name="type_entity" value="{{ type_entity }}"/>
<input type="hidden" name="id" value="{{ any.id }}"/>
{% if back_url %}<input type="hidden" name="back_url" value="{{ back_url }}"/>{% endif %}
<input type="submit" name="Delete" value="{% trans "Delete" %}"/>
</form>
</p>
<p>
<form method="post" action="/switch_self_admin">
<input type="hidden" name="id" value="{{ any.id }}"/>
{% if back_url %}<input type="hidden" name="back_url" value="{{ back_url }}"/>{% endif %}
{% if self_admin %}
<input type="submit" name="Switch" value="{% trans "Switch Off Self Administration" %}"/>
{% else %}
<input type="submit" name="Switch" value="{% trans "Switch On Self Administration" %}"/>
{% endif %}
</form>
</p>
</li>
{% endfor %}
</ul>
{% endif %}
{% if namespaces_not_in %}
<ul>
{% for ns in namespaces_not_in %}
<li>
<p><form method="post" action="/set_user_in_policy_from_home">
<p><label for="id_name">{% trans "Declare the user in the policy: " %} <strong>{{ ns }}</strong></label> {% trans "Alias" %}: <input id="id_alias" type="text" name="alias" maxlength="30" value="{{ user.username }}"/> If not given, the username will be taken.</p>
<input type="hidden" name="user_id" value="{{ user.id }}"/>
<input type="hidden" name="namespace_id" value="{{ ns.id }}"/>
<input type="submit" name="{{ submit_name }}" value="{% trans "Add" %}"/>
</form></p>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% if aliases_sources %}
<h3>{% trans "Manage aliases in sources" %}</h3>
<ul>
{% for ns, alias in aliases_sources %}
<li>
<p>{% trans "In " %}<strong>{{ ns.name }}</strong></p>
{% if alias %}
<form method="post" action="/del_any">
<input type="hidden" name="type_entity" value="{{ type_entity }}"/>
<input type="hidden" name="id" value="{{ alias.id }}"/>
{% if back_url %}<input type="hidden" name="back_url" value="{{ back_url }}"/>{% endif %}
<input type="submit" name="Delete" value="{% trans "Delete" %} {{ alias.alias }}"/>
</form>
{% else %}
<p>
<form method="post" action="/set_user_in_source">
<p><label for="id_name">{% trans "The user is known as (provide DN if LDAP):" %}</label><input id="id_alias" type="text" name="alias" maxlength="100" value="{{ user.username }}"/> If not given, the username will be taken.</p>
<input type="hidden" name="user_id" value="{{ user.id }}"/>
<input type="hidden" name="namespace_id" value="{{ ns.id }}"/>
<input type="submit" name="{{ submit_name }}" value="{% trans "Add" %}"/>
</form></p>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
<div class="right">
<a class="back" href="{{ backlink }}">{% trans "Back" %}</a>
</div>
{% endblock %}