templates/website/user/profile/user-profile-authentication.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico, imgUpload, switch %}
  2. {% if user and user.id != 1 and session.userOrigin is empty %}
  3.     <div class="profile-authentication">
  4.         {% if user.authenticationAllow == enum('UserEnum::NO') %}
  5.             <section class="authentication-enable">
  6.                 <div class="info">
  7.                     <div class="title">
  8.                         <span>{{ getLanguage('title_authentication', 'profile') }}</span>
  9.                         <p>{{ getLanguage('subtitle_authentication', 'profile') }}</p>
  10.                     </div>
  11.                     <div class="icon">
  12.                         {{ ico('authentication') }}
  13.                     </div>
  14.                 </div>
  15.                 <p class="tx-centro">
  16.                     <button class="btn-continuar-peq" data-config-authenticator>
  17.                         {% include 'svg/check-circle.svg' %}&ensp;{{ getLanguage('enable_authentication', 'profile') }}
  18.                     </button>
  19.                 </p>
  20.             </section>
  21.         
  22.             {# MODAL -- CONFIG AUTHENTICATOR #}
  23.             {% embed "website/includes/modal.html.twig" with { 'id': 'modal-config-authenticator', 'title': getLanguage('config_authentication', 'profile')} %}
  24.                 {% block content %}
  25.                     {% from 'utils.html.twig' import ico %}
  26.                         <div class="modal-config-authenticator-content">
  27.                             <div class="digitaliztion">
  28.                                 <p>{{ getLanguage('title_qrcode_authentication', 'profile') }}</p>
  29.                                 <img src="{{ qrCode }}">
  30.                                 <div class="contem-copy wrap js--pass-toggle" data-status="hide">
  31.                                     <span class="ico ico-txt" title="Ocultar senha">{{ ico('eye') }}</span>
  32.                                     <span class="ico ico-pass" title="Revelar senha">{{ ico('eye-off') }}</span>
  33.                                     <span class="ico">{{ ico('authenticator-key') }}</span>
  34.                                     <span id="authentication-secret-key-copy">{{ secretKey }}</span>
  35.                                     <input type="password" id="authentication-secret-key" value="{{ secretKey }}" disabled="disabled">
  36.                                     <span class="ico js--copy-authentication-secret-key" data-copy="#authentication-secret-key-copy">{{ ico('copy') }}</span>
  37.                                 </div>
  38.                             </div>
  39.                             <div class="info">
  40.                                 <p>{{ getLanguage('subtitle_qrcode_authentication_one', 'profile') }}</p>
  41.                                 <p>{{ getLanguage('subtitle_qrcode_authentication_two', 'profile') }}</p>
  42.                                 <form id="configAuthentication" action="{{ path('userEnableAuthentication') }}" method="PUT" class="form-geral">
  43.                                     <label for="codeAuthentication">{{ getLanguage('verify_qrcode_authentication', 'profile') }}</label>
  44.                                     <div class="wrap">
  45.                                         <span class="ico">{{ ico('authenticator-code') }}</span>
  46.                                         <span class="cmp">
  47.                                             <input type="hidden" id="secretKey" name="secretKey" value="{{ secretKey }}" >
  48.                                             <input type="code" id="codeAuthentication" name="code" required="required" autofocus="autofocus" maxlength="6" placeholder="X X X X X X">
  49.                                         </span>
  50.                                         <button type="submit" class="btn-continuar-peq">
  51.                                             <span class="ico ico-send">{{ ico('send') }}<i class="loader">{{ ico('loader-wish') }}</i></span>
  52.                                         </button>
  53.                                     </div>
  54.                                 </form>
  55.                             </div>
  56.                         </div>
  57.                 {% endblock %}
  58.             {% endembed %}
  59.         {% endif %}
  60.         {% if user.authenticationAllow == enum('UserEnum::YES') %}
  61.             <section class="authentication-disable" action="{{ path('userDisableAuthentication') }}">
  62.                 <div class="info">
  63.                     <div class="title">
  64.                         <span>{{ getLanguage('title_active_authentication', 'profile') }}</span>
  65.                     </div>
  66.                     <div class="icon">
  67.                         {{ ico('cellphone') }}
  68.                     </div>
  69.                 </div>
  70.                 <div class="authenticator-switch">
  71.                     {% include 'website/controls/switch.html.twig' with {
  72.                         name: 'authenticationAllow',
  73.                         customClass: 'check-input-authentication',
  74.                         checked: (user.authenticationAllow == enum('UserEnum::YES')),
  75.                     }%}
  76.                     <label for="authenticationAllow">{{ getLanguage('config_active_authentication', 'profile') }}</label>
  77.                 </div>
  78.             </section>
  79.         {% endif %}
  80.     </div>
  81. {% endif %}