|
|
@@ -1,6 +1,7 @@ |
|
|
|
@model Teknik.Areas.Users.ViewModels.SettingsViewModel |
|
|
|
|
|
|
|
@using Teknik.Utilities |
|
|
|
@using Teknik.Areas.Users.Models |
|
|
|
|
|
|
|
<script> |
|
|
|
var homeUrl = '@Url.SubRouteUrl("www", "Home.Index")'; |
|
|
@@ -9,6 +10,10 @@ |
|
|
|
var resendVerifyURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "ResendVerifyRecoveryEmail"})'; |
|
|
|
var confirmAuthSetupURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "VerifyAuthenticatorCode" })'; |
|
|
|
var clearTrustedDevicesURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "ClearTrustedDevices" })'; |
|
|
|
var generateTokenURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "GenerateToken" })'; |
|
|
|
var revokeAllTokensURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "RevokeAllTokens" })'; |
|
|
|
var editTokenName = '@Url.SubRouteUrl("user", "User.Action", new { action = "EditTokenName" })'; |
|
|
|
var deleteTokenURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "DeleteToken" })'; |
|
|
|
</script> |
|
|
|
|
|
|
|
@Styles.Render("~/Content/user") |
|
|
@@ -127,7 +132,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-4"> |
|
|
|
<div class="col-sm-4 text-left"> |
|
|
|
<div class="row"> |
|
|
|
<div class="form-group col-sm-12"> |
|
|
|
<label for="update_recovery_email"><h4>Recovery Email</h4></label> |
|
|
@@ -147,30 +152,58 @@ |
|
|
|
} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-4 text-left"> |
|
|
|
<label for="update_security_two_factor"><h4>Enable Two Factor Authentication</h4></label> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input id="update_security_two_factor" name="update_security_two_factor" title="whether two factor authentication should occur for this account" type="checkbox" value="true" @(Model.SecuritySettings.TwoFactorEnabled ? "checked" : string.Empty) /> |
|
|
|
</label> |
|
|
|
<div class="row"> |
|
|
|
<div class="form-group col-sm-12 text-left"> |
|
|
|
<label for="update_security_two_factor"><h4>Enable Two Factor Authentication</h4></label> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input id="update_security_two_factor" name="update_security_two_factor" title="whether two factor authentication should occur for this account" type="checkbox" value="true" @(Model.SecuritySettings.TwoFactorEnabled ? "checked" : string.Empty) /> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<p class="form-control-static @(Model.SecuritySettings.TwoFactorEnabled ? string.Empty : "hide")" id="setupAuthenticatorLink"> |
|
|
|
<small><a href="#" class="text-primary" id="SetupAuthenticator" data-toggle="modal" data-target="#authenticatorSetup"><i class="fa fa-lock"></i> Set Up Authenticator</a></small> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="form-group col-sm-12 text-left"> |
|
|
|
<label for="update_security_allow_trusted"><h4>Allow Trusted Devices</h4></label> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input id="update_security_allow_trusted" name="update_security_allow_trusted" title="whether a device could be cached to bypass two factor authentication" type="checkbox" value="true" @(Model.SecuritySettings.AllowTrustedDevices ? "checked" : string.Empty) /> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<p class="form-control-static @(Model.SecuritySettings.AllowTrustedDevices ? string.Empty : "hide")" id="ClearDevicesLink"> |
|
|
|
<small><a href="#" class="text-primary" id="ClearDevices">Clear Trusted Devices (@Model.TrustedDeviceCount)</a></small> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<p class="form-control-static @(Model.SecuritySettings.TwoFactorEnabled ? string.Empty : "hide")" id="setupAuthenticatorLink"> |
|
|
|
<small><a href="#" class="text-primary" id="SetupAuthenticator" data-toggle="modal" data-target="#authenticatorSetup"><i class="fa fa-lock"></i> Set Up Authenticator</a></small> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<div class="col-sm-4 text-left"> |
|
|
|
<label for="update_security_allow_trusted"><h4>Allow Trusted Devices</h4></label> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input id="update_security_allow_trusted" name="update_security_allow_trusted" title="whether a device could be cached to bypass two factor authentication" type="checkbox" value="true" @(Model.SecuritySettings.AllowTrustedDevices ? "checked" : string.Empty) /> |
|
|
|
</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<br /> |
|
|
|
<label for="authCodes"><h4>Authentication Tokens</h4></label><span class="pull-right"><button type="button" class="btn btn-default" id="generate_token">Generate Token</button> <button type="button" class="btn btn-danger" id="revoke_all_tokens">Revoke All</button></span> |
|
|
|
<div id="authCodes" style="overflow-y: auto; max-height: 400px;"> |
|
|
|
<ul class="list-group"> |
|
|
|
@if (Model.AuthTokens.Any()) |
|
|
|
{ |
|
|
|
foreach (AuthToken token in Model.AuthTokens) |
|
|
|
{ |
|
|
|
<li class="list-group-item"> |
|
|
|
<div class="btn-group btn-group-sm pull-right" role="group" aria-label="..."> |
|
|
|
<button type="button" class="btn btn-default">Edit</button> |
|
|
|
<button type="button" class="btn btn-danger text-danger">Delete</button> |
|
|
|
</div> |
|
|
|
<h4 class="list-group-item-heading" id="update_auth_token_name">@token.Name</h4> |
|
|
|
<p class="list-group-item-text">Last Used on <time datetime="@token.LastDateUsed.ToString("s")">@token.LastDateUsed.ToString("MMMM dd, yyyy hh:mm tt")</time></p> |
|
|
|
</li> |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
<li class="list-group-item text-center">No Auth Codes</li> |
|
|
|
} |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
<p class="form-control-static @(Model.SecuritySettings.AllowTrustedDevices ? string.Empty : "hide")" id="ClearDevicesLink"> |
|
|
|
<small><a href="#" class="text-primary" id="ClearDevices">Clear Trusted Devices (@Model.TrustedDeviceCount)</a></small> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |