{% macro format_checkbox(admin, right, name, users, type) %} {% set id = right['base_id'] %} {% set class = 'base_id' %} {% if type == 'sbas' %} {% set id = right['sbas_id'] %} {% set class = 'sbas_id' %} {% set sbas_class = "" %} {% else %} {% set sbas_class = "inside_sbas_" ~ right['sbas_id'] %} {% endif %} {% set display = 'block' %} {% if right[name] != users|length and name != constant('\\ACL::ACCESS') and right[constant('\\ACL::ACCESS')] != users|length and type != 'sbas' %} {% set display = 'none' %} {% endif %} {% if right[name] == 0 %} {% set class = 'unchecked' %} {% elseif right[name] == users|length %} {% set class = 'checked' %} {% else %} {% set class = 'mixed' %} {% endif %} {% if name == 'access' %} {% if class != 'checked' and type == 'base' and app.getAclForUser(admin).has_access_to_base(id) is empty %}
{% else %}
{% endif %} {% else %} {% if class != 'checked' and type == 'base' and app.getAclForUser(admin).has_right_on_base(id, name) is empty %}
{% elseif class != 'checked' and type == 'sbas' and app.getAclForUser(admin).has_right_on_sbas(id, name) is empty %}
{% else %}
{% endif %} {% endif %} {% endmacro %}
{% if main_user is not empty %} {% set lastConnection = main_user.getLastConnection() is not null ? main_user.getLastConnection() | date('Y-m-d H:i:s') : ' - ' %}

{{ main_user.getDisplayName() ~ ' ( id : ' ~ main_user.getId() ~' ) ' ~ 'admin::compte-utilisateur derniere connexion' | trans ~ ' : ' ~ lastConnection }}

{% endif %}
{% if main_user is not empty %} {% if main_user.isSpecial is not empty %} {% if main_user.getLogin() == 'invite' %} {{ 'Reglages:: reglages d acces guest' | trans }} {% elseif main_user.getLogin() == 'autoregister' %} {{ 'Reglages:: reglages d inscitpition automatisee' | trans }} {% endif %} {% else %} {% set display_name = main_user.getDisplayName() | e %} {% trans with {'%display_name%' : display_name} %}Edition des droits de %display_name%{% endtrans %} {% endif %} {% else %} {% set number = users|length %} {% trans with {'%number%' : number} %}Edition des droits de %number% utilisateurs{% endtrans %} {% endif %} {{ 'Apply a template' | trans }}
{% set sbas = '' %} {% for rights in datas %} {% if rights['sbas_id'] != sbas %} {% set sbas = rights['sbas_id'] %} {% if loop.index != 1 %} {% endif %} {% endif %} {% endfor %}
{{rights['sbas_id']|sbas_labels(app)}}
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::BAS_CHUPUB'), users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::BAS_MODIF_TH'), users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::BAS_MANAGE'), users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::BAS_MODIFY_STRUCT'), users, 'sbas')}}
{{rights['base_id']|bas_labels(app)}}
{{'admin::users:edit: check read right' | trans }}
{{'admin::users:edit: check all right' | trans }}
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::ACCESS'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::ACTIF'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANPUTINALBUM'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDWNLDPREVIEW'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::NOWATERMARK'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDWNLDHD'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANCMD'), users, 'base')}}
{% if rights[constant('\\ACL::RESTRICT_DWNLD')] > 0 %} {% else %} {% endif %}
{% if rights['time_limited'] > 0 %} {% else %} {% endif %}
{% if rights['masks'] > 0 %} {% else %} {% endif %}
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANADDRECORD'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANMODIFRECORD'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CHGSTATUS'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDELETERECORD'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::IMGTOOLS'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANADMIN'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANREPORT'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANPUSH'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::COLL_MANAGE'), users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::COLL_MODIFY_STRUCT'), users, 'base')}}
{% if main_user is not empty and main_user.isTemplate is empty and main_user.isSpecial is empty %}
{{ 'admin::compte-utilisateur identifiant' | trans }}
{{ 'admin::compte-utilisateur sexe' | trans }}
{{ 'admin::compte-utilisateur prenom' | trans }}
{{ 'admin::compte-utilisateur nom' | trans }}
{{ 'admin::compte-utilisateur email' | trans }}
{{ 'admin::compte-utilisateur adresse' | trans }}
{{ 'admin::compte-utilisateur code postal' | trans }}
{{ 'admin::compte-utilisateur ville' | trans }}
{{ 'admin::compte-utilisateur poste' | trans }}
{{ 'admin::compte-utilisateur societe' | trans }}
{{ 'admin::compte-utilisateur activite' | trans }}
{{ 'admin::compte-utilisateur telephone' | trans }}
{{ 'admin::compte-utilisateur fax' | trans }}
{% set usrProviders = app['repo.usr-auth-providers'].findByUser(main_user) %} {% if usrProviders|length > 0 %}

{{ 'admin::users: list user providers' | trans }}

