private void BindSpace() { PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); if (package != null) { // bind plans BindHostingPlans(); // bind space txtName.Text = PortalAntiXSS.DecodeOld(package.PackageName); txtComments.Text = PortalAntiXSS.DecodeOld(package.PackageComments); PurchaseDate.SelectedDate = package.PurchaseDate; serverDetails.ServerId = package.ServerId; Utils.SelectListItem(ddlPlan, package.PlanId); // bind quotas packageQuotas.BindQuotas(PanelRequest.PackageID); // bind override flag rbPlanQuotas.Checked = !package.OverrideQuotas; rbPackageQuotas.Checked = package.OverrideQuotas; // toggle quotas editor ToggleQuotasEditor(); } }
private void BindServer() { ServerInfo server = ES.Services.Servers.GetServerById(PanelRequest.ServerId); if (server == null) { RedirectToBrowsePage(); } // header txtName.Text = PortalAntiXSS.DecodeOld(server.ServerName); txtComments.Text = PortalAntiXSS.DecodeOld(server.Comments); // connection txtUrl.Text = server.ServerUrl; // AD rbUsersCreationMode.SelectedIndex = server.ADEnabled ? 1 : 0; Utils.SelectListItem(ddlAdAuthType, server.ADAuthenticationType); txtDomainName.Text = server.ADRootDomain; txtAdUsername.Text = server.ADUsername; // instant alias txtInstantAlias.Text = server.InstantDomainAlias; }
private void BindPlan() { // hide "target server" section for non-admins bool isUserAdmin = PanelSecurity.SelectedUser.Role == UserRole.Administrator; rowTargetServer.Visible = isUserAdmin; rowTargetSpace.Visible = !isUserAdmin; if (isUserAdmin) { BindServers(); } else { BindSpaces(); } if (PanelRequest.PlanID == 0) { // new plan BindQuotas(); return; } HostingPlanInfo plan = ES.Services.Packages.GetHostingPlan(PanelRequest.PlanID); if (plan == null) { // plan not found RedirectBack(); } if (ShouldCopyCurrentHostingPlan()) { plan.PlanId = 0; plan.PlanName = "Copy of " + plan.PlanName; } // bind plan txtPlanName.Text = PortalAntiXSS.DecodeOld(plan.PlanName); txtPlanDescription.Text = PortalAntiXSS.DecodeOld(plan.PlanDescription); //chkAvailable.Checked = plan.Available; //txtSetupPrice.Text = plan.SetupPrice.ToString("0.00"); //txtRecurringPrice.Text = plan.RecurringPrice.ToString("0.00"); //txtRecurrenceLength.Text = plan.RecurrenceLength.ToString(); //Utils.SelectListItem(ddlRecurrenceUnit, plan.RecurrenceUnit); Utils.SelectListItem(ddlServer, plan.ServerId); Utils.SelectListItem(ddlSpace, plan.PackageId); // bind quotas BindQuotas(); }
private void BindAddons(int userId) { HostingPlanInfo[] hpi = ES.Services.Packages.GetUserAvailableHostingAddons(userId); // Next code is user for decoding incorectly stored plan names and descriptions with pre 1.2.2 installations for (int i = 0; i < hpi.Length; i++) { hpi[i].PlanDescription = PortalAntiXSS.DecodeOld(hpi[i].PlanDescription); hpi[i].PlanName = PortalAntiXSS.DecodeOld(hpi[i].PlanName); } ddlPlan.DataSource = hpi; ddlPlan.DataBind(); ddlPlan.Items.Insert(0, new ListItem(GetLocalizedString("SelectHostingPlan.Text"), "")); }
private void BindServer() { server = ES.Services.Servers.GetServerById(PanelRequest.ServerId); if (server == null) { RedirectToBrowsePage(); } // header txtName.Text = PortalAntiXSS.DecodeOld(server.ServerName); txtComments.Text = PortalAntiXSS.DecodeOld(server.Comments); Utils.SelectListItem(ddlPrimaryGroup, server.PrimaryGroupId); // instant alias txtInstantAlias.Text = server.InstantDomainAlias; }
private void BindUser() { UserInfo user = ES.Services.Users.GetUserById(PanelSecurity.LoggedUserId); if (user != null) { userPassword.SetUserPolicy(user.UserId, UserSettings.WEBSITEPANEL_POLICY, "PasswordPolicy"); // account info txtFirstName.Text = PortalAntiXSS.DecodeOld(user.FirstName); txtLastName.Text = PortalAntiXSS.DecodeOld(user.LastName); txtEmail.Text = user.Email; txtSecondaryEmail.Text = user.SecondaryEmail; lblUsername.Text = user.Username; ddlMailFormat.SelectedIndex = user.HtmlMail ? 1 : 0; // contact info contact.CompanyName = user.CompanyName; contact.Address = user.Address; contact.City = user.City; contact.Country = user.Country; contact.State = user.State; contact.Zip = user.Zip; contact.PrimaryPhone = user.PrimaryPhone; contact.SecondaryPhone = user.SecondaryPhone; contact.Fax = user.Fax; contact.MessengerId = user.InstantMessenger; // bind language /*DotNetNuke.Entities.Users.UserInfo dnnUser = * DnnUsers.GetUserByName(PortalSettings.PortalId, user.Username, false); * * if (dnnUser != null) * Utils.SelectListItem(ddlLanguage, dnnUser.Profile.PreferredLocale);*/ // bind items per page txtItemsPerPage.Text = UsersHelper.GetDisplayItemsPerPage().ToString(); } }
private void BindPlan() { if (PanelRequest.PlanID == 0) { // new plan BindQuotas(); return; } HostingPlanInfo plan = ES.Services.Packages.GetHostingPlan(PanelRequest.PlanID); if (plan == null) { // plan not found RedirectBack(); } if (ShouldCopyCurrentHostingAddon()) { plan.PlanId = 0; plan.PlanName = "Copy of " + plan.PlanName; } // bind plan txtPlanName.Text = PortalAntiXSS.DecodeOld(plan.PlanName); txtPlanDescription.Text = PortalAntiXSS.DecodeOld(plan.PlanDescription); //chkAvailable.Checked = plan.Available; //txtSetupPrice.Text = plan.SetupPrice.ToString("0.00"); //txtRecurringPrice.Text = plan.RecurringPrice.ToString("0.00"); //txtRecurrenceLength.Text = plan.RecurrenceLength.ToString(); //Utils.SelectListItem(ddlRecurrenceUnit, plan.RecurrenceUnit); // bind quotas BindQuotas(); }
private void BindUser() { ShowControls(PanelRequest.PeerID != 0); if (PanelRequest.PeerID == 0) { userPassword.SetUserPolicy(PanelSecurity.SelectedUserId, UserSettings.WEBSITEPANEL_POLICY, "PasswordPolicy"); userPassword.ValidationGroup = ""; if (PanelSecurity.SelectedUser.RoleId == (int)UserRole.Administrator) { role.Items.Add("CSR"); role.Items.Add("Helpdesk"); role.Items.Add("Administrator"); } else if (PanelSecurity.SelectedUser.RoleId == (int)UserRole.Reseller) { role.Items.Add("CSR"); role.Items.Add("Helpdesk"); role.Items.Add("Reseller"); } else { rowRole.Visible = false; } return; // it's a new user } if (PanelSecurity.LoggedUser.IsPeer && PanelSecurity.LoggedUserId == PanelRequest.PeerID) { btnDelete.Visible = false; // peer can't delete his own account } UserInfo user = UsersHelper.GetUser(PanelRequest.PeerID); if (user != null) { if ((PanelSecurity.SelectedUser.RoleId == (int)UserRole.Administrator) | (PanelSecurity.SelectedUser.RoleId == (int)UserRole.PlatformCSR) | (PanelSecurity.SelectedUser.RoleId == (int)UserRole.PlatformHelpdesk)) { role.Items.Add("CSR"); role.Items.Add("Helpdesk"); role.Items.Add("Administrator"); } else if ((PanelSecurity.SelectedUser.RoleId == (int)UserRole.Reseller) | (PanelSecurity.SelectedUser.RoleId == (int)UserRole.ResellerCSR) | (PanelSecurity.SelectedUser.RoleId == (int)UserRole.ResellerHelpdesk)) { role.Items.Add("CSR"); role.Items.Add("Helpdesk"); role.Items.Add("Reseller"); } else { rowRole.Visible = false; } userPassword.SetUserPolicy(PanelSecurity.SelectedUserId, UserSettings.WEBSITEPANEL_POLICY, "PasswordPolicy"); userPassword.ValidationGroup = "NewPassword"; // account info txtFirstName.Text = PortalAntiXSS.DecodeOld(user.FirstName); txtLastName.Text = PortalAntiXSS.DecodeOld(user.LastName); txtEmail.Text = user.Email; txtSecondaryEmail.Text = user.SecondaryEmail; ddlMailFormat.SelectedIndex = user.HtmlMail ? 1 : 0; txtUsername.Text = user.Username; lblUsername.Text = user.Username; chkDemo.Checked = user.IsDemo; if (user.RoleId == (int)UserRole.ResellerCSR) { role.SelectedIndex = 0; } if (user.RoleId == (int)UserRole.PlatformCSR) { role.SelectedIndex = 0; } if (user.RoleId == (int)UserRole.PlatformHelpdesk) { role.SelectedIndex = 1; } if (user.RoleId == (int)UserRole.ResellerHelpdesk) { role.SelectedIndex = 1; } if (user.RoleId == (int)UserRole.Reseller) { role.SelectedIndex = 2; } if (user.RoleId == (int)UserRole.Administrator) { role.SelectedIndex = 2; } // select loginStatus loginStatus.SelectedIndex = user.LoginStatusId; // contact info contact.CompanyName = user.CompanyName; contact.Address = user.Address; contact.City = user.City; contact.Country = user.Country; contact.State = user.State; contact.Zip = user.Zip; contact.PrimaryPhone = user.PrimaryPhone; contact.SecondaryPhone = user.SecondaryPhone; contact.Fax = user.Fax; contact.MessengerId = user.InstantMessenger; } else { // can't be found RedirectBack(); } }
private void BindUser() { try { UserInfo user = UsersHelper.GetUser(PanelSecurity.SelectedUserId); if (user != null) { // bind roles BindRoles(PanelSecurity.EffectiveUserId); bool editAdminAccount = (user.UserId == PanelSecurity.EffectiveUserId); if (!editAdminAccount) { role.Items.Remove("Administrator"); } // select role Utils.SelectListItem(role, user.Role.ToString()); // select loginStatus loginStatus.SelectedIndex = user.LoginStatusId; rowRole.Visible = !editAdminAccount; // select status chkDemo.Checked = user.IsDemo; rowDemo.Visible = !editAdminAccount; // account info txtFirstName.Text = PortalAntiXSS.DecodeOld(user.FirstName); txtLastName.Text = PortalAntiXSS.DecodeOld(user.LastName); txtSubscriberNumber.Text = PortalAntiXSS.DecodeOld(user.SubscriberNumber); txtEmail.Text = user.Email; txtSecondaryEmail.Text = user.SecondaryEmail; ddlMailFormat.SelectedIndex = user.HtmlMail ? 1 : 0; lblUsername.Text = user.Username; // contact info contact.CompanyName = user.CompanyName; contact.Address = user.Address; contact.City = user.City; contact.Country = user.Country; contact.State = user.State; contact.Zip = user.Zip; contact.PrimaryPhone = user.PrimaryPhone; contact.SecondaryPhone = user.SecondaryPhone; contact.Fax = user.Fax; contact.MessengerId = user.InstantMessenger; ViewState[UserStatusConst] = user.Status; } else { // can't be found RedirectAccountHomePage(); } } catch (Exception ex) { ShowErrorMessage("USER_GET_USER", ex); return; } }