private ActionResult UninstallPackage(string id, string returnUrl, string retryUrl) { try { _packageManager.Uninstall(id, MapAppRoot()); } catch (Exception exception) { Services.Notifier.Error(T("Uninstall failed: {0}", exception.Message)); return(Redirect(!String.IsNullOrEmpty(retryUrl) ? retryUrl : returnUrl)); } Services.Notifier.Information(T("Uninstalled package \"{0}\"", id)); return(this.RedirectLocal(returnUrl, "~/")); }
public ActionResult UninstallPackage(string id, string returnUrl, string retryUrl) { if (_shellSettings.Name != ShellSettings.DefaultName || !Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to uninstall packages"))) { return(new HttpUnauthorizedResult()); } try { _packageManager.Uninstall(id, HostingEnvironment.MapPath("~/")); } catch (Exception exception) { Services.Notifier.Error(T("Uninstall failed: {0}", exception.Message)); return(Redirect(retryUrl)); } Services.Notifier.Information(T("Uninstalled package \"{0}\"", id)); return(this.RedirectLocal(returnUrl, "~/")); }