private bool CheckForCorrectIdnDomainUsage(string domainName)
        {
            // If the choosen domain is a idn domain, don't allow to create mail
            if (Utils.IsIdnDomain(domainName) && PointMailDomain.Checked)
            {
                ShowErrorMessage("IDNDOMAIN_NO_MAIL");
                return(false);
            }

            return(true);
        }
Exemple #2
0
        private bool CheckForCorrectIdnDomainUsage()
        {
            if (Utils.IsIdnDomain(txtDomainName.Text))
            {
                if (chkIntegratedOUProvisioning.Checked)
                {
                    ShowErrorMessage("IDNDOMAIN_NO_ORGANIZATION");
                    return(false);
                }

                if (chkCreateMailAccount.Checked)
                {
                    ShowErrorMessage("IDNDOMAIN_NO_MAIL");
                    return(false);
                }
            }

            return(true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // save return URL
                ViewState["ReturnUrl"] = Request.UrlReferrer.ToString();

                // toggle panels
                ShowPanels(false);

                // domain name
                DomainInfo domain = ES.Services.Servers.GetDomain(PanelRequest.DomainID);
                litDomainName.Text = domain.DomainName;
                if (Utils.IsIdnDomain(domain.DomainName))
                {
                    litDomainName.Text = string.Format("{0} ({1})", Utils.UnicodeToAscii(domain.DomainName), domain.DomainName);
                }
            }
        }
        private void BindDomains()
        {
            DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PackageId);

            if (HideIdnDomains)
            {
                domains = domains.Where(d => !Utils.IsIdnDomain(d.DomainName)).ToArray();
            }

            WebSite[] sites   = null;
            Hashtable htSites = new Hashtable();
            Hashtable htMailDomainPointers = new Hashtable();

            if (HideWebSites)
            {
                sites = ES.Services.WebServers.GetWebSites(PackageId, false);

                foreach (WebSite w in sites)
                {
                    if (htSites[w.Name.ToLower()] == null)
                    {
                        htSites.Add(w.Name.ToLower(), 1);
                    }

                    DomainInfo[] pointers = ES.Services.WebServers.GetWebSitePointers(w.Id);
                    foreach (DomainInfo p in pointers)
                    {
                        if (htSites[p.DomainName.ToLower()] == null)
                        {
                            htSites.Add(p.DomainName.ToLower(), 1);
                        }
                    }
                }
            }

            if (HideMailDomainPointers)
            {
                Providers.Mail.MailDomain[] mailDomains = ES.Services.MailServers.GetMailDomains(PackageId, false);

                foreach (Providers.Mail.MailDomain mailDomain in mailDomains)
                {
                    DomainInfo[] pointers = ES.Services.MailServers.GetMailDomainPointers(mailDomain.Id);
                    if (pointers != null)
                    {
                        foreach (DomainInfo p in pointers)
                        {
                            if (htMailDomainPointers[p.DomainName.ToLower()] == null)
                            {
                                htMailDomainPointers.Add(p.DomainName.ToLower(), 1);
                            }
                        }
                    }
                }
            }


            ddlDomains.Items.Clear();

            // add "select" item
            ddlDomains.Items.Insert(0, new ListItem(GetLocalizedString("Text.SelectDomain"), ""));

            foreach (DomainInfo domain in domains)
            {
                if (HideWebSites)
                {
                    if (domain.WebSiteId > 0)
                    {
                        continue;
                    }
                    else
                    {
                        if (htSites != null)
                        {
                            if (htSites[domain.DomainName.ToLower()] != null)
                            {
                                continue;
                            }
                        }
                    }
                }


                if (HideMailDomainPointers)
                {
                    if (htMailDomainPointers[domain.DomainName.ToLower()] != null)
                    {
                        continue;
                    }
                }


                if (HidePreviewDomain && domain.IsPreviewDomain)
                {
                    continue;
                }
                else if (HideMailDomains && domain.MailDomainId > 0)
                {
                    continue;
                }
                else if (HideDomainPointers && (domain.IsDomainPointer))
                {
                    continue;
                }
                else if (HideDomainsSubDomains && !(domain.IsDomainPointer))
                {
                    continue;
                }

                ddlDomains.Items.Add(new ListItem(domain.DomainName.ToLower(), domain.DomainId.ToString()));
            }

            if (Request.Cookies["CreatedDomainId"] != null)
            {
                Utils.SelectListItem(ddlDomains, Request.Cookies["CreatedDomainId"].Value);
            }
        }