Пример #1
0
 /// <remarks/>
 public void UpdateHeliconApeGroupAsync(int siteItemId, WebGroup group)
 {
     this.UpdateHeliconApeGroupAsync(siteItemId, group, null);
 }
        private void SaveGroup()
        {
            WebGroup group = new WebGroup();
            group.Name = usernameControl.Text;

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

            group.Users = users.ToArray();

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

            ReturnBack();
        }
Пример #3
0
 /// <remarks/>
 public void UpdateSecuredGroupAsync(int siteItemId, WebGroup group)
 {
     this.UpdateSecuredGroupAsync(siteItemId, group, null);
 }
Пример #4
0
 public int UpdateHeliconApeGroup(int siteItemId, WebGroup group)
 {
     object[] results = this.Invoke("UpdateHeliconApeGroup", new object[] {
                 siteItemId,
                 group});
     return ((int)(results[0]));
 }
Пример #5
0
 public int UpdateSecuredGroup(int siteItemId, WebGroup group)
 {
     return WebServerController.UpdateGroup(siteItemId, group);
 }
Пример #6
0
        public static int UpdateGroup(int siteItemId, WebGroup group)
        {
            // load site item
            WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
            if (siteItem == null)
                return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;

            // place log record
            TaskManager.StartTask("WEB_SITE", "UPDATE_SECURED_GROUP", siteItem.Name);
            TaskManager.ItemId = siteItemId;
            TaskManager.WriteParameter("Group", group.Name);

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

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
Пример #7
0
		private void UpdateGroup(string siteId, WebGroup group, bool deleteGroup)
		{
			string rootPath = GetSiteContentPath(siteId);

			if (group.Users == null)
				group.Users = new string[] { };

			List<string> updatedGroups = new List<string>();

			// open groups file
			string groupsPath = Path.Combine(rootPath, ProtectedGroupsFile);
			List<string> groupLines = ReadFile(groupsPath);

			bool exists = false;
			for (int i = 0; i < groupLines.Count; i++)
			{
				string groupLine = groupLines[i];
				int colonIdx = groupLine.IndexOf(":");
				if (colonIdx != -1)
				{
					string name = groupLine.Substring(0, colonIdx);

					// add group to the collection
					if (String.Compare(group.Name, name, true) == 0)
					{
						exists = true;

						if (deleteGroup)
							continue;

						// update group members
						groupLine = group.Name + ":" + String.Join(" ", group.Users);
					}
				}

				updatedGroups.Add(groupLine);
			} // end iterating groups

			if (!exists && !deleteGroup)
				updatedGroups.Add(group.Name + ":" + String.Join(" ", group.Users));

			// save groups
			WriteFile(groupsPath, updatedGroups);
		}
Пример #8
0
 /// <remarks/>
 public void UpdateGroupAsync(string siteId, WebGroup group) {
     this.UpdateGroupAsync(siteId, group, null);
 }
Пример #9
0
		public WebGroup GetGroup(string siteId, string groupName)
		{
			string rootPath = GetSiteContentPath(siteId);
			// open groups file
			string groupsPath = Path.Combine(rootPath, ProtectedGroupsFile);
			List<string> groupLines = ReadFile(groupsPath);

			WebGroup group = null;
			for (int i = 0; i < groupLines.Count; i++)
			{
				string groupLine = groupLines[i];
				int colonIdx = groupLine.IndexOf(":");
				if (colonIdx != -1)
				{
					string name = groupLine.Substring(0, colonIdx);
					string[] members = groupLine.Substring(colonIdx + 1).Split(' ');

					if (String.Compare(groupName, name, true) == 0)
					{
						group = new WebGroup();
						group.Name = groupName;
						group.Users = members;
					}
				}
			} // end iterating groups

			return group;
		}
Пример #10
0
		public void UpdateGroup(string siteId, WebGroup group)
		{
			UpdateGroup(siteId, group, false);
		}
Пример #11
0
 public override void UpdateHeliconApeGroup(string siteId, WebGroup group)
 {
     UpdateHeliconApeGroup(siteId, group, false);
 }
Пример #12
0
        public override WebGroup GetHeliconApeGroup(string siteId, string groupName)
        {
            string rootPath = GetSiteContentPath(siteId);
            // open groups file
            string groupsPath = Path.Combine(rootPath, HtaccessFolder.HTGROUPS_FILE);
            List<string> groupLines = HtaccessFolder.ReadLinesFile(groupsPath);

            WebGroup group = null;
            for (int i = 0; i < groupLines.Count; i++)
            {
                string groupLine = groupLines[i];
                int colonIdx = groupLine.IndexOf(":");
                if (colonIdx != -1)
                {
                    string name = groupLine.Substring(0, colonIdx);
                    string[] members = groupLine.Substring(colonIdx + 1).Split(' ');

                    if (String.Compare(groupName, name, true) == 0)
                    {
                        group = new WebGroup();
                        group.Name = groupName;
                        group.Users = members;
                    }
                }
            } // end iterating groups

            return group;
        }
Пример #13
0
 public int UpdateHeliconApeGroup(int siteItemId, WebGroup group)
 {
     return WebServerController.UpdateHeliconApeGroup(siteItemId, group);
 }
Пример #14
0
 public void UpdateGroup(string siteId, WebGroup group) {
     this.Invoke("UpdateGroup", new object[] {
                 siteId,
                 group});
 }
Пример #15
0
		public void DeleteGroup(string siteId, string groupName)
		{
			string rootPath = GetSiteContentPath(siteId);

			// delete group
			WebGroup group = new WebGroup();
			group.Name = groupName;
			UpdateGroup(siteId, group, true);

			// update foleds
			DeleteNonexistentUsersAndGroups(rootPath);
		}
Пример #16
0
 /// <remarks/>
 public System.IAsyncResult BeginUpdateGroup(string siteId, WebGroup group, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("UpdateGroup", new object[] {
                 siteId,
                 group}, callback, asyncState);
 }
Пример #17
0
 public void UpdateGroup(string siteId, WebGroup group)
 {
     try
     {
         Log.WriteStart("'{0}' UpdateGroup", ProviderSettings.ProviderName);
         WebProvider.UpdateGroup(siteId, group);
         Log.WriteEnd("'{0}' UpdateGroup", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' UpdateGroup", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
Пример #18
0
 /// <remarks/>
 public void UpdateGroupAsync(string siteId, WebGroup group, object userState) {
     if ((this.UpdateGroupOperationCompleted == null)) {
         this.UpdateGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateGroupOperationCompleted);
     }
     this.InvokeAsync("UpdateGroup", new object[] {
                 siteId,
                 group}, this.UpdateGroupOperationCompleted, userState);
 }
Пример #19
0
		public void UpdateHeliconApeGroup(string siteId, WebGroup group)
		{
			throw new NotImplementedException();
		}