{{ moduleHeader('user', 'Members'|trans, true, true) }}
<h3>
    <span class="fas fa-user-check"></span>
    {% trans %}Users online{% endtrans %}
</h3>
{% if getModVar('ZConfig', 'sessionstoretofile', constant('Zikula\\SecurityCenterModule\\Constant::SESSION_STORAGE_FILE')) == constant('Zikula\\SecurityCenterModule\\Constant::SESSION_STORAGE_FILE') %}
    <div class="alert alert-info">{% trans %}This information is not available.{% endtrans %}
    {% if hasPermission('ZikulaSecurityCenterModule::', '::', 'ACCESS_ADMIN') %}
        <br />{% trans %}Admin Message: Sessions are configured to store in a file.{% endtrans %}&nbsp;
        <a href="{{ path('zikulasecuritycentermodule_config_config') }}">{% trans %}Reconfigure session storage{% endtrans %}</a>
    {% endif %}
    </div>
{% else %}
    <table class="table table-bordered table-striped table-sm">
        <colgroup>
            <col id="cUserName" />
            {% if messageModule|default %}
                <col id="cMessages" />
            {% endif %}
            {% if 'url' in activeProperties %}
                <col id="cSite" />
            {% endif %}
        </colgroup>
        <thead>
            <tr>
                <th id="hUserName" scope="col">{% trans %}User name{% endtrans %}</th>
                {% if messageModule|default %}
                    <th id="hMessages" scope="col">{% trans %}Messages{% endtrans %}</th>
                {% endif %}
                {% if 'url' in activeProperties %}
                    <th id="hSite" scope="col">{% trans %}Site{% endtrans %}</th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% for user in paginator.results|filter(u => u.uid != constant('Zikula\\UsersModule\\Constant::USER_ID_ANONYMOUS')) %}
            <tr>
                <td headers="hUserName"><strong>{{ user.uname|profileLinkByUserName() }}</strong> ({{ user.uname }})</td>
                {% if messageModule|default %}
                    <td headers="hMessages"><a href="{{ user.uid|messageSendLink(true) }}"><i class="fas fa-envelope fa-lg"></i></a></td>
                {% endif %}
                {% if 'url' in activeProperties %}
                    <td headers="hSite">
                        {% set url = user.attributes[prefix ~ ':url']|default %}
                        {% if url and url != 'http://' %}
                            <a href="{{ url|e('html_attr') }}"><i class="fas fa-globe fa-lg" title="{{ url|e('html_attr') }}"></i></a>
                        {% endif %}
                    </td>
                {% endif %}
            </tr>
            {% else %}
                <tr class="table-info"><td colspan="3" class="text-center">{% trans %}No registered users are currently online.{% endtrans %}</td></tr>
            {% endfor %}
        </tbody>
    </table>
    {{ include(paginator.template) }}
{% endif %}
