diff --git a/ONLYOFFICE/Layouts/Onlyoffice/CallbackHandler.ashx.cs b/ONLYOFFICE/Layouts/Onlyoffice/CallbackHandler.ashx.cs index 7c0bd70..bca8daa 100644 --- a/ONLYOFFICE/Layouts/Onlyoffice/CallbackHandler.ashx.cs +++ b/ONLYOFFICE/Layouts/Onlyoffice/CallbackHandler.ashx.cs @@ -50,8 +50,8 @@ public void ProcessRequest(HttpContext context) SPListItemId = "", SPListURLDir = "", Folder = "", - url = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority; - + url = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority + + HttpContext.Current.Request.RawUrl.Substring(0, HttpContext.Current.Request.RawUrl.IndexOf("_layouts")); //get secret key SPSecurity.RunWithElevatedPrivileges(delegate() { diff --git a/ONLYOFFICE/Layouts/Onlyoffice/Settings.aspx.cs b/ONLYOFFICE/Layouts/Onlyoffice/Settings.aspx.cs index 4537cdb..35328cf 100644 --- a/ONLYOFFICE/Layouts/Onlyoffice/Settings.aspx.cs +++ b/ONLYOFFICE/Layouts/Onlyoffice/Settings.aspx.cs @@ -36,8 +36,8 @@ namespace Onlyoffice.Layouts public partial class Settings : LayoutsPageBase { protected string path = AppDomain.CurrentDomain.BaseDirectory; - protected string url = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority; - + protected string url = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority + + HttpContext.Current.Request.RawUrl.Substring(0, HttpContext.Current.Request.RawUrl.IndexOf("_layouts")); protected void Page_Load(object sender, EventArgs e) { DocumentServerTitle.Text = Microsoft.SharePoint.Utilities.SPUtility.GetLocalizedString("$Resources:Resource,DocumentServer", "core", (uint)SPContext.Current.Web.UICulture.LCID); diff --git a/ONLYOFFICE/Layouts/Onlyoffice/editorPage.aspx.cs b/ONLYOFFICE/Layouts/Onlyoffice/editorPage.aspx.cs index 7bb7dc7..f64d3ef 100644 --- a/ONLYOFFICE/Layouts/Onlyoffice/editorPage.aspx.cs +++ b/ONLYOFFICE/Layouts/Onlyoffice/editorPage.aspx.cs @@ -61,9 +61,9 @@ public partial class editorPage : LayoutsPageBase CurrentUserLogin = "", SPListItemId, SPListURLDir, SPSource, SPListId, Folder, Secret, DocumentSeverHost = "@http://localhost", - host = HttpContext.Current.Request.Url.Host, - SPUrl = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority, - + host = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority, + SPUrl = HttpUtility.HtmlEncode(HttpContext.Current.Request.Url.Scheme) + "://" + HttpContext.Current.Request.Url.Authority + + HttpContext.Current.Request.RawUrl.Substring(0, HttpContext.Current.Request.RawUrl.IndexOf("_layouts")), SPVersion = SPFarm.Local.BuildVersion.Major == 14 ? "": "15/"; protected int CurrentUserId = 0; @@ -167,7 +167,7 @@ protected void Page_Load(object sender, EventArgs e) Folder = Path.GetDirectoryName(file.ServerRelativeUrl); Folder = Folder.Replace("\\", "/"); - GoToBack = SPUrl + Folder; + GoToBack = host + Folder; FileAuthor = file.Author.Name; diff --git a/ONLYOFFICE/MenuAction/Elements.xml b/ONLYOFFICE/MenuAction/Elements.xml index 5135642..03636c3 100644 --- a/ONLYOFFICE/MenuAction/Elements.xml +++ b/ONLYOFFICE/MenuAction/Elements.xml @@ -12,7 +12,14 @@ Start the URL with the token ~remoteAppUrl if the page is in the associated web project, use ~appWebUrl if page is in the app project. --> - + \ No newline at end of file diff --git a/ONLYOFFICE/RibbonAction/Elements.xml b/ONLYOFFICE/RibbonAction/Elements.xml index 8ba4d60..47be808 100644 --- a/ONLYOFFICE/RibbonAction/Elements.xml +++ b/ONLYOFFICE/RibbonAction/Elements.xml @@ -27,7 +27,17 @@ - + \ No newline at end of file