HackMD/public/views/signin-modal.ejs
alecdwm 02e9927714 Initial support for LDAP server authentication
Limitations as of this commit:

- tlsOptions can only be specified in config.json, not as env vars
- authentication failures are not yet gracefully handled by the UI
  - instead the error message is shown on a blank page (/auth/ldap)
- no email address is associated with the LDAP user's account
- no picture/profile URL is associated with the LDAP user's account
- we might have to generate our own access + refresh tokens,
  because we aren't using oauth. The currently generated
  tokens are just a placeholder.
- 'LDAP Sign in' needs to be translated to each locale
2016-12-13 22:41:07 +01:00

77 lines
4 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- signin modal -->
<div class="modal fade signin-modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="mySmallModalLabel"><%= __('Choose method') %></h4>
</div>
<div class="modal-body" style="text-align: center;">
<% if(facebook) { %>
<a href="<%- url %>/auth/facebook" class="btn btn-lg btn-block btn-social btn-facebook">
<i class="fa fa-facebook"></i> <%= __('Sign in via %s', 'Facebook') %>
</a>
<% } %>
<% if(twitter) { %>
<a href="<%- url %>/auth/twitter" class="btn btn-lg btn-block btn-social btn-twitter">
<i class="fa fa-twitter"></i> <%= __('Sign in via %s', 'Twitter') %>
</a>
<% } %>
<% if(github) { %>
<a href="<%- url %>/auth/github" class="btn btn-lg btn-block btn-social btn-github">
<i class="fa fa-github"></i> <%= __('Sign in via %s', 'GitHub') %>
</a>
<% } %>
<% if(gitlab) { %>
<a href="<%- url %>/auth/gitlab" class="btn btn-lg btn-block btn-social btn-soundcloud">
<i class="fa fa-gitlab"></i> <%= __('Sign in via %s', 'GitLab') %>
</a>
<% } %>
<% if(dropbox) { %>
<a href="<%- url %>/auth/dropbox" class="btn btn-lg btn-block btn-social btn-dropbox">
<i class="fa fa-dropbox"></i> <%= __('Sign in via %s', 'Dropbox') %>
</a>
<% } %>
<% if(google) { %>
<a href="<%- url %>/auth/google" class="btn btn-lg btn-block btn-social btn-google">
<i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %>
</a>
<% } %>
<% if(ldap) { %>
<a type="button" class="btn btn-lg btn-block btn-social btn-reddit "data-toggle="modal" data-target=".signin-ldap-modal">
<i class="fa fa-book"></i> <%= __('Sign in via %s', 'LDAP') %>
</a>
<% } %>
<% if((facebook || twitter || github || gitlab || dropbox || google || ldap) && email) { %>
<hr>
<% }%>
<% if(email) { %>
<h4>Via Email</h4>
<form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded">
<div class="form-group">
<div class="col-sm-12">
<input type="email" class="form-control" name="email" placeholder="Email" required>
<span class="help-block control-label with-errors" style="display: inline;"></span>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input type="password" class="form-control" name="password" placeholder="Password" required>
<span class="help-block control-label with-errors" style="display: inline;"></span>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<button type="submit" class="btn btn-default" formaction="<%- url %>/register">Register</button>
<button type="submit" class="btn btn-primary" formaction="<%- url %>/login">Sign in</button>
</div>
</div>
</form>
<% }%>
</div>
</div>
</div>
</div>