public SettingsMng() { _main = this; _app_temp_settings.Add(APPLICATION_TITLE, "moleQule 2.0"); _app_temp_settings.Add(APPLICATION_NAME, "moleQule 2.0"); _app_temp_settings.Add(APPLICATION_VERSION, "0.0.0.0"); _app_temp_settings.Add(ACTIVE_HOST, "localhost"); _app_temp_settings.Add(BACKUPS_PATH, string.Empty); _app_temp_settings.Add(DB_VERSION, "4.6.0.0"); _app_temp_settings.Add(DB_NAME, Properties.Settings.Default.DB_NAME); _app_temp_settings.Add(DB_PASSWORD, Properties.Settings.Default.DB_PWD); _app_temp_settings.Add(DB_USER, Properties.Settings.Default.DB_USER); _app_temp_settings.Add(LAST_USER, "Admin"); _app_temp_settings.Add(MOLEQULE_DB_VERSION, "6.3.4.2"); _app_temp_settings.Add(APPLICATION_TYPE, ((int)EAppType.Desktop).ToString()); _app_temp_settings.Add(LAN_HOST, "localhost"); _app_temp_settings.Add(WAN_HOST, "localhost"); _app_temp_settings.Add(DATA_PATH, Resources.Paths.DATA_PATH); _app_temp_settings.Add(NH_CONFIG_FILES_PATH, Resources.Paths.NH_CONFIG_FILES); _app_temp_settings.Add(NH_SERVICES_CONFIG_FILES_PATH, Resources.Paths.NH_SERVICES_CONFIG_FILES); _app_temp_settings.Add(DLL_FILES_PATH, Resources.Paths.DLL_FILES_PATH); _app_temp_settings.Add(SERVICES_DLL_FILES_PATH, Resources.Paths.SERVICES_DLL_FILES_PATH); _app_temp_settings.Add(API_URL_MONITOR, Properties.Settings.Default.API_URL_MONITOR); _app_temp_settings.Add(API_ACTION_MONITOR, Properties.Settings.Default.API_ACTION_MONITOR); _app_temp_settings.Add(API_SERVICE_MONITOR, Properties.Settings.Default.API_SERVICE_MONITOR); _app_temp_settings.Add(CURRENT_APP_VERSION, "0.0.0.0"); }
/// <summary> /// Logout del sistema /// </summary> public virtual void Logout() { try { ClearUserContext(); //El mapeo del superuser no lo quitamos porque se usa para el login del resto de usuarios if (AppContext.User.Name != SettingsMng.GetSuperUser()) { ClearCredentials(AppContext.User.Name); } } catch { } AppContext.User.CopyFrom(User.UnauthenticatedIdentity()); }
/*public static nHManager InitnHManager(string mapFilesPath) { return InitnHManager(mapFilesPath, string.Empty); } * public static nHManager InitnHManager(string mapFilesPath, string server) { return InitnHManager(mapFilesPath, string.Empty, string.Empty, server); }*/ public static nHManager InitnHManager(string appAlias, string mapFilesPath, string user, string pwd, string server) { if (String.IsNullOrEmpty(mapFilesPath)) { mapFilesPath = Path.Combine(AppContext.StartUpPath, SettingsMng.Instance.GetNHConfigFileRelativePath(appAlias)); } MyLogger.LogText("Application Type is " + SettingsMng.Instance.GetApplicationType().ToString(), "PrincipalBase::InitnHManager"); MyLogger.LogText("Application config file is " + mapFilesPath ?? string.Empty, "PrincipalBase::InitnHManager"); if (String.IsNullOrEmpty(user)) { user = SettingsMng.GetSuperUser(); } if (String.IsNullOrEmpty(pwd)) { pwd = SettingsMng.Instance.GetDBPassword(); } Type[] mappings = new Type[0]; foreach (KeyValuePair <Type, IModuleDef> module in AppControllerBase.AppControler.Modules) { mappings = MergeMapping(mappings, module.Value.Mappings); } nHManager.Instance.Configure(mapFilesPath, mappings, pwd, User.MapToDBUsername(user), string.Empty, server); SettingsMng.Instance.SetActiveServer(nHManager.Instance.Host); SettingsMng.Instance.SetDBName(nHManager.Instance.Database); SettingsMng.Instance.SetDBUser(user); SettingsMng.Instance.SetDBPassword(pwd); return(nHManager.Instance); }
public static string BuildURL(string url) { return(BuildURL(SettingsMng.GetBaseDomain(), url)); }
/// <summary> /// Carga el fichero de configuracion /// </summary> /// <param name="mapFilesPath"></param> /// <returns></returns> public static nHManager InitnHManager(string appAlias = null) { string nhfile = Path.Combine(AppContext.StartUpPath, SettingsMng.Instance.GetNHConfigFileRelativePath(null)); return(InitnHManager(appAlias, nhfile, SettingsMng.GetSuperUser(), SettingsMng.Instance.GetDBPassword(), string.Empty)); }