コード例 #1
0
 public static void InsertDomain(this Trie <DomainPolicy> t, DomainPolicy d)
 {
     if (d.Type == AllowDomainType.SUBDOMAINS && d.DomainFormat[0] != '.')
     {
         d.DomainFormat = '.' + d.DomainFormat;
     }
     t.Insert(Reverse(d.DomainFormat.ToLower()), d);
 }
コード例 #2
0
        private void btnDelBlockEp_Click(object sender, EventArgs e)
        {
            DomainPolicy d  = lbxDomains.SelectedItem as DomainPolicy;
            EPPolicy     ep = lbxBlockEp.SelectedItem as EPPolicy;

            if (d != null && ep != null)
            {
                d.BlockEP.Remove(ep);
                refreshDomains();
                refreshEPs();
            }
        }
コード例 #3
0
        private void deleteDomainToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DomainPolicy d = lbxDomains.SelectedItem as DomainPolicy;

            if (d != null)
            {
                mainPolicy.AllowedDomains.Remove(d);
                refreshDomains();

                mainPolicy.AllowedDomains = mainPolicy.AllowedDomains;
            }
        }
コード例 #4
0
    public Lockout(string domainName)
    {
        this.context = new DirectoryContext(
            DirectoryContextType.Domain,
            domainName
            );

        //get our current domain policy
        Domain domain = Domain.GetDomain(this.context);

        this.root   = domain.GetDirectoryEntry();
        this.policy = new DomainPolicy(this.root);
    }
コード例 #5
0
        private void btnAddBlockEP_Click(object sender, EventArgs e)
        {
            DomainPolicy d = lbxDomains.SelectedItem as DomainPolicy;

            if (d != null)
            {
                d.BlockEP.Add(new EPPolicy()
                {
                    EpFormat = "/z/enter/ep",
                    Type     = AllowEPType.CONTAIN
                });
                refreshEPs();
            }
        }
コード例 #6
0
        private void lbxDomains_SelectedIndexChanged(object sender, EventArgs e)
        {
            DomainPolicy d = lbxDomains.SelectedItem as DomainPolicy;

            if (d != null)
            {
                txtDomainPattern.Text      = d.DomainFormat;
                cbDomainType.SelectedIndex = (int)d.Type;
                cbBlockDomain.Checked      = d.DomainBlocked;
                cbReferrer.Checked         = d.AllowRefering;

                refreshEPs();
            }
        }
コード例 #7
0
        private void btnDApply_Click(object sender, EventArgs e)
        {
            DomainPolicy d = lbxDomains.SelectedItem as DomainPolicy;

            if (d != null)
            {
                d.DomainFormat  = txtDomainPattern.Text.Trim(new[] { ' ', '.' });
                d.Type          = (AllowDomainType)cbDomainType.SelectedIndex;
                d.DomainBlocked = cbBlockDomain.Checked;
                d.AllowRefering = cbReferrer.Checked;

                mainPolicy.AllowedDomains = mainPolicy.AllowedDomains;
                refreshDomains();
            }
        }