public TM_Rest_Direct() { //TMConfig.Current.TMSetup.UseAppDataFolder = true; // set the TM XMl Database folder to be moq_HttpContext = new API_Moq_HttpContext(); HttpContextFactory.Context = moq_HttpContext.httpContext(); TmRest = new TM_REST(); }
//[Admin] public TBot_Brain(TM_REST tmRest) { TmRest = tmRest; checkIfUserIsAdmin(); //StartTime = DateTime.Now; }
[Assert_Admin] // impersonate an admin to load the database public void Application_Start() { "[TM_StartUp] Application Start".info(); TmXmlDatabase = new TM_Xml_Database(true); // Create FileSystem Based database TrackingApplication = new Tracking_Application(TmXmlDatabase.Path_XmlDatabase); // Enabled Application Tracking TM_REST.SetRouteTable(); // Set REST routes TrackingApplication.saveLog(); }
[Assert_Admin] // impersonate an admin to load the database public void Application_Start() { //O2_Utils.showLogViewer_if_LocalHost(); TmXmlDatabase = new TM_Xml_Database(true); // Create FileSystem Based database TrackingApplication = new Tracking_Application(TmXmlDatabase.Path_XmlDatabase); // Enabled Application Tracking TM_REST.SetRouteTable(); // Set REST routes TrackingApplication.saveLog(); }
public TM_Rest_Direct() { UserGroup.Admin.setThreadPrincipalWithRoles(); tmXmlDatabase = new TM_Xml_Database(false); UserGroup.Anonymous.setThreadPrincipalWithRoles(); TMConfig.Current.TMSetup.UseAppDataFolder = true; // set the TM XMl Database folder to be moq_HttpContext = new API_Moq_HttpContext(); HttpContextFactory.Context = moq_HttpContext.httpContext(); TmRest = new TM_REST(); }
[Assert_Admin] // impersonate an admin to load the database public void Application_Start() { //O2_Utils.showLogViewer_if_LocalHost(); TmXmlDatabase = new TM_Xml_Database(true); // Create FileSystem Based database TrackingApplication = new Tracking_Application(TmXmlDatabase.Path_XmlDatabase); // Enabled Application Tracking TM_REST.SetRouteTable(); // Set REST routes MVC4.MapDefaultRoutes(); // Add support for ASP.NET MVC Controllers on the TM_Website TrackingApplication.saveLog(); }
public void SetUp() { var assembly = this.type().Assembly; var dllLocation = assembly.CodeBase.subString(8); var webApplications = dllLocation.parentFolder().pathCombine(@"\..\..\.."); TMRestUser = new TM_REST(); var tmWebsite = webApplications.pathCombine("TM_Website"); moq_HttpContext = new API_Moq_HttpContext(tmWebsite); var tmConfig = TMConfig.Current; var credentials = new TM_Credentials { UserName = tmConfig.TMSecurity.Default_AdminUserName, Password = tmConfig.TMSecurity.Default_AdminPassword }; //login with default value var sessionId = TmRest.Login_using_Credentials(credentials); }
public void Application_Start() { UserGroup.Admin.assert(); // impersonate an admin to load the database "[TM_StartUp] Application Start".info(); TmFileStorage = new TM_FileStorage(); // this will trigger the load of all TM_Xml_Database data TmFileStorage.UserData.createDefaultAdminUser(); // ensures that there is an valid admin TrackingApplication = new Tracking_Application(TmFileStorage.path_XmlDatabase()); // Enabled Application Tracking TM_REST.SetRouteTable(); // Set REST routes MVC5.MapDefaultRoutes(); // Map MVC 5 routes TrackingApplication.saveLog(); // save log UserGroup.None.assert(); // revert admin user impersonation }
public TM_Rest_Hosted() { TMConfig.Current.TMSetup.UseAppDataFolder = true; // set the TM XMl Database folder to be HttpContextFactory.Context = new API_Moq_HttpContext().httpContext(); TmRest = new TM_REST(); }