Skip to content

Commit

Permalink
Merge pull request #797 from tidusjar/dev
Browse files Browse the repository at this point in the history
#788 fixed!
  • Loading branch information
tidusjar authored Dec 16, 2016
2 parents 5002236 + ce95fe4 commit 485d7e9
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions PlexRequests.UI/Modules/UserLoginModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,25 @@ private async Task<Response> LoginUser()
{
if (!settings.UserAuthentication)// Do not need to auth make admin use login screen for now TODO remove this
{
var perms = (Permissions)dbUser.Permissions;
if (perms.HasFlag(Permissions.Administrator))
if (dbUser != null)
{
var uri = Linker.BuildRelativeUri(Context, "UserLoginIndex");
Session["TempMessage"] = Resources.UI.UserLogin_AdminUsePassword;
return Response.AsRedirect(uri.ToString());
var perms = (Permissions) dbUser.Permissions;
if (perms.HasFlag(Permissions.Administrator))
{
var uri = Linker.BuildRelativeUri(Context, "UserLoginIndex");
Session["TempMessage"] = Resources.UI.UserLogin_AdminUsePassword;
return Response.AsRedirect(uri.ToString());
}
}
if (plexLocal != null)
{
var perms = (Permissions)plexLocal.Permissions;
if (perms.HasFlag(Permissions.Administrator))
{
var uri = Linker.BuildRelativeUri(Context, "UserLoginIndex");
Session["TempMessage"] = Resources.UI.UserLogin_AdminUsePassword;
return Response.AsRedirect(uri.ToString());
}
}
}
}
Expand Down

0 comments on commit 485d7e9

Please sign in to comment.