Example #1
0
        private void BindFolder()
        {
            HtaccessFolder folder;

            string name    = Request.QueryString["Name"];
            string spaceId = Request.QueryString["SpaceID"];

            if ("httpd.conf" == name && !string.IsNullOrEmpty(spaceId))
            {
                // read httpd.conf
                folder = ES.Services.WebServers.GetHeliconApeHttpdFolder(int.Parse(spaceId));
                btnApeDebug.Visible = false;
            }
            else
            {
                // read web site
                WebSite site = ES.Services.WebServers.GetWebSite(PanelRequest.ItemID);
                if (site == null)
                {
                    RedirectToBrowsePage();
                    return;
                }

                folderPath.RootFolder = site.ContentPath;
                folderPath.PackageId  = site.PackageId;
                htaccessContent.Text  = "# Helicon Ape\n";

                if (String.IsNullOrEmpty(PanelRequest.Name))
                {
                    return;
                }

                // read folder
                folder = ES.Services.WebServers.GetHeliconApeFolder(PanelRequest.ItemID, PanelRequest.Name);
            }

            if (folder == null)
            {
                ReturnBack();
            }

            folderPath.SelectedFile = folder.Path;
            folderPath.Enabled      = false;
            contentPath.Value       = folder.ContentPath;
            htaccessContent.Text    = folder.HtaccessContent;
            if (string.IsNullOrEmpty(htaccessContent.Text))
            {
                htaccessContent.Text = "# Helicon Ape\n";
            }

            ApeDebuggerUrl.Value = "";

            if (RE_APE_DEBUGGER_ENABLED.IsMatch(htaccessContent.Text))
            {
                btnApeDebug.Text = "Stop Debug";
                GetApeDebuggerUrl();
            }
        }
Example #2
0
        private void SaveFolder()
        {
            HtaccessFolder folder = new HtaccessFolder();

            folder.Path            = folderPath.SelectedFile;
            folder.ContentPath     = contentPath.Value;
            folder.HtaccessContent = htaccessContent.Text;

            string spaceId = Request.QueryString["SpaceID"];


            if (RE_APE_DEBUGGER_ENABLED.IsMatch(htaccessContent.Text))
            {
                btnApeDebug.Text = "Stop Debug";
                GetApeDebuggerUrl();
            }
            else
            if (RE_APE_DEBUGGER_DISABLED.IsMatch(htaccessContent.Text))
            {
                btnApeDebug.Text = "Start Debug";
                GetApeDebuggerUrl();
            }


            try
            {
                if (folder.Path == HtaccessFolder.HTTPD_CONF_FILE && !string.IsNullOrEmpty(spaceId))
                {
                    int result = ES.Services.WebServers.UpdateHeliconApeHttpdFolder(int.Parse(spaceId), folder);
                    if (result < 0)
                    {
                        ShowResultMessage(result);
                        return;
                    }
                }
                else
                {
                    int result = ES.Services.WebServers.UpdateHeliconApeFolder(PanelRequest.ItemID, folder);
                    if (result < 0)
                    {
                        ShowResultMessage(result);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("WEB_UPDATE_HELICON_APE_FOLDER", ex);
                return;
            }
        }