예제 #1
0
        private void BindHostingPlan()
        {
            // plan resources
            int planId = Utils.ParseInt(ddlPlans.SelectedValue, 0);

            chkCreateResources.Visible = (planId > 0);
            bool createResources = chkCreateResources.Checked;

            ResourcesPanel.Visible = createResources & chkCreateResources.Visible;
            if (!createResources)
            {
                return;
            }


            bool systemEnabled = false;
            bool webEnabled    = false;
            bool ftpEnabled    = false;
            bool mailEnabled   = false;

            // load hosting context
            if (planId > 0)
            {
                HostingPlanContext cntx = PackagesHelper.GetCachedHostingPlanContext(planId);
                if (cntx != null)
                {
                    systemEnabled = cntx.Groups.ContainsKey(ResourceGroups.Os);
                    webEnabled    = cntx.Groups.ContainsKey(ResourceGroups.Web);
                    ftpEnabled    = cntx.Groups.ContainsKey(ResourceGroups.Ftp);
                    mailEnabled   = cntx.Groups.ContainsKey(ResourceGroups.Mail);
                }
            }

            // toggle group controls
            fsSystem.Visible = systemEnabled;

            fsWeb.Visible             = webEnabled;
            chkCreateWebSite.Checked &= webEnabled;

            fsFtp.Visible = ftpEnabled;
            chkCreateFtpAccount.Checked &= ftpEnabled;

            fsMail.Visible = mailEnabled;
            chkCreateMailAccount.Checked &= mailEnabled;

            ftpAccountName.Visible = (rbFtpAccountName.SelectedIndex == 1);
        }
예제 #2
0
        private void BindHostingPlan()
        {
            // plan resources
            int planId = Utils.ParseInt(ddlPlans.SelectedValue, 0);

            chkCreateResources.Visible = (planId > 0);
            bool createResources = chkCreateResources.Checked;

            ResourcesPanel.Visible = createResources & chkCreateResources.Visible;
            if (!createResources)
            {
                return;
            }

            if ((PanelSecurity.LoggedUser.Role == UserRole.ResellerCSR) |
                (PanelSecurity.LoggedUser.Role == UserRole.ResellerHelpdesk))
            {
                this.chkCreateResources.Enabled = this.chkIntegratedOUProvisioning.Enabled = false;
            }


            bool systemEnabled       = false;
            bool webEnabled          = false;
            bool ftpEnabled          = false;
            bool mailEnabled         = false;
            bool integratedOUEnabled = false;

            // load hosting context
            if (planId > 0)
            {
                HostingPlanContext cntx = PackagesHelper.GetCachedHostingPlanContext(planId);
                if (cntx != null)
                {
                    systemEnabled = cntx.Groups.ContainsKey(ResourceGroups.Os);
                    webEnabled    = cntx.Groups.ContainsKey(ResourceGroups.Web);

                    if (Utils.CheckQouta(Quotas.WEB_ENABLEHOSTNAMESUPPORT, cntx))
                    {
                        lblHostName.Visible = txtHostName.Visible = true;
                        UserSettings settings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.WEB_POLICY);
                        txtHostName.Text = String.IsNullOrEmpty(settings["HostName"]) ? "" : settings["HostName"];
                    }
                    else
                    {
                        lblHostName.Visible = txtHostName.Visible = false;
                        txtHostName.Text    = "";
                    }

                    ftpEnabled  = cntx.Groups.ContainsKey(ResourceGroups.Ftp);
                    mailEnabled = cntx.Groups.ContainsKey(ResourceGroups.Mail);

                    if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx))
                    {
                        integratedOUEnabled = true;
                    }
                }
            }

            // toggle group controls
            fsSystem.Visible = systemEnabled;

            fsWeb.Visible             = webEnabled;
            chkCreateWebSite.Checked &= webEnabled;


            fsFtp.Visible = ftpEnabled;
            chkCreateFtpAccount.Checked &= ftpEnabled;

            fsMail.Visible = mailEnabled;
            chkCreateMailAccount.Checked &= mailEnabled;

            ftpAccountName.Visible = (rbFtpAccountName.SelectedIndex == 1);

            chkIntegratedOUProvisioning.Checked = chkIntegratedOUProvisioning.Visible = (chkCreateResources.Visible && integratedOUEnabled);
        }