Store the account type ("hydra" or "persona") explicitly in the database

This commit is contained in:
Eelco Dolstra
2013-11-05 11:46:05 +01:00
parent 14b9b201e1
commit 36c961a376
7 changed files with 22 additions and 10 deletions

View File

@ -96,7 +96,7 @@
<small>
<em><a href="http://nixos.org/hydra" target="_blank">Hydra</a> [% HTML.escape(version) %] (using [% HTML.escape(nixVersion) %]).</em>
[% IF c.user_exists %]
You are signed in as <tt>[% HTML.escape(c.user.username) %]</tt>.
You are signed in as <tt>[% HTML.escape(c.user.username) %]</tt>[% IF c.user.type == 'persona' %] via Persona[% END %].
[% END %]
</small>
</footer>
@ -113,7 +113,7 @@
}
</script>
[% IF c.user_exists && c.user.password != '!' %]
[% IF c.user_exists && c.user.type == 'hydra' %]
<script>
$("#persona-signout").click(doLogout);
</script>

View File

@ -128,7 +128,7 @@
</li>
<li class="divider"></li>
<li>
<a href="[% c.uri_for('/login') %]">Sign in with a Hydra user name</a>
<a href="[% c.uri_for('/login') %]">Sign in with a Hydra account</a>
</li>
[% END %]
[% END %]

View File

@ -34,7 +34,7 @@
</div>
</div>
[% IF !create && user.password != '!' %]
[% IF !create && user.type == 'hydra' %]
<div class="control-group">
<label class="control-label">Password</label>
<div class="controls">
@ -101,7 +101,7 @@
<i class="icon-ok icon-white"></i>
[%IF create %]Create[% ELSE %]Apply changes[% END %]
</button>
[% IF !create && c.check_user_roles('admin') && user.password != '!' %]
[% IF !create && c.check_user_roles('admin') && user.type == 'hydra' %]
<button id="reset-password" type="submit" class="btn btn-warning" name="submit" value="reset-password">
<i class="icon-trash icon-white"></i>
Reset password