示例#1
0
        public Services(IConfigSource config, string configName, WebApp webApp)
        {
            m_log.Debug("[Wifi]: Services Starting...");

            m_WebApp = webApp;

            m_ServerAdminPassword = webApp.RemoteAdminPassword;
            //m_log.DebugFormat("[Services]: RemoteAdminPassword is {0}", m_ServerAdminPassword);
            m_LastStatisticsUpdate = new DateTime();

            // Create the necessary services
            m_UserAccountService    = new UserAccountService(config);
            m_AuthenticationService = new PasswordAuthenticationService(config);
            m_InventoryService      = new InventoryService(config);
            m_GridService           = new GridService(config);
            m_GridUserService       = new GridUserService(config);
            m_AvatarService         = new AvatarService(config);

            // Create the "God" account if it doesn't exist
            CreateGod();

            // Connect to our outgoing mail server for password forgetfulness
            m_Client = new SmtpClient(m_WebApp.SmtpHost, m_WebApp.SmtpPort);
            if (m_WebApp.SmtpPort == 25)
            {
                m_Client.EnableSsl = false;
            }
            else
            {
                m_Client.EnableSsl = true;
            }
            m_Client.Credentials    = new NetworkCredential(m_WebApp.SmtpUsername, m_WebApp.SmtpPassword);
            m_Client.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback);
        }
        public Services(IConfigSource config, string configName, WebApp webApp)
        {
            m_log.Debug("[Wifi]: Services Starting...");

            m_WebApp = webApp;

            m_ServerAdminPassword = webApp.RemoteAdminPassword;
            //m_log.DebugFormat("[Services]: RemoteAdminPassword is {0}", m_ServerAdminPassword);
            m_LastStatisticsUpdate = new DateTime();

            // Create the necessary services
            m_UserAccountService    = new UserAccountService(config);
            m_AuthenticationService = new PasswordAuthenticationService(config);
            m_InventoryService      = new InventoryService(config);
            m_AssetService          = new AssetService(config);
            m_GridService           = new GridService(config);
            m_GridUserService       = new GridUserService(config);
            m_AvatarService         = new AvatarService(config);
            m_PresenceService       = new PresenceService(config);
            m_GroupsService         = new GroupsService(config);

            // Create the "God" account if it doesn't exist
            CreateGod();

            if (m_WebApp.BypassCertificateVerification)
            {
                ServicePointManager.ServerCertificateValidationCallback =
                    delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
                { return(true); }
            }
            ;

            // Connect to our outgoing mail server for password forgetfulness
            m_Client = new SmtpClient(m_WebApp.SmtpHost, m_WebApp.SmtpPort);
            if (m_WebApp.SmtpPort == 25)
            {
                m_Client.EnableSsl = false;
            }
            else
            {
                m_Client.EnableSsl = true;
            }
            m_Client.Credentials    = new NetworkCredential(m_WebApp.SmtpUsername, m_WebApp.SmtpPassword);
            m_Client.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback);
        }