diff --git a/.hgignore b/.hgignore index 9f5c3496..3020542c 100644 --- a/.hgignore +++ b/.hgignore @@ -19,3 +19,4 @@ WebsitePanel/Build WebsitePanel.Installer/Build WebsitePanel/Bin msbuild.log +_ReSharper.* diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/WebUtils.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/WebUtils.cs index c3a92a05..d7566462 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/WebUtils.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/WebUtils.cs @@ -864,12 +864,13 @@ namespace WebsitePanel.Setup ServerManager serverManager = new ServerManager(); ApplicationPool pool = serverManager.ApplicationPools.Add(name); - if (!String.IsNullOrEmpty(username)) - { - pool.ProcessModel.IdentityType = ProcessModelIdentityType.SpecificUser; - pool.ProcessModel.UserName = username; - pool.ProcessModel.Password = password; - } + if (!String.IsNullOrEmpty(username)) + { + pool.ProcessModel.IdentityType = ProcessModelIdentityType.SpecificUser; + pool.ProcessModel.UserName = username; + pool.ProcessModel.Password = password; + pool.ProcessModel.LoadUserProfile = true; + } else { pool.ProcessModel.IdentityType = ProcessModelIdentityType.NetworkService; @@ -961,6 +962,7 @@ namespace WebsitePanel.Setup pool.ProcessModel.IdentityType = ProcessModelIdentityType.SpecificUser; pool.ProcessModel.UserName = username; pool.ProcessModel.Password = password; + pool.ProcessModel.LoadUserProfile = true; } else { diff --git a/WebsitePanel/Lib/Microsoft.Web.PlatformInstaller.dll b/WebsitePanel/Lib/Microsoft.Web.PlatformInstaller.dll deleted file mode 100644 index a94eef6f..00000000 Binary files a/WebsitePanel/Lib/Microsoft.Web.PlatformInstaller.dll and /dev/null differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.Deployment.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.Deployment.dll index 5a16662c..aa11e386 100644 Binary files a/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.Deployment.dll and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.Deployment.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.PlatformInstaller.WebDeployShim.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.PlatformInstaller.WebDeployShim.dll new file mode 100644 index 00000000..b7b81017 Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.PlatformInstaller.WebDeployShim.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.PlatformInstaller.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.PlatformInstaller.dll new file mode 100644 index 00000000..e7b0d807 Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Web.PlatformInstaller.dll differ diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebAppGallery/WebAppGalleryController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebAppGallery/WebAppGalleryController.cs index a2a0fd24..3ba7ed7c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebAppGallery/WebAppGalleryController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebAppGallery/WebAppGalleryController.cs @@ -78,12 +78,12 @@ namespace WebsitePanel.EnterpriseServer if (Utils.ParseBool(serviceSettings["FeedEnableMicrosoft"], true)) { - arFeeds.Add("https://www.microsoft.com/web/webpi/3.0/WebProductList.xml"); + arFeeds.Add(esServers.MAIN_WPI_FEED); } if (Utils.ParseBool(serviceSettings["FeedEnableHelicon"], true)) { - arFeeds.Add("http://www.helicontech.com/zoo/feed/wsp"); + arFeeds.Add(esServers.HELICON_WPI_FEED); } string additionalFeeds = serviceSettings["FeedUrls"]; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esServers.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esServers.asmx.cs index 05f403ee..51e76e44 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esServers.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esServers.asmx.cs @@ -54,6 +54,9 @@ namespace WebsitePanel.EnterpriseServer [ToolboxItem(false)] public class esServers : System.Web.Services.WebService { + public const string MAIN_WPI_FEED = "https://www.microsoft.com/web/webpi/4.0/WebProductList.xml"; + public const string HELICON_WPI_FEED = "http://www.helicontech.com/zoo/feed/wsp4"; + #region Servers [WebMethod] public List GetAllServers() @@ -677,12 +680,12 @@ namespace WebsitePanel.EnterpriseServer if (Utils.ParseBool(wpiSettings["FeedEnableMicrosoft"] ,true)) { - arFeeds.Add( "https://www.microsoft.com/web/webpi/3.0/WebProductList.xml" ); + arFeeds.Add( MAIN_WPI_FEED ); } if (Utils.ParseBool(wpiSettings["FeedEnableHelicon"] ,true)) { - arFeeds.Add( "http://www.helicontech.com/zoo/feed/wsp" ); + arFeeds.Add( HELICON_WPI_FEED ); } string additionalFeeds = wpiSettings["FeedUrls"]; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj index 370f612d..eee780ba 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj @@ -67,10 +67,7 @@ False ..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll - - - False - ..\..\Lib\Microsoft.Web.PlatformInstaller.dll + True diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs index 6e19a004..532220a4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs @@ -43,6 +43,7 @@ using WebsitePanel.Server.Utils; using System.Web; using System.Diagnostics; using Microsoft.Practices.EnterpriseLibrary.Caching.Expirations; +using DeploymentParameter = WebsitePanel.Providers.WebAppGallery.DeploymentParameter; namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery { @@ -56,13 +57,7 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery public WPIApplicationGallery(string sufix) { _sufix = sufix; - //_feeds = new[] - // { - // "https://www.microsoft.com/web/webpi/3.0/webproductlist.xml", - // "http://www.helicontech.com/zoo/feed/wsp" - // }; _cache = CacheFactory.GetCacheManager(); - //_wpi = GetWpiHelper(); } @@ -79,8 +74,6 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery public void InitFeeds(int UserId, string[] feeds) { - //Log.WriteInfo("InitFeeds {0} ", UserId); - string CACHE_KEY = GetKey_Feeds(UserId); if (_cache.Contains(CACHE_KEY)) @@ -194,9 +187,16 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery List products = wpi.GetApplications(categoryId); List applications = new List(); - foreach (Product product in products) + try { - applications.Add(MakeGalleryApplicationFromProduct(product)); + foreach (Product product in products) + { + applications.Add(MakeGalleryApplicationFromProduct(product)); + } + } + catch(Exception ex) + { + // } return applications; @@ -381,7 +381,7 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery Id = product.ProductId, Title = product.Title, Author = new Author {Name = product.Author, Uri = product.AuthorUri.ToString()}, - IconUrl = product.IconUrl.ToString(), + IconUrl = null == product.IconUrl ? "" : product.IconUrl.ToString(), Version = product.Version, Description = product.LongDescription, Summary = product.Summary, @@ -399,6 +399,7 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery r.FriendlyName = d.FriendlyName; r.DefaultValue = d.DefaultValue; r.Description = d.Description; +#pragma warning disable 612,618 r.WellKnownTags = (DeploymentParameterWellKnownTag) d.Tags; if (null != d.Validation) { @@ -409,6 +410,7 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery { r.ValidationKind = DeploymentParameterValidationKind.None; } +#pragma warning restore 612,618 return r; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebApplicationGallery.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebApplicationGallery.cs index ed925e7a..913e9a2a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebApplicationGallery.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebApplicationGallery.cs @@ -71,7 +71,8 @@ namespace WebsitePanel.Providers.Web public const string WAG_XML_FEED_CACHE_KEY = "WAG_XML_FEED_CACHE_KEY"; public const int WEB_APPLICATIONS_CACHE_STORE_MINUTES = 60; public const int XML_FEED_RECOVERY_ATTEMPTS = 10; - public const string WAG_DEFAULT_FEED_URL = "https://www.microsoft.com/web/webpi/3.0/WebApplicationList.xml"; + // public const string WAG_DEFAULT_FEED_URL = "https://www.microsoft.com/web/webpi/3.0/WebApplicationList.xml"; + public const string WAG_DEFAULT_FEED_URL = "https://www.microsoft.com/web/webpi/4.0/webapplicationlist.xml"; // well-known parameters matching public readonly Dictionary wellKnownParameters diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebsitePanel.Providers.Web.IIs60.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebsitePanel.Providers.Web.IIs60.csproj index 79f48e11..227f56dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebsitePanel.Providers.Web.IIs60.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WebsitePanel.Providers.Web.IIs60.csproj @@ -70,10 +70,17 @@ False ..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll + True - + False - ..\..\Lib\Microsoft.Web.PlatformInstaller.dll + ..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll + True + + + False + ..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.WebDeployShim.dll + True diff --git a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs index 22e7ca82..00c514a9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Text; using System.Threading; using Microsoft.Web.PlatformInstaller; @@ -188,9 +189,11 @@ namespace WebsitePanel.Server.WPIService { _installationStatus = EWPIServiceStatus.InstallationComplete; } + + CheckIISAlive(); } - + private void InstallStatusUpdatedHandler(object sender, InstallStatusEventArgs e) { StringBuilder sb = new StringBuilder(); @@ -242,6 +245,27 @@ namespace WebsitePanel.Server.WPIService _statusMessage = sb.ToString(); } } + + private void CheckIISAlive() + { + // run iisreset /start + ProcessStartInfo processStartInfo = new ProcessStartInfo(@"C:\Windows\System32\iisreset.exe", "/start"); + processStartInfo.UseShellExecute = false; + + try + { + using (Process exeProcess = Process.Start(processStartInfo)) + { + exeProcess.WaitForExit(); + Debug.Write("WPIService: iisreset /start returns "+exeProcess.ExitCode); + } + } + catch (Exception ex) + { + Debug.Write("WPIService: iisreset /start exception: "+ex.ToString()); + } + } + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WebsitePanel.Server.WPIService.csproj b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WebsitePanel.Server.WPIService.csproj index dd23de4b..7ef83aa9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WebsitePanel.Server.WPIService.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WebsitePanel.Server.WPIService.csproj @@ -10,7 +10,7 @@ Properties WebsitePanel.Server.WPIService WebsitePanel.Server.WPIService - v3.5 + v4.0 512 @@ -36,10 +36,17 @@ False ..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll + True - + False - ..\..\Lib\Microsoft.Web.PlatformInstaller.dll + ..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll + True + + + False + ..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.WebDeployShim.dll + True @@ -61,6 +68,9 @@ WebsitePanel.Server.WPIServiceContract + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/app.config b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/app.config new file mode 100644 index 00000000..adba4c13 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs index e37445b8..c067889a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs @@ -60,7 +60,8 @@ namespace WebsitePanel.Server.Code private readonly List _feeds; private string _webPIinstallersFolder; - private const string MainWpiFeed = "https://www.microsoft.com/web/webpi/3.0/webproductlist.xml"; + //private const string MainWpiFeed = "https://www.microsoft.com/web/webpi/3.0/webproductlist.xml"; + private const string MainWpiFeed = "https://www.microsoft.com/web/webpi/4.0/WebProductList.xml"; private const string IisChoiceProduct = "StaticContent"; private const string WebMatrixChoiceProduct = "WebMatrix"; private ProductManager _productManager; @@ -682,9 +683,11 @@ namespace WebsitePanel.Server.Code private static bool IsAlienDbTaggedParameter(DeploymentWellKnownTag dbTag, DeclaredParameter parameter) { +#pragma warning disable 612,618 return (parameter.Tags & databaseEngineTags) != DeploymentWellKnownTag.None && (parameter.Tags & dbTag) == DeploymentWellKnownTag.None; +#pragma warning restore 612,618 } private static void RemoveUnusedProviders(MSDeployPackage msDeployPackage, DeploymentWellKnownTag dbTag) diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 0953eeaa..08c84bd4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -45,10 +45,17 @@ False ..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll + True - + False - ..\..\Lib\Microsoft.Web.PlatformInstaller.dll + ..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll + True + + + False + ..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.WebDeployShim.dll + True False diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs index 7c990684..5686914c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs @@ -31,6 +31,7 @@ using System.IO; using System.Data; using System.Security; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using System.Web; using System.Diagnostics; @@ -39,7 +40,6 @@ using System.Collections.Generic; using System.Web.Services; using System.Web.Services.Protocols; using System.ComponentModel; -using System.Text.RegularExpressions; using System.ServiceProcess; using System.ServiceModel; using System.Runtime.Remoting; @@ -56,6 +56,11 @@ using WebsitePanel.Providers; using WebsitePanel.Server.WPIService; + + + + + namespace WebsitePanel.Server { /// @@ -615,31 +620,35 @@ namespace WebsitePanel.Server } } + private void StartWpiService() { string binFolder = HttpContext.Current.Server.MapPath("/bin/"); + string workingDirectory = Path.Combine(Environment.ExpandEnvironmentVariables("%SystemRoot%"), "Temp\\zoo.wpi"); - string newUserProfile = Path.Combine(Environment.ExpandEnvironmentVariables("%SystemRoot%"), "Temp\\zoo.wpi"); - string newAppData = Path.Combine(newUserProfile, "Roaming"); - string newLocalAppData = Path.Combine(newUserProfile, "Local"); - try - { - Directory.CreateDirectory(newUserProfile); - Directory.CreateDirectory(newAppData); - Directory.CreateDirectory(newLocalAppData); - } - catch (Exception) - { - //throw; - } + //string newUserProfile = Path.Combine(Environment.ExpandEnvironmentVariables("%SystemRoot%"), "Temp\\zoo.wpi"); + //string newAppData = Path.Combine(newUserProfile, "Roaming"); + //string newLocalAppData = Path.Combine(newUserProfile, "Local"); + //try + //{ + // Directory.CreateDirectory(newUserProfile); + // Directory.CreateDirectory(newAppData); + // Directory.CreateDirectory(newLocalAppData); + //} + //catch (Exception) + //{ + // //throw; + //} Process wpiServiceExe = new Process(); wpiServiceExe.StartInfo = new ProcessStartInfo(Path.Combine(binFolder, "WebsitePanel.Server.WPIService.exe")); + wpiServiceExe.StartInfo.WorkingDirectory = workingDirectory; wpiServiceExe.StartInfo.UseShellExecute = false; - wpiServiceExe.StartInfo.EnvironmentVariables["UserProfile"] = newUserProfile; - wpiServiceExe.StartInfo.EnvironmentVariables["LocalAppData"] = newLocalAppData; - wpiServiceExe.StartInfo.EnvironmentVariables["AppData"] = newAppData; + wpiServiceExe.StartInfo.LoadUserProfile = true; + //wpiServiceExe.StartInfo.EnvironmentVariables["UserProfile"] = newUserProfile; + //wpiServiceExe.StartInfo.EnvironmentVariables["LocalAppData"] = newLocalAppData; + //wpiServiceExe.StartInfo.EnvironmentVariables["AppData"] = newAppData; if (wpiServiceExe.Start()) { _WpiServiceExe = wpiServiceExe; @@ -740,12 +749,13 @@ namespace WebsitePanel.Server Log.WriteError("WpiGetLogFileDirectory", ex); - throw; + //throw; + return string.Empty; } } [WebMethod] - public SettingPair[] WpiGetLogsInDirectory(string Path) + public SettingPair[] WpiGetLogsInDirectory(string path) { try { @@ -753,7 +763,7 @@ namespace WebsitePanel.Server ArrayList result = new ArrayList(); - string[] filePaths = Directory.GetFiles(Path); + string[] filePaths = Directory.GetFiles(path); foreach (string filePath in filePaths) { using (StreamReader streamReader = new StreamReader(filePath)) @@ -773,7 +783,8 @@ namespace WebsitePanel.Server Log.WriteError("WpiGetLogFileDirectory", ex); - throw; + //throw; + return null; } } @@ -981,4 +992,6 @@ namespace WebsitePanel.Server } #endregion } + + } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx index 843fd123..3ecef0a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx @@ -187,7 +187,7 @@ Applications Installer - Microsoft Web Application Gallery + Web Application Gallery Audit Log diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Pages.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Pages.ascx.resx index 1d3d1e32..d4b134f6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Pages.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Pages.ascx.resx @@ -445,7 +445,7 @@ {user} - {space} - Web Site IP Addresses - {user} - {space} - Microsoft Web Application Gallery + {user} - {space} - Web Application Gallery Web diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs index 1b2c1156..f51dfa41 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs @@ -327,7 +327,10 @@ namespace WebsitePanel.Portal if (string.IsNullOrEmpty(wpiLogsDir)) { wpiLogsDir = ES.Services.Servers.WpiGetLogFileDirectory(PanelRequest.ServerId); - ViewState[_wpiLogsDirViewStateKey] = wpiLogsDir; + if (!string.IsNullOrEmpty(wpiLogsDir)) + { + ViewState[_wpiLogsDirViewStateKey] = wpiLogsDir; + } } } catch @@ -532,37 +535,51 @@ namespace WebsitePanel.Portal protected void ShowLogsButton_OnClick(object sender, EventArgs e) { //show logs + + string wpiLogsDir = null; + object[] logsEntrys = null; try { - string wpiLogsDir = ViewState[_wpiLogsDirViewStateKey] as string; + wpiLogsDir = ViewState[_wpiLogsDirViewStateKey] as string; if (!string.IsNullOrEmpty(wpiLogsDir)) { //Get logs !!! - object[] logsEntrys = ES.Services.Servers.WpiGetLogsInDirectory(PanelRequest.ServerId, wpiLogsDir); + logsEntrys = ES.Services.Servers.WpiGetLogsInDirectory(PanelRequest.ServerId, wpiLogsDir); - WpiLogsPanel.Visible = true; - - StringBuilder sb = new StringBuilder(); - - foreach (SettingPair entry in logsEntrys) + if (null == logsEntrys) { - string fileName = (string)entry.Name; - string fileContent = (string)entry.Value; - sb.AppendLine().AppendFormat("

{0}

", fileName).AppendLine().Append(fileContent).AppendLine(); + WpiLogsPanel.Visible = true; + string msg = string.Format("Could not get logs files. Log files folder:\n{0}", wpiLogsDir); + WpiLogsPre.InnerText = msg; } + else + { + WpiLogsPanel.Visible = true; - WpiLogsPre.InnerHtml = sb.ToString(); + StringBuilder sb = new StringBuilder(); - ShowLogsButton.Visible = false; - ProgressTimer.Enabled = false; + foreach (SettingPair entry in logsEntrys) + { + string fileName = (string) entry.Name; + string fileContent = (string) entry.Value; + sb.AppendLine().AppendFormat("

{0}

", fileName).AppendLine().Append(fileContent). + AppendLine(); + } + + WpiLogsPre.InnerHtml = sb.ToString(); + + ShowLogsButton.Visible = false; + ProgressTimer.Enabled = false; + } } } catch (Exception ex) { WpiLogsPanel.Visible = true; - WpiLogsPre.InnerText = ex.ToString(); + string msg = string.Format("wpiLogsDir: {0}\nlogsEntrys is null: {1}\n{2}", wpiLogsDir, logsEntrys == null, ex); + WpiLogsPre.InnerText = msg; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx index 5de7bc20..473f1380 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx @@ -123,7 +123,7 @@ ul.WPIKeywordList>li { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx.cs index 08978785..f3d4715a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGallery.ascx.cs @@ -178,5 +178,15 @@ namespace WebsitePanel.Portal } ES.Services.WebApplicationGallery.SetResourceLanguage(PanelSecurity.PackageId, lang); } + + protected string GetIconUrlOrDefault(string url) + { + if (string.IsNullOrEmpty(url)) + { + return "/App_Themes/Default/icons/sphere_128.png"; + } + + return "~/DesktopModules/WebsitePanel/ResizeImage.ashx?width=120&height=120&url=" + Server.UrlEncode(url); + } } } \ No newline at end of file