{% extends "::base.html.twig" %}

{% block title %}Administration - My Profile{% endblock %}

{% block navigation %}{% include 'SsoBackendBundle:Layout:navigation.html.twig' %}{% endblock %}
{% block body %}
    <div class="row">
        <div class="col-md-12">
            <h3>Your User Details</h3>
        </div>
        <div class="col-md-6">
            {% if isSamlUser %}
                <table class="table table-striped table-bordered table-condensed">
                    <tr>
                        <td>userProvider</td>
                        <td>SamlToken (IDP Authentication)</td>
                    </tr>
                    <tr>
                        <td>username</td>
                        <td>{{ currentUser.username }}</td>
                    </tr>
                    <tr>
                        <td>firstName</td>
                        <td>{{ currentUser.userSamlData.firstname }}</td>
                    </tr>
                    <tr>
                        <td>lastName</td>
                        <td>{{ currentUser.userSamlData.lastname }}</td>
                    </tr>
                    <tr>
                        <td>email</td>
                        <td>{{ currentUser.userSamlData.email }}</td>
                    </tr>
                    <tr>
                        <td>MFA enabled</td>
                        <td>@ToDo</td>
                    </tr>
                    <tr>
                        <td>roles</td>
                        <td>
                            {% for role in currentUser.roles %}
                                {{ role }}<br>
                            {% endfor %}
                        </td>
                    </tr>
                </table>
                <a class="btn btn-danger" href="{{ path('saml_backend_user_logout') }}">logout</a>
            {% else %}
                <table class="table table-striped table-bordered table-condensed">
                    <tr>
                        <td>UserProvider</td>
                        <td>UserNamePasswordToken (FOS UserBundle)</td>
                    </tr>
                    <tr>
                        <td>email</td>
                        <td>{{ currentUser.email }}</td>
                    </tr>
                    <tr>
                        <td>roles</td>
                        <td>
                            {% for role in currentUser.roles %}
                                {{ role }}<br>
                            {% endfor %}
                        </td>
                    </tr>
                </table>
                <a class="btn btn-danger" href="{{ path('fos_user_security_logout') }}">logout</a>
            {% endif %}
        </div>
    </div>
{% endblock %}