{% for usrProvider in usrProviders %} {% endfor %}
{{ 'admin::users: provider' | trans }} {{ 'admin::users: distance_id' | trans }} {{ 'admin::users: creation date' | trans }} {{ 'admin::users: modification date' | trans }}
{{ usrProvider.getProvider() }} {{ usrProvider.getDistantId() }} {{ usrProvider.getUpdated() | date('Y-m-d H:i:s') }} {{ usrProvider.getCreated() | date('Y-m-d H:i:s')}}
{% endif %}

{{ 'admin::users: list user api application' | trans }}

{% set apiApplications = app['repo.api-applications'].findByUser(main_user, true) %} {% if apiApplications|length > 0 %} {% for apiApplication in apiApplications %}

- {{ apiApplication.getName() }} {% if apiApplication.getCreator() is not empty and apiApplication.getCreator().getId() == main_user.getId() %} {{ 'admin :users: user owned api' | trans }} {% else %} {{ 'admin::users: user api use' | trans }} {% endif %}

{{ 'admin::users: api ID' | trans }} : {{ apiApplication.getId() }}
{{ 'admin::users: creation date' | trans }} : {{ apiApplication.getCreated() | date('Y-m-d H:i:s') }}
{{ 'admin::users: modification date' | trans }} : {{ apiApplication.getUpdated() | date('Y-m-d H:i:s') }}
{{ 'admin::users: grant password info' | trans }} : {% if apiApplication.isPasswordGranted() %} {{ 'admin::users: password granted' | trans }} {% else %} {{ 'admin::users: password not granted' | trans }} {% endif %}
{{ 'admin::users: type info' | trans }} : {{ apiApplication.getType() }}
{{ 'admin::users: webhook url' | trans }} : {{ apiApplication.getWebhookUrl() }}
{% endfor %} {% else %}
{{ 'admin::users: no api defined for this user' | trans }}
{% endif %} {% set apiCodes = app['orm.em'].getRepository('Phraseanet:ApiOauthCode').findByUserAccount(main_user) %} {% if apiCodes | length > 0 %}

{{ 'admin::users: api oauth code list' | trans }}

{% for apiCode in apiCodes %} {% endfor %}
{{ 'admin::users: Api id' | trans }} {{ 'admin::users: Api name' | trans }} {{ 'admin::users: redirect uri' | trans }} {{ 'admin::users: scope' | trans }} {{ 'admin::users: creation date' | trans }}
{{ apiCode.account.application.id }} {{ apiCode.account.application.name }} {{ apiCode.redirectUri }} {{ apiCode.scope }} {{ apiCode.created | date('Y-m-d H:i:s') }}
{% endif %}
{% set failuresLocked = app['repo.auth-failures'].findBy({'username':main_user.getLogin(), 'locked': true}, {'created': 'desc'}) %} {% if failuresLocked | length > 0 %}

{{ 'admin::users: auth failure locked list' | trans }}

{% for failure in failuresLocked %} {% endfor %}
{{ 'admin::users: username' | trans }} {{ 'admin::users: ip' | trans }} {{ 'admin::users: creation date' | trans }}
{{ failure.getUsername() }} {{ failure.getIp }} {{ failure.getCreated() | date('Y-m-d H:i:s') }}
{% endif %}
{% set failuresUnlocked = app['repo.auth-failures'].findBy({'username':main_user.getLogin(), 'locked': false}, {'created': 'desc'}) %} {% if failuresUnlocked | length > 0 %}

{{ 'admin::users: auth failure unlocked list' | trans }}

{% for failure in failuresUnlocked %} {% endfor %}
{{ 'admin::users: username' | trans }} {{ 'admin::users: ip' | trans }} {{ 'admin::users: creation date' | trans }}
{{ failure.getUsername() }} {{ failure.getIp() }} {{ failure.getCreated() | date('Y-m-d H:i:s') }}
{% endif %}

User record acl

{{ records_acl|length }} / {{ total_count }} (last 200 rights displayed)

{% for r_a in records_acl %} {% endfor %}
databox name record_id right on document right on subdef type pusher name expire on
{{ r_a.sbas_id | sbas_labels(app) }} {{ r_a.record_id }} {{ r_a.document }} {{ r_a.preview }} {{ r_a.type }} {{ r_a.pusher_name }} {% if r_a.expire_on %} {{ r_a.expire_on|date('Y-m-d H:i:s') }} {% if r_a.expire_on|date('Y-m-d H:i:s') > "now"|date('Y-m-d H:i:s') %} {% else %} {% endif %} {% else %} - {% endif %}

{{ "User's publications in feeds" | trans}}

{% for f in feeds %}
{{ f.title }} {% if f.public %}public{% endif %} {{ feeds_count[f.getId()] }} publication(s)
{% endfor %}

User basket

{{ basket_elements|length }} / {{ basket_elements_count }} (last 200 basket records displayed)

{% for b_e in basket_elements %} {% endfor %}
databox name record_id Basket name
{{ b_e.getSbasId() | sbas_labels(app) }} {{ b_e.getRecordId() }} {{ b_e.basket.name }}
{% endif %}
{{ 'boutton::retour' | trans }}