From 1ebb6a67c93969f3d3822893d4e191d14f8fd3e3 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 14 Mar 2018 12:04:41 +0200 Subject: Fixed some issues with primary keys on db. Implemented embroidery import Fit To Scale. Implemented assignment of user last login on machine studio login. --- .../Authentication/DefaultAuthenticationProvider.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index bc57aee20..2fcf55d27 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -60,6 +60,16 @@ namespace Tango.MachineStudio.UI.Authentication throw new AuthenticationException("It seems like you do not have sufficient privileges to run Machine Studio. Please contact your administrator."); } + if (user != null) + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var u = db.Users.Single(x => x.Guid == user.Guid); + u.LastLogin = DateTime.UtcNow; + db.SaveChanges(); + } + } + CurrentUser = user; return user; } -- cgit v1.3.1