Custom logging
[wsti_pai.git] / Projects / Views / Manage / ManageLogins.cshtml
1 @model Projects.Models.ManageLoginsViewModel
2 @using Microsoft.Owin.Security
3 @{
4     ViewBag.Title = "Manage your external logins";
5 }
6
7 <h2>@ViewBag.Title.</h2>
8
9 <p class="text-success">@ViewBag.StatusMessage</p>
10 @{
11     var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
12     if (loginProviders.Count() == 0) {
13         <div>
14             <p>
15                 There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkId=313242">this article</a>
16                 for details on setting up this ASP.NET application to support logging in via external services.
17             </p>
18         </div>
19     }
20     else
21     {
22         if (Model.CurrentLogins.Count > 0)
23         {
24             <h4>Registered Logins</h4>
25             <table class="table">
26                 <tbody>
27                     @foreach (var account in Model.CurrentLogins)
28                     {
29                         <tr>
30                             <td>@account.LoginProvider</td>
31                             <td>
32                                 @if (ViewBag.ShowRemoveButton)
33                                 {
34                                     using (Html.BeginForm("RemoveLogin", "Manage"))
35                                     {
36                                         @Html.AntiForgeryToken()
37                                         <div>
38                                             @Html.Hidden("loginProvider", account.LoginProvider)
39                                             @Html.Hidden("providerKey", account.ProviderKey)
40                                             <input type="submit" class="btn btn-default" value="Remove" title="Remove this @account.LoginProvider login from your account" />
41                                         </div>
42                                     }
43                                 }
44                                 else
45                                 {
46                                     @: &nbsp;
47                                 }
48                             </td>
49                         </tr>
50                     }
51                 </tbody>
52             </table>
53         }
54         if (Model.OtherLogins.Count > 0)
55         {
56             using (Html.BeginForm("LinkLogin", "Manage"))
57             {
58                 @Html.AntiForgeryToken()
59                 <div id="socialLoginList">
60                 <p>
61                     @foreach (AuthenticationDescription p in Model.OtherLogins)
62                     {
63                         <button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">@p.AuthenticationType</button>
64                     }
65                 </p>
66                 </div>
67             }
68         }
69     }
70 }