public UpgradeResult CallUpgradeService() { legacyAjaxCalls.Authorize(); org.umbraco.update.CheckForUpgrade check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); org.umbraco.update.UpgradeResult result = check.CheckUpgrade(GlobalSettings.VersionMajor, GlobalSettings.VersionMinor, GlobalSettings.VersionPatch, GlobalSettings.VersionComment); return(new UpgradeResult(result.UpgradeType.ToString(), result.Comment, result.UpgradeUrl)); }
public UpgradeResult CallUpgradeService() { legacyAjaxCalls.Authorize(); org.umbraco.update.CheckForUpgrade check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); org.umbraco.update.UpgradeResult result = check.CheckUpgrade(GlobalSettings.VersionMajor, GlobalSettings.VersionMinor, GlobalSettings.VersionPatch, GlobalSettings.VersionComment); return new UpgradeResult(result.UpgradeType.ToString(), result.Comment, result.UpgradeUrl); }
public UpgradeResult CallUpgradeService() { if (!AuthorizeRequest()) return null; var check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); org.umbraco.update.UpgradeResult result = check.CheckUpgrade(UmbracoVersion.Current.Major, UmbracoVersion.Current.Minor, UmbracoVersion.Current.Build, UmbracoVersion.CurrentComment); return new UpgradeResult(result.UpgradeType.ToString(), result.Comment, result.UpgradeUrl); }
public void InstallStatus(bool isCompleted, string userAgent, string errorMsg) { bool isUpgrade = false; // if it's an upgrade, you'll need to be logged in before we allow this call if (!String.IsNullOrEmpty(global::Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus)) { isUpgrade = true; try { legacyAjaxCalls.Authorize(); } catch (Exception) { //we don't want to throw the exception back to JS return; } } // Check for current install Id Guid installId = Guid.NewGuid(); BusinessLogic.StateHelper.Cookies.Cookie installCookie = new BusinessLogic.StateHelper.Cookies.Cookie("umb_installId", 1); if (!String.IsNullOrEmpty(installCookie.GetValue())) { if (Guid.TryParse(installCookie.GetValue(), out installId)) { // check that it's a valid Guid if (installId == Guid.Empty) installId = Guid.NewGuid(); } } installCookie.SetValue(installId.ToString()); string dbProvider = String.Empty; if (!String.IsNullOrEmpty(global::Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus)) dbProvider = ApplicationContext.Current.DatabaseContext.DatabaseProvider.ToString(); org.umbraco.update.CheckForUpgrade check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); check.Install(installId, isUpgrade, isCompleted, DateTime.Now, UmbracoVersion.Current.Major, UmbracoVersion.Current.Minor, UmbracoVersion.Current.Build, UmbracoVersion.CurrentComment, errorMsg, userAgent, dbProvider); }
public void InstallStatus(bool isCompleted, string userAgent, string errorMsg) { bool isUpgrade = false; // if it's an upgrade, you'll need to be logged in before we allow this call if (!String.IsNullOrEmpty(global::Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus)) { isUpgrade = true; legacyAjaxCalls.Authorize(); } // Check for current install Id Guid installId = Guid.NewGuid(); BusinessLogic.StateHelper.Cookies.Cookie installCookie = new BusinessLogic.StateHelper.Cookies.Cookie("umb_installId", 1); if (!String.IsNullOrEmpty(installCookie.GetValue())) { if (Guid.TryParse(installCookie.GetValue(), out installId)) { // check that it's a valid Guid if (installId == Guid.Empty) { installId = Guid.NewGuid(); } } } installCookie.SetValue(installId.ToString()); string dbProvider = String.Empty; if (!String.IsNullOrEmpty(global::Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus)) { dbProvider = ApplicationContext.Current.DatabaseContext.DatabaseProvider.ToString(); } org.umbraco.update.CheckForUpgrade check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); check.Install(installId, isUpgrade, isCompleted, DateTime.Now, UmbracoVersion.Current.Major, UmbracoVersion.Current.Minor, UmbracoVersion.Current.Build, UmbracoVersion.CurrentComment, errorMsg, userAgent, dbProvider); }
public UpgradeResult CallUpgradeService() { if (!AuthorizeRequest()) { return(null); } var check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); org.umbraco.update.UpgradeResult result = check.CheckUpgrade(UmbracoVersion.Current.Major, UmbracoVersion.Current.Minor, UmbracoVersion.Current.Build, UmbracoVersion.CurrentComment); return(new UpgradeResult(result.UpgradeType.ToString(), result.Comment, result.UpgradeUrl)); }
public UpgradeCheckResponse GetCheck() { var updChkCookie = Request.Headers.GetCookies("UMB_UPDCHK").FirstOrDefault(); var updateCheckCookie = updChkCookie != null ? updChkCookie["UMB_UPDCHK"].Value : ""; if (GlobalSettings.VersionCheckPeriod > 0 && string.IsNullOrEmpty(updateCheckCookie) && Security.CurrentUser.UserType.Alias == "admin") { try { var check = new global::umbraco.presentation.org.umbraco.update.CheckForUpgrade(); var result = check.CheckUpgrade(UmbracoVersion.Current.Major, UmbracoVersion.Current.Minor, UmbracoVersion.Current.Build, UmbracoVersion.CurrentComment); return new UpgradeCheckResponse(result.UpgradeType.ToString(), result.Comment, result.UpgradeUrl); } catch (System.Net.WebException) { //this occurs if the server is down or cannot be reached return null; } } return null; }