2021-12-28 16:17:07 +01:00
|
|
|
{# -*- mode: jinja-html -*- #}
|
2023-01-30 22:25:17 +01:00
|
|
|
{% extends "base.j2" %}
|
2023-11-15 20:38:51 +01:00
|
|
|
{% import 'wtf.j2' as wtf %}
|
2021-10-17 11:19:01 +02:00
|
|
|
|
|
|
|
{% block app_content %}
|
|
|
|
|
2023-03-02 14:49:18 +01:00
|
|
|
<div class="user_info">
|
2021-10-17 11:19:01 +02:00
|
|
|
<h2>Utilisateur: {{user.user_name}} ({{'actif' if user.active else 'fermé'}})</h2>
|
2023-03-02 14:49:18 +01:00
|
|
|
<div class="user_basics">
|
2021-12-28 16:17:07 +01:00
|
|
|
<b>Login :</b> {{user.user_name}}<br>
|
2023-02-26 21:24:07 +01:00
|
|
|
<b>CAS id:</b> {{user.cas_id or "(aucun)"}}
|
2023-11-22 17:55:15 +01:00
|
|
|
{% if ScoDocSiteConfig.is_cas_enabled() %}
|
|
|
|
(CAS {{'autorisé' if user.cas_allow_login else 'interdit'}} pour cet utilisateur)
|
|
|
|
{% if user.cas_allow_scodoc_login %}
|
|
|
|
(connexion sans CAS autorisée)
|
|
|
|
{% endif %}
|
2023-03-01 19:10:37 +01:00
|
|
|
{% endif %}
|
2023-02-26 21:24:07 +01:00
|
|
|
<br>
|
2021-12-28 16:17:07 +01:00
|
|
|
<b>Nom :</b> {{user.nom or ""}}<br>
|
|
|
|
<b>Prénom :</b> {{user.prenom or ""}}<br>
|
|
|
|
<b>Mail :</b> {{user.email}}<br>
|
2023-03-14 16:30:27 +01:00
|
|
|
<b>Mail institutionnel:</b> {{user.email_institutionnel or ""}}<br>
|
2023-11-21 22:28:50 +01:00
|
|
|
<b>Identifiant EDT:</b> {{user.edt_id or ""}}<br>
|
2023-03-03 14:33:26 +01:00
|
|
|
<b>Rôles :</b> {{user.get_roles_string()}}<br>
|
|
|
|
<b>Dept :</b> {{user.dept or ""}}<br>
|
|
|
|
{% if user.passwd_temp or user.password_scodoc7 %}
|
|
|
|
<b class="fontred">⚠️ mot de passe invalide (compte ancien non migré à réactiver ou à fermer)</b><br>
|
|
|
|
{% endif %}
|
|
|
|
|
2023-03-02 14:49:18 +01:00
|
|
|
</div>
|
|
|
|
{% if current_user.is_administrator() %}
|
|
|
|
<div class="user_info_admin">
|
2024-04-02 23:37:23 +02:00
|
|
|
<b>Dernière vue :</b> {{user.last_seen.strftime(scu.DATEATIME_FMT) if user.last_seen else "-"}}<br>
|
|
|
|
<b>Dernière connexion CAS :</b> {{user.cas_last_login.strftime(scu.DATEATIME_FMT) if user.cas_last_login else "-"}}<br>
|
2023-03-02 14:49:18 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
<div class="user_basics">
|
2021-12-28 16:17:07 +01:00
|
|
|
<b>Dernière modif mot de passe:</b>
|
2024-04-02 23:37:23 +02:00
|
|
|
{{user.date_modif_passwd.strftime(scu.DATE_FMT) if user.date_modif_passwd else ""}}<br>
|
2021-12-28 16:17:07 +01:00
|
|
|
<b>Date d'expiration:</b>
|
2024-04-02 23:37:23 +02:00
|
|
|
{{user.date_expiration.strftime(scu.DATE_FMT) if user.date_expiration else "(sans limite)"}}
|
2023-03-02 14:49:18 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2021-10-17 11:19:01 +02:00
|
|
|
<ul>
|
2022-08-26 14:05:25 +02:00
|
|
|
{% if (
|
2023-01-30 22:25:17 +01:00
|
|
|
current_user.is_administrator()
|
2023-09-29 21:17:31 +02:00
|
|
|
or current_user.has_permission(Permission.UsersAdmin, user.dept)
|
2022-08-26 14:05:25 +02:00
|
|
|
) %}
|
2021-10-17 11:19:01 +02:00
|
|
|
<li><a class="stdlink" href="{{
|
2023-11-15 20:38:51 +01:00
|
|
|
url_for( 'users.form_change_password',
|
2021-10-17 11:19:01 +02:00
|
|
|
scodoc_dept=g.scodoc_dept, user_name=user.user_name)
|
|
|
|
}}">modifier le mot de passe ou l'adresse mail</a>
|
|
|
|
</li>
|
2022-08-26 14:05:25 +02:00
|
|
|
{% endif %}
|
2023-09-29 21:17:31 +02:00
|
|
|
{% if current_user.has_permission(Permission.UsersAdmin, dept) %}
|
2021-10-17 11:19:01 +02:00
|
|
|
<li><a class="stdlink" href="{{
|
2023-11-15 20:38:51 +01:00
|
|
|
url_for('users.create_user_form', scodoc_dept=g.scodoc_dept,
|
2021-10-17 11:19:01 +02:00
|
|
|
user_name=user.user_name, edit=1)
|
2022-08-26 14:05:25 +02:00
|
|
|
}}">modifier ce compte et ses rôles</a>
|
2021-12-28 16:17:07 +01:00
|
|
|
</li>
|
2021-10-17 11:19:01 +02:00
|
|
|
{% endif %}
|
2022-08-26 14:05:25 +02:00
|
|
|
{% if (
|
2023-01-30 22:25:17 +01:00
|
|
|
current_user.is_administrator()
|
2023-09-29 21:17:31 +02:00
|
|
|
or current_user.has_permission(Permission.UsersAdmin, user.dept)
|
2022-08-26 14:05:25 +02:00
|
|
|
) %}
|
2023-01-30 22:25:17 +01:00
|
|
|
<li><a class="stdlink" href="{{
|
2023-11-15 20:38:51 +01:00
|
|
|
url_for('users.toggle_active_user', scodoc_dept=g.scodoc_dept,
|
2022-08-26 14:05:25 +02:00
|
|
|
user_name=user.user_name)
|
|
|
|
}}">{{"désactiver" if user.active else "activer"}} ce compte</a>
|
2023-01-30 22:25:17 +01:00
|
|
|
</li>
|
2022-08-26 14:05:25 +02:00
|
|
|
{% endif %}
|
2021-10-17 11:19:01 +02:00
|
|
|
</ul>
|
2023-03-02 14:49:18 +01:00
|
|
|
</div>
|
2021-10-17 11:19:01 +02:00
|
|
|
|
|
|
|
{% if current_user.id == user.id %}
|
2023-02-26 21:24:07 +01:00
|
|
|
<div class="user_info_session">
|
|
|
|
{% if session_info %}
|
|
|
|
<p><b>CAS session started at </b>{{ session_info }}</p>
|
|
|
|
{% endif %}
|
|
|
|
<p><b>Se déconnecter:
|
|
|
|
<a class="stdlink" href="{{url_for('auth.logout')}}">logout</a>
|
|
|
|
</b>
|
|
|
|
</p>
|
2024-01-26 22:58:22 +01:00
|
|
|
{% if not (ScoDocSiteConfig.is_cas_enabled() and not user.cas_allow_scodoc_login) %}
|
2024-01-26 16:50:20 +01:00
|
|
|
<p><b>
|
|
|
|
<a class="stdlink" href="{{
|
|
|
|
url_for( 'users.form_change_password',
|
|
|
|
scodoc_dept=g.scodoc_dept, user_name=user.user_name)
|
|
|
|
}}">Changer votre mot de passe ScoDoc ou votre mail</a>
|
|
|
|
</b>
|
|
|
|
</p>
|
2024-01-26 22:58:22 +01:00
|
|
|
{% endif %}
|
2023-02-26 21:24:07 +01:00
|
|
|
</div>
|
2021-10-17 11:19:01 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{# Liste des permissions #}
|
|
|
|
<div class="permissions">
|
2022-08-26 14:05:25 +02:00
|
|
|
<p><b>Permissions de cet utilisateur dans le département {{dept}}:</b></p>
|
2021-12-28 16:17:07 +01:00
|
|
|
<ul>
|
|
|
|
{% for p in Permission.description %}
|
|
|
|
<li>{{Permission.description[p]}} :
|
2023-03-02 14:49:18 +01:00
|
|
|
<b>{{
|
2021-12-28 16:17:07 +01:00
|
|
|
"oui" if user.has_permission(Permission.get_by_name(p), dept) else "non"
|
2023-03-02 14:49:18 +01:00
|
|
|
}}</b>
|
2021-12-28 16:17:07 +01:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2021-10-17 11:19:01 +02:00
|
|
|
</div>
|
|
|
|
|
2023-09-29 21:17:31 +02:00
|
|
|
{% if current_user.has_permission(Permission.UsersAdmin, dept) %}
|
2021-10-17 11:19:01 +02:00
|
|
|
<p><a class="stdlink" href="
|
|
|
|
{{url_for('users.index_html', scodoc_dept=g.scodoc_dept)}}
|
|
|
|
">Liste de tous les utilisateurs</a></p>
|
|
|
|
|
2023-03-02 14:49:18 +01:00
|
|
|
</div>
|
2021-10-17 11:19:01 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
2023-11-15 20:38:51 +01:00
|
|
|
{% endblock %}
|