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); }
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(); } }
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; } }
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); }
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(); } }
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(); } }
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(); } }