Example #1
0
        public int CompareTo(object obj)
        {
            HtaccessFolder folder = obj as HtaccessFolder;

            if (folder != null)
            {
                return(String.CompareOrdinal(this.Path.ToLower(), folder.Path.ToLower()));
            }

            return(0);
        }
Example #2
0
        public static HtaccessFolder CreateHttpdConfFolder(string path)
        {
            HtaccessFolder folder = new HtaccessFolder
            {
                ContentPath = path,
                Path        = HTTPD_CONF_FILE
            };

            folder.ReadHttpdConf();

            return(folder);
        }
Example #3
0
        public static HtaccessFolder CreateHtaccessFolder(string siteRootPath, string folderPath)
        {
            HtaccessFolder folder = new HtaccessFolder
            {
                SiteRootPath = siteRootPath,
                Path         = folderPath,
                ContentPath  = System.IO.Path.Combine(siteRootPath, folderPath)
            };

            folder.ReadHtaccess();

            return(folder);
        }
Example #4
0
		public virtual void UpdateHeliconApeHttpdFolder(HtaccessFolder folder)
		{
			throw new NotImplementedException();
		}
		public static HtaccessFolder CreateHtaccessFolder(string siteRootPath, string folderPath)
		{
			HtaccessFolder folder = new HtaccessFolder
			{
				SiteRootPath = siteRootPath,
				Path = folderPath,
				ContentPath = System.IO.Path.Combine(siteRootPath, folderPath)
			};

			folder.ReadHtaccess();

			return folder;
		}
 /// <remarks/>
 public void UpdateHeliconApeHttpdFolderAsync(int serviceId, HtaccessFolder folder)
 {
     this.UpdateHeliconApeHttpdFolderAsync(serviceId, folder, null);
 }
 public int UpdateHeliconApeHttpdFolder(int serviceId, HtaccessFolder folder)
 {
     object[] results = this.Invoke("UpdateHeliconApeHttpdFolder", new object[] {
                 serviceId,
                 folder});
     return ((int)(results[0]));
 }
 public int UpdateHeliconApeFolder(int siteItemId, HtaccessFolder folder)
 {
     object[] results = this.Invoke("UpdateHeliconApeFolder", new object[] {
                 siteItemId,
                 folder});
     return ((int)(results[0]));
 }
Example #9
0
 public override void UpdateHeliconApeHttpdFolder(HtaccessFolder folder)
 {
     if (null != folder)
     {
         HtaccessFolder newFolder = GetHeliconApeHttpdFolder();
         newFolder.HtaccessContent = folder.HtaccessContent;
         newFolder.Update();
     }
 }
Example #10
0
 public override void UpdateHeliconApeFolder(string siteId, HtaccessFolder folder)
 {
     if (null != folder)
     {
         if (string.IsNullOrEmpty(folder.ContentPath))
         {
             HtaccessFolder newFolder = GetHeliconApeFolder(siteId, folder.Path);
             newFolder.HtaccessContent = folder.HtaccessContent;
             newFolder.Update();
         }
         else
         {
             if (string.IsNullOrEmpty(folder.SiteRootPath))
             {
                 folder.SiteRootPath = GetSiteContentPath(siteId);
             }
             folder.Update();
         }
     }
 }
 public int UpdateHeliconApeHttpdFolder(int serviceId, HtaccessFolder folder)
 {
     return WebServerController.UpdateHeliconApeHttpdFolder(serviceId, folder);
 }
 public int UpdateHeliconApeFolder(int siteItemId, HtaccessFolder folder)
 {
     return WebServerController.UpdateHeliconApeFolder(siteItemId, folder);
 }
        private void SaveFolder()
        {
            HtaccessFolder folder;
            WebSite site = ES.Services.WebServers.GetWebSite(PanelRequest.ItemID);
            if (null != site && !String.IsNullOrEmpty(PanelRequest.Name))
            {
                folder = ES.Services.WebServers.GetHeliconApeFolder(PanelRequest.ItemID, PanelRequest.Name);
            }
            else
            {
                folder = new HtaccessFolder();
            }

            folder.AuthName = txtTitle.Text.Trim();
            folder.AuthType = rblAuthType.SelectedItem.Value;
            
            // readonly
            // folder.Path = folderPath.SelectedFile;

            List<string> users = new List<string>();
            foreach (ListItem li in dlUsers.Items)
                if (li.Selected)
                    users.Add(li.Value);

            List<string> groups = new List<string>();
            foreach (ListItem li in dlGroups.Items)
                if (li.Selected)
                    groups.Add(li.Value);

            folder.Users = users;//.ToArray();
            folder.Groups = groups;//.ToArray();

            folder.DoAuthUpdate = true;

            try
            {
                int result = ES.Services.WebServers.UpdateHeliconApeFolder(PanelRequest.ItemID, folder);
                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("WEB_UPDATE_HeliconApe_FOLDER", ex);
                return;
            }

            ReturnBack();
        }
        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;
            }
        }
        public static int UpdateHeliconApeFolder(int siteItemId, HtaccessFolder folder)
        {
            // load site item
            WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
            if (siteItem == null)
                return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;

            folder.Path = FilesController.CorrectRelativePath(folder.Path);

            // place log record
            TaskManager.StartTask("WEB_SITE", "UPDATE_HELICON_APE_FOLDER", siteItem.Name, siteItemId);

            TaskManager.WriteParameter("Folder", folder.Path);

            try
            {
                // update folder
                WebServer web = GetWebServer(siteItem.ServiceId);
                web.UpdateHeliconApeFolder(siteItem.SiteId, folder);

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
Example #16
0
 public void UpdateHeliconApeHttpdFolder(HtaccessFolder folder)
 {
     try
     {
         Log.WriteStart("'{0}' UpdateHeliconApeHttpdFolder", ProviderSettings.ProviderName);
         WebProvider.UpdateHeliconApeHttpdFolder(folder);
         Log.WriteEnd("'{0}' UpdateHeliconApeHttpdFolder", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' UpdateHeliconApeHttpdFolder", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
        public static int UpdateHeliconApeHttpdFolder(int serviceId, HtaccessFolder folder)
        {
            folder.Path = FilesController.CorrectRelativePath(folder.Path);

            // place log record
            TaskManager.StartTask("WEB_SITE", "UPDATE_HELICON_APE_HTTPD_FOLDER");
            TaskManager.WriteParameter("Folder", folder.Path);

            try
            {
                // update folder
                WebServer web = GetWebServer(serviceId);
                web.UpdateHeliconApeHttpdFolder(folder);

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
 /// <remarks/>
 public void UpdateHeliconApeFolderAsync(int siteItemId, HtaccessFolder folder)
 {
     this.UpdateHeliconApeFolderAsync(siteItemId, folder, null);
 }
Example #19
0
 public void UpdateHeliconApeFolder(string siteId, HtaccessFolder folder) {
     this.Invoke("UpdateHeliconApeFolder", new object[] {
                 siteId,
                 folder});
 }
 /// <remarks/>
 public System.IAsyncResult BeginUpdateHeliconApeHttpdFolder(int serviceId, HtaccessFolder folder, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("UpdateHeliconApeHttpdFolder", new object[] {
                 serviceId,
                 folder}, callback, asyncState);
 }
Example #21
0
 public void UpdateHeliconApeHttpdFolder(HtaccessFolder folder) {
     this.Invoke("UpdateHeliconApeHttpdFolder", new object[] {
                 folder});
 }
 /// <remarks/>
 public void UpdateHeliconApeHttpdFolderAsync(int serviceId, HtaccessFolder folder, object userState)
 {
     if ((this.UpdateHeliconApeHttpdFolderOperationCompleted == null))
     {
         this.UpdateHeliconApeHttpdFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateHeliconApeHttpdFolderOperationCompleted);
     }
     this.InvokeAsync("UpdateHeliconApeHttpdFolder", new object[] {
                 serviceId,
                 folder}, this.UpdateHeliconApeHttpdFolderOperationCompleted, userState);
 }
Example #23
0
 /// <remarks/>
 public void UpdateHeliconApeHttpdFolderAsync(HtaccessFolder folder) {
     this.UpdateHeliconApeHttpdFolderAsync(folder, null);
 }
Example #24
0
		public static HtaccessFolder CreateHttpdConfFolder(string path)
		{
			HtaccessFolder folder = new HtaccessFolder
			{
				ContentPath = path,
				Path = HTTPD_CONF_FILE
			};

			folder.ReadHttpdConf();

			return folder;

		}
Example #25
0
		public virtual void UpdateHeliconApeFolder(string siteId, HtaccessFolder folder)
		{
			throw new NotImplementedException();
		}