{% extends 'edit.twig' %} {% block inner_content %} {% if result %} {# XOAUTH2 sources are managed by admins and domain admins only #} {% set ro = not result.can_edit or (mailcow_cc_role == 'user' and result.auth_type == 'XOAUTH2') %} {% set show_oauth = mailcow_cc_role != 'user' or result.auth_type == 'XOAUTH2' %} {% set is_cc = result.auth_type == 'XOAUTH2' and result.oauth_flow != 'authorization_code' %}

{{ lang.syncjobs.source }}: {{ result.name }}

{% if ro %} {% endif %}
{% if result.created_by %}
{% endif %} {% if (mailcow_cc_role == 'admin' or mailcow_cc_role == 'domainadmin') and not ro %} {% else %}
{% set scope_targets = result.scope == 'domain' ? result.domains : (result.scope == 'user' ? result.users : []) %}
{% endif %}
{% if show_oauth %}
{{ lang.syncjobs.source_oauth_block }}
{% if not ro %} {{ lang.syncjobs.source_redirect_uri_hint }} {% endif %}
{% if not ro %}
{{ lang.syncjobs.source_secret_unchanged_hint }}
{% endif %}
{% if not ro %}
{{ lang.syncjobs.source_oauth_extra_params_hint }}
{% endif %} {% if is_cc %} {# token state of the stored client credentials token (authorization_code tokens live per sync job) #}

{% if result.oauth_last_refresh_error %} {{ lang.syncjobs.token_state_failed }} {% elseif result.has_access_token %} {{ lang.syncjobs.token_state_issued }} {% if result.oauth_token_expires %}{{ lang.syncjobs.source_token_status }}: {{ result.oauth_token_expires|date('Y-m-d H:i:s') }}{% endif %} {% else %} {{ lang.syncjobs.token_state_none }} {% endif %}

{% if result.oauth_last_refresh_error %}

{{ lang.syncjobs.source_token_error }}: {{ result.oauth_last_refresh_error }}

{% endif %} {% if not ro %} {# own data-id: must not harvest/post the form fields #} {% endif %}
{% endif %}
{% endif %}
{% if not ro %}
{% endif %}
{% else %} {{ parent() }} {% endif %} {% endblock %}