Config.Entities.User.CurrentUser --> Config.Data.CurrentUser

Config.Entities.User.LastAuthorization --> Config.Data.lastAuthorization
This commit is contained in:
Milan Hanajik
2016-12-20 14:22:56 +01:00
parent 435e47707d
commit 9bd409e672
12 changed files with 54 additions and 64 deletions
+19 -20
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.IO;
@@ -32,7 +32,6 @@ namespace TBF
public static System.Globalization.CultureInfo AltCulture;
/// <summary>
/// Selected procedure data
/// - before the main program window is open, objects referenced by this variable
@@ -218,27 +217,27 @@ namespace TBF
///
/// Try authorisation with Users DB first
///
//if (!authorized)
//{
// bool settingsChanged = false;
if (!authorized)
{
bool settingsChanged = false;
// if (string.IsNullOrEmpty(LocalSettings.TestBenches[i].UsersDBSettings.ConnectionString))
// {
// LocalSettings.TestBenches[i].UsersDBSettings.ConnectionString = LocalSettings.TestBenches[i].ProceduresDBSettings.ConnectionString;
// LocalSettings.TestBenches[i].UsersDBSettings.DbType = LocalSettings.TestBenches[i].ProceduresDBSettings.DbType;
// settingsChanged = true;
// }
if (string.IsNullOrEmpty(LocalSettings.TestBenches[i].UsersDBSettings.ConnectionString))
{
LocalSettings.TestBenches[i].UsersDBSettings.ConnectionString = LocalSettings.TestBenches[i].ProceduresDBSettings.ConnectionString;
LocalSettings.TestBenches[i].UsersDBSettings.DbType = LocalSettings.TestBenches[i].ProceduresDBSettings.DbType;
settingsChanged = true;
}
// /// Load user from the UsersAndGroupsDB database
// loadedUser = Users.Entities.User.LoadUserByName(loginDlgBench.User,
// LocalSettings.TestBenches[i].UsersDBSettings);
// if (loadedUser != null)
// {
// authorized = loadedUser.Authorize(loginDlgBench.User, loginDlgBench.Password);
/// Load user from the UsersAndGroupsDB database
loadedUser = Users.Entities.User.LoadUserByName(loginDlgBench.User,
LocalSettings.TestBenches[i].UsersDBSettings);
if (loadedUser != null)
{
authorized = loadedUser.Authorize(loginDlgBench.User, loginDlgBench.Password);
// if (authorized && settingsChanged) LocalSettings.Save();
// }
//}
if (authorized && settingsChanged) LocalSettings.Save();
}
}
///
/// One more attempt: authorisation with Config DB