Hide/show account management ui based on authentication mode

This commit is contained in:
Johannes Zellner 2016-08-11 14:44:43 +02:00
parent b9f4b286c5
commit 67fc7939df
3 changed files with 84 additions and 63 deletions

View file

@ -7,7 +7,14 @@
<hr> <hr>
<form class="form-horizontal" method="post" action="/users/account"> {{#if ldap.enabled}}
<p>
This account is managed through LDAP.<br/>
<br/>
Associated Email Address: <a href="mailto:{{email}}">{{email}}</a>
</p>
{{else}}
<form class="form-horizontal" method="post" action="/users/account">
<input type="hidden" name="_csrf" value="{{csrfToken}}"> <input type="hidden" name="_csrf" value="{{csrfToken}}">
@ -61,4 +68,5 @@
</div> </div>
</div> </div>
</form> </form>
{{/if}}

View file

@ -8,10 +8,17 @@
<hr> <hr>
<p>Please provide the username or email address that you used when you signed up for your Mailtrain account.</p> {{#if ldap.enabled}}
<p>We will send you an email that will allow you to reset your password.</p> <p>
Accounts are managed through LDAP.<br/>
<br/>
<a href="{{ldap.passwordresetlink}}">Reset Password</a>
</p>
{{else}}
<p>Please provide the username or email address that you used when you signed up for your Mailtrain account.</p>
<p>We will send you an email that will allow you to reset your password.</p>
<form class="form-horizontal" role="login" method="post" action="/users/forgot"> <form class="form-horizontal" role="login" method="post" action="/users/forgot">
<input type="hidden" name="_csrf" value="{{csrfToken}}"> <input type="hidden" name="_csrf" value="{{csrfToken}}">
@ -26,4 +33,5 @@
<button type="submit" class="btn btn-primary">Send verification email</button> <button type="submit" class="btn btn-primary">Send verification email</button>
</div> </div>
</div> </div>
</form> </form>
{{/if}}

View file

@ -32,7 +32,12 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-xs-4"> <div class="col-sm-offset-2 col-xs-4">
<button type="submit" class="btn btn-primary">Sign in</button> or <a href="/users/forgot">Forgot password?</a> <button type="submit" class="btn btn-primary">Sign in</button> or
{{#if ldap.enabled}}
<a href="{{ldap.passwordresetlink}}">Forgot password?</a>
{{else}}
<a href="/users/forgot">Forgot password?</a>
{{/if}}
</div> </div>
</div> </div>
</form> </form>