login.html.twig 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {% extends 'HWIOAuthBundle::layout.html.twig' %}
  2. {% block hwi_oauth_content %}
  3. {% if error %}
  4. <div>{{ error }}</div>
  5. {% endif %}
  6. {# HWIOAuthBundle uses the same template for the login and the connect functionality currently
  7. so we need to check if the user is already authenticated. #}
  8. {% if not app.user %}
  9. <div class="loginForm">
  10. <form action="{{ path('login_check') }}" method="post">
  11. <div>
  12. <label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
  13. <input type="text" id="username" name="_username" />
  14. </div>
  15. <div>
  16. <label for="password">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
  17. <input type="password" id="password" name="_password" />
  18. </div>
  19. <div>
  20. <input type="checkbox" id="remember_me" name="_remember_me" value="on" checked="checked" />
  21. <label for="remember_me">{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}</label>
  22. </div>
  23. {% if packagist_host and packagist_host in app.request.headers.get('Referer') %}
  24. <input type="hidden" name="_target_path" value="{{ app.request.headers.get('Referer') }}" />
  25. {% endif %}
  26. <input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
  27. </form>
  28. <p>
  29. <a href="{{ path('fos_user_resetting_request') }}">Forgot password?</a>
  30. {% for owner in hwi_oauth_resource_owners() %}
  31. <a class="login-{{ owner }}" href="{{ hwi_oauth_login_url(owner) }}">Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a> <br />
  32. {% endfor %}
  33. </p>
  34. </div>
  35. {% else %}
  36. {% for owner in hwi_oauth_resource_owners() %}
  37. <a class="login-{{ owner }}" href="{{ hwi_oauth_login_url(owner) }}">Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a> <br />
  38. {% endfor %}
  39. {% endif %}
  40. {% endblock hwi_oauth_content %}