Exemplo n.º 1
0
        private DiagnosisItem CheckDbConnection()
        {
            DiagnosisItem item = new DiagnosisItem()
            {
                Name = "Content db connectivity".Localize()
            };
            bool passed = true;

            try
            {
                passed = Kooboo.CMS.Content.Persistence.Providers.RepositoryProvider.TestDbConnection();
            }
            catch
            {
                passed = false;
            }


            if (passed)
            {
                item.Result = DiagnosisResultType.Passed;
            }
            else
            {
                item.Result  = DiagnosisResultType.Failed;
                item.Message = "The connection string of content repository was not correctly configured, please check online documentation to configure content providers".Localize();
            }
            return(item);
        }
Exemplo n.º 2
0
        private DiagnosisItem CheckDomain(Site site)
        {
            DiagnosisItem item = new DiagnosisItem()
            {
                Name = "Site domain setting".Localize()
            };

            if (site.Domains == null || site.Domains.Where(it => !string.IsNullOrWhiteSpace(it)).Count() == 0)
            {
                item.Result  = DiagnosisResultType.Warning;
                item.Message = @"No domain is assigned for this website, please configure it under System\Settings".Localize();
            }
            else
            {
                foreach (var domain in site.Domains)
                {
                    if (domain.Contains("http://", StringComparison.OrdinalIgnoreCase) || domain.Contains(":"))
                    {
                        item.Result  = DiagnosisResultType.Failed;
                        item.Message = "Domain values do not require protocol and port in URL.".Localize();
                        break;
                    }
                }
            }
            return(item);
        }
Exemplo n.º 3
0
        private DiagnosisItem CheckSmtp(Site site)
        {
            DiagnosisItem item = new DiagnosisItem()
            {
                Name = "SMTP connectivity".Localize()
            };

            if (site.Smtp == null || string.IsNullOrEmpty(site.Smtp.Host))
            {
                item.Result  = DiagnosisResultType.Warning;
                item.Message = @"The SMTP server was not correctly setup, please configure it under System\Settings\SMTP".Localize();
            }


            return(item);
        }
Exemplo n.º 4
0
        private DiagnosisItem CheckCms_Data()
        {
            DiagnosisItem item = new DiagnosisItem()
            {
                Name = "Cms_Data folder read/write permission".Localize()
            };

            try
            {
                string cms_dataFolder = Path.Combine(Kooboo.Settings.BaseDirectory, PathEx.BasePath);
                var    tempFileName   = Path.Combine(cms_dataFolder, "test.txt");
                File.WriteAllText(tempFileName, "Test if Kooboo cms has read/write permission on this folder.".Localize());
                File.Delete(tempFileName);
                item.Result = DiagnosisResultType.Passed;
            }
            catch
            {
                item.Result  = DiagnosisResultType.Failed;
                item.Message = "Please verify that the IIS ASP.NET user of Kooboo CMS application has read/write permission on this folder.".Localize();
            }

            return(item);
        }
Exemplo n.º 5
0
        private DiagnosisItem CheckCms_Data()
        {
            DiagnosisItem item = new DiagnosisItem()
            {
                Name = "Cms_Data folder read/write permission".Localize()
            };

            try
            {
                var    baseDir        = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve <IBaseDir>();
                string cms_dataFolder = baseDir.Cms_DataPhysicalPath;
                var    tempFileName   = Path.Combine(cms_dataFolder, "test.txt");
                File.WriteAllText(tempFileName, "Test if Kooboo cms has read/write permission on this folder.".Localize());
                File.Delete(tempFileName);
                item.Result = DiagnosisResultType.Passed;
            }
            catch
            {
                item.Result  = DiagnosisResultType.Failed;
                item.Message = "Please verify that the IIS ASP.NET user of Kooboo CMS application has read/write permission on this folder.".Localize();
            }

            return(item);
        }
Exemplo n.º 6
0
        private DiagnosisItem CheckCms_Data()
        {
            DiagnosisItem item = new DiagnosisItem() { Name = "Cms_Data folder read/write permission".Localize() };
            try
            {
                string cms_dataFolder = Path.Combine(Kooboo.Settings.BaseDirectory, PathEx.BasePath);
                var tempFileName = Path.Combine(cms_dataFolder, "test.txt");
                File.WriteAllText(tempFileName, "Test if Kooboo cms has read/write permission on this folder.".Localize());
                File.Delete(tempFileName);
                item.Result = DiagnosisResultType.Passed;
            }
            catch
            {
                item.Result = DiagnosisResultType.Failed;
                item.Message = "Please verify that the IIS ASP.NET user of Kooboo CMS application has read/write permission on this folder.".Localize();
            }

            return item;
        }
Exemplo n.º 7
0
        private DiagnosisItem CheckSmtp(Site site)
        {
            DiagnosisItem item = new DiagnosisItem() { Name = "SMTP connectivity".Localize() };
            if (site.Smtp == null || string.IsNullOrEmpty(site.Smtp.Host))
            {
                item.Result = DiagnosisResultType.Warning;
                item.Message = @"The SMTP server was not correctly setup, please configure it under System\Settings\SMTP".Localize();
            }

            return item;
        }
Exemplo n.º 8
0
 private DiagnosisItem CheckDomain(Site site)
 {
     DiagnosisItem item = new DiagnosisItem() { Name = "Site domain setting".Localize() };
     if (site.Domains == null || site.Domains.Where(it => !string.IsNullOrWhiteSpace(it)).Count() == 0)
     {
         item.Result = DiagnosisResultType.Warning;
         item.Message = @"No domain is assigned for this website, please configure it under System\Settings".Localize();
     }
     else
     {
         foreach (var domain in site.Domains)
         {
             if (domain.Contains("http://", StringComparison.OrdinalIgnoreCase) || domain.Contains(":"))
             {
                 item.Result = DiagnosisResultType.Failed;
                 item.Message = "Domain values do not require protocol and port in URL.".Localize();
                 break;
             }
         }
     }
     return item;
 }
Exemplo n.º 9
0
        private DiagnosisItem CheckDbConnection()
        {
            DiagnosisItem item = new DiagnosisItem() { Name = "Content db connectivity".Localize() };
            bool passed = true;
            try
            {
                passed = Kooboo.CMS.Content.Persistence.Providers.RepositoryProvider.TestDbConnection();
            }
            catch
            {
                passed = false;
            }

            if (passed)
            {
                item.Result = DiagnosisResultType.Passed;
            }
            else
            {
                item.Result = DiagnosisResultType.Failed;
                item.Message = "The connection string of content repository was not correctly configured, please check online documentation to configure content providers".Localize();
            }
            return item;
        }
Exemplo n.º 10
0
        private DiagnosisItem CheckCms_Data()
        {
            DiagnosisItem item = new DiagnosisItem() { Name = "Cms_Data folder read/write permission".Localize() };
            try
            {
                var baseDir = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve<IBaseDir>();
                string cms_dataFolder = baseDir.Cms_DataPhysicalPath;
                var tempFileName = Path.Combine(cms_dataFolder, "test.txt");
                File.WriteAllText(tempFileName, "Test if Kooboo cms has read/write permission on this folder.".Localize());
                File.Delete(tempFileName);
                item.Result = DiagnosisResultType.Passed;
            }
            catch
            {
                item.Result = DiagnosisResultType.Failed;
                item.Message = "Please verify that the IIS ASP.NET user of Kooboo CMS application has read/write permission on this folder.".Localize();
            }

            return item;
        }