public static bool tmConfig_SetCurrent(this TM_UserData userData, TMConfig tmConfig) { if (userData.isNull() || tmConfig.isNull()) return false; TMConfig.Current = tmConfig; return userData.event_TM_Config_Changed(); //return userData.tmConfig_Save(); }
public static string xmlDatabasePath(this TMConfig tmConfig) { if (tmConfig.TMSetup.UseAppDataFolder) { return(TMConfig.AppData_Folder.pathCombine(TMConsts.XML_DATABASE_VIRTUAL_PATH)); } return(tmConfig.librarDataRootFolder().pathCombine(TMConsts.XML_DATABASE_VIRTUAL_PATH_LEGACY).fullPath()); }
public static string virtualPathMapping(this TMConfig tmConfig) { if (tmConfig.TMSetup.TMLibraryDataVirtualPath.valid()) { return(tmConfig.TMSetup.TMLibraryDataVirtualPath); } return(TMConsts.VIRTUAL_PATH_MAPPING); }
public static bool newAccountsEnabled(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.TMSecurity.notNull()) { return(tmConfig.TMSecurity.NewAccounts_Enabled); } return(false); }
public static bool emailAdminOnNewUsers(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.TMSecurity.notNull()) { return(tmConfig.TMSecurity.EmailAdmin_On_NewUsers); } return(false); }
public static bool windowsAuthentication_Enabled(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.WindowsAuthentication.notNull()) { return(tmConfig.WindowsAuthentication.Enabled); } return(false); }
public static bool enable304Redirects(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.TMSetup.notNull()) { return(tmConfig.TMSetup.Enable304Redirects); } return(false); }
public static bool showDetailedErrorMessages(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.TMSetup.notNull()) { return(tmConfig.TMSetup.ShowDetailedErrorMessages); } return(false); }
public static bool show_LibraryToAnonymousUsers(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.TMSecurity.notNull()) { return(tmConfig.TMSecurity.Show_LibraryToAnonymousUsers); } return(false); }
public static bool enableGZipForWebServices(this TMConfig tmConfig) { if (tmConfig.notNull() && tmConfig.TMSetup.notNull()) { return(tmConfig.TMSetup.EnableGZipForWebServices); } return(false); }
public static bool tmConfig_SetCurrent(this TM_UserData userData, TMConfig tmConfig) { if (userData.isNull() || tmConfig.isNull()) { return(false); } TMConfig.Current = tmConfig; return(userData.event_TM_Config_Changed()); //return userData.tmConfig_Save(); }
public void testFixtureSetUp() { nUnitTests_Cassini = new NUnitTests_Cassini_TeamMentor().start(); tmProxy = nUnitTests_Cassini.tmProxy(); ieTeamMentor = nUnitTests_Cassini.new_IE_TeamMentor(true); ie = ieTeamMentor.ie; nUnitTests_Cassini.siteUri.GET().assert_Contains("TeamMentor"); // make a request to trigger Asp.NET pipeline and TM Startup tmProxy.map_ReferencesToTmObjects(); // these should be alive after startup tmConfig = tmProxy.TmConfig .assert_Not_Null(); // specially the TMConfig object }
public TM_XmlDatabase_FileStorage() { SendEmails.Disable_EmailEngine = true; UserGroup.Admin.assert(); tmFileStorage = new TM_FileStorage(); tmXmlDatabase = tmFileStorage.TMXmlDatabase; //new TM_Xml_Database().setup(); userData = tmFileStorage.UserData; tmServer = tmFileStorage.Server; tmConfig = TMConfig.Current; CheckDatabaseSetup(); UserGroup.None.assert(); }
public void SetupDatabase() { tmXmlDatabase = new TM_Xml_Database(); userData = tmXmlDatabase.UserData; tmConfig = TMConfig.Current = new TMConfig(); //new TM_TestLibrary().CreateTestDatabase(tmXmlDatabase); //all these values should be null since we are running TM memory (default setting) Assert.IsNull(tmXmlDatabase.Path_XmlDatabase , "Path_XmlDatabase"); Assert.IsNull(tmXmlDatabase.Path_XmlLibraries , "Path_XmlLibraries"); Assert.IsEmpty(tmXmlDatabase.Cached_GuidanceItems , "Cached_GuidanceItems"); Assert.IsEmpty(tmXmlDatabase.UserData.ActiveSessions , "ActiveSessions"); Assert.AreEqual(tmXmlDatabase.UserData.TMUsers.size() ,1 , "TMUsers"); // there should be admin }
public static string librarDataRootFolder(this TMConfig tmConfig) { //set xmlDatabasePath based on virtualPathMapping var virtualPathMapping = tmConfig.virtualPathMapping(); var xmlDatabasePath = TMConfig.WebRoot.pathCombine(virtualPathMapping).fullPath(); //check if we can write to xmlDatabasePath (and default to App_Data if we can't write to provided direct) if (xmlDatabasePath.canNotWriteToPath()) { xmlDatabasePath = TMConfig.AppData_Folder; } return(xmlDatabasePath); }
private static Login_Result AccountDisabledResponse(TMConfig tmConfig) { var response = new Login_Result { Login_Status = Login_Result.LoginStatus.Validation_Failed }; if (tmConfig.showDetailedErrorMessages()) { response.Validation_Results.Add(new Validation_Results { Field = "UserEnabled", Message = TMConfig.Current.TMErrorMessages.AccountDisabledErrorMessage }); } else { response.Simple_Error_Message = tmConfig.TMErrorMessages.General_Login_Error_Message; } return(response); }
private static Login_Result BadUsernameResponse(TMConfig tmConfig) { var response = new Login_Result { Login_Status = Login_Result.LoginStatus.Login_Fail }; if (tmConfig.showDetailedErrorMessages()) { response.Validation_Results.Add(new Validation_Results { Field = "Username", Message = TMConfig.Current.TMErrorMessages.UserNameDoNotExistErrorMessage }); } else { response.Simple_Error_Message = tmConfig.TMErrorMessages.General_Login_Error_Message; } return(response); }
private static Login_Result BadPasswordResponse(TMConfig tmConfig) { var response = new Login_Result { Login_Status = Login_Result.LoginStatus.Login_Fail }; if (tmConfig.showDetailedErrorMessages()) { response.Validation_Results.Add(new Validation_Results { Field = "Password", Message = TMConfig.Current.TMErrorMessages.Login_PasswordDoNotMatch }); } else { response.Simple_Error_Message = tmConfig.TMErrorMessages.General_Login_Error_Message; } return(response); }
public static TM_UserData handle_UserData_ConfigActions(this TM_UserData userData) { var userConfigFile = userData.Path_UserData.pathCombine("TMConfig.config"); if (userConfigFile.fileExists()) { var newConfig = userConfigFile.load <TMConfig>(); // to check that the new TMConfig is not corrupted if (newConfig.isNull()) { "[handleUserDataConfigActions] failed to load config file from: {0}".error(userConfigFile); } else { TMConfig.Location = userConfigFile; // update the value of TMConfig.config location TMConfig.loadConfig(); // reload the TMConfig from the updated location //TMConfig.Current = newConfig; userData.AutoGitCommit = newConfig.Git.AutoCommit_UserData; // in case this changed } } return(userData); }
public static bool setGitUserConfigFile(this TMConfig tmConfig, string gitUserConfig_Data) { try { var gitUserConfigFile = tmConfig.getGitUserConfigFile(); if (gitUserConfig_Data.notValid() && gitUserConfigFile.fileExists()) { "[setGitUserConfigFile] Deleting current gitUserconfigFile: {0}".info(gitUserConfigFile); gitUserConfigFile.file_Delete(); } else { gitUserConfig_Data.saveAs(gitUserConfigFile); } return(true); } catch (Exception ex) { ex.log("[setGitUserConfigFile]"); return(false); } }
public TM_Config_InMemory() { tmConfig = TMConfig.Current = new TMConfig(); }
[WebMethod(EnableSession = true)][Admin] public bool SetTMConfigFile(TMConfig tmConfig) { admin.demand(); return(userData.tmConfig_SetCurrent(tmConfig)); }
public bool SetTMConfigFile(TMConfig tmConfig) { admin.demand(); return userData.tmConfig_SetCurrent(tmConfig); }
[Admin] public bool Reload_TMConfig() { TMConfig.loadConfig(); // load default one TM_UserData.Current.handle_UserData_ConfigActions(); // load (if available) from current UserData location return(true); }
public TM_Customization() { tmConfig = TMConfig.Current; }
private static Signup_Result ValidateUserName(TMConfig config) { var signupResponse = new Signup_Result { Signup_Status = Signup_Result.SignupStatus.Validation_Failed, UserCreated = 0 }; if (config.showDetailedErrorMessages()) { signupResponse.Validation_Results.Add(new Validation_Results { Field = "Username", Message = TMConfig.Current.TMErrorMessages.SignUpUsernameAlreadyExist }); } else { signupResponse.Simple_Error_Message = config.TMErrorMessages.General_SignUp_Error_Message; } return signupResponse; }
[WebMethod(EnableSession = true)][Admin] public bool SetTMConfigFile(TMConfig tmConfig) { return(TMConfig.setCurrent(tmConfig)); }
private static Login_Result BadPasswordResponse(TMConfig tmConfig) { var response = new Login_Result {Login_Status = Login_Result.LoginStatus.Login_Fail}; if (tmConfig.showDetailedErrorMessages()) { response.Validation_Results.Add(new Validation_Results { Field = "Password", Message = TMConfig.Current.TMErrorMessages.Login_PasswordDoNotMatch }); } else response.Simple_Error_Message = tmConfig.TMErrorMessages.General_Login_Error_Message; return response; }
private static Signup_Result ValidationFailed(TMConfig config, NewUser newUser) { var sigupResponse = new Signup_Result(); var validationList = newUser.validate(); sigupResponse.Signup_Status = Signup_Result.SignupStatus.Validation_Failed; sigupResponse.UserCreated = 0; if (config.showDetailedErrorMessages()) { foreach (var validation in validationList) { var field = validation.MemberNames.FirstOrDefault(); sigupResponse.Validation_Results.Add(new Validation_Results { Field = field, Message = validation.ErrorMessage }); } } else sigupResponse.Simple_Error_Message = config.TMErrorMessages.General_SignUp_Error_Message; return sigupResponse; }
public static DateTime currentExpirationDate(this TMConfig tmConfig) { return((tmConfig.notNull() && tmConfig.TMSecurity.EvalAccounts_Enabled) ? DateTime.Now.AddDays(tmConfig.TMSecurity.EvalAccounts_Days) : default(DateTime)); }
public static string getGitUserConfigFile(this TMConfig tmConfig) { return(TMConfig.BaseFolder.pathCombine("gitUserData.config")); }
private static Login_Result AccountExpiredResponse(TMConfig tmConfig) { var response = new Login_Result {Login_Status = Login_Result.LoginStatus.Validation_Failed}; if (tmConfig.showDetailedErrorMessages()) { response.Validation_Results.Add(new Validation_Results { Field = "ExpirationDate", Message = TMConfig.Current.TMErrorMessages.AccountExpiredErrorMessage }); } else response.Simple_Error_Message = tmConfig.TMErrorMessages.General_Login_Error_Message; return response; }
public bool SetTMConfigFile(TMConfig tmConfig) { TMConfig.Current = tmConfig; return TMConfig.Current.SaveTMConfig(); }
private static Login_Result BadUsernameResponse(TMConfig tmConfig) { var response = new Login_Result {Login_Status = Login_Result.LoginStatus.Login_Fail}; if (tmConfig.showDetailedErrorMessages()) { response.Validation_Results.Add(new Validation_Results { Field = "Username", Message = TMConfig.Current.TMErrorMessages.UserNameDoNotExistErrorMessage }); } else { response.Simple_Error_Message = tmConfig.TMErrorMessages.General_Login_Error_Message; } return response; }
[WebMethod(EnableSession = true)][Admin] public bool SetTMConfigFile(TMConfig tmConfig) { TMConfig.Current = tmConfig; return(TMConfig.Current.SaveTMConfig()); }
public void SetupDatabase() { 1.set_DEFAULT_PBKDF2_INTERACTIONS(); // improve performance of tests that create users tmXmlDatabase = new TM_Xml_Database(); userData = tmXmlDatabase.UserData; tmConfig = TMConfig.Current = new TMConfig(); Assert.IsNull(tmXmlDatabase.Path_XmlDatabase , "Path_XmlDatabase"); // null since we are running TM memory (default setting) Assert.IsNull(tmXmlDatabase.Path_XmlLibraries , "Path_XmlLibraries"); // null since we are running TM memory (default setting) Assert.IsEmpty(tmXmlDatabase.Cached_GuidanceItems , "Cached_GuidanceItems"); Assert.IsEmpty(tmXmlDatabase.UserData.validSessions() , "ActiveSessions"); Assert.AreEqual(tmXmlDatabase.UserData.TMUsers.size(),1 , "TMUsers"); // there should be admin }
private static Signup_Result UserTags_Validation(TMConfig config, UserTag tag) { var signupResponse = new Signup_Result(); var validationList = tag.validate(); signupResponse.Signup_Status = Signup_Result.SignupStatus.Validation_Failed; signupResponse.UserCreated = 0; if (!config.showDetailedErrorMessages()) { signupResponse.Simple_Error_Message = config.TMErrorMessages.General_SignUp_Error_Message; } else { foreach (var validation in validationList) { signupResponse.Validation_Results.Add(new Validation_Results { Field = validation.ToString(), Message = validation.ErrorMessage }); } } return signupResponse; }