コード例 #1
0
 public GraphNode Locate(DomainKey domain)
 {
     if (data.ContainsKey(domain))
     {
         return(data[domain]);
     }
     return(null);
 }
コード例 #2
0
ファイル: ADModel.cs プロジェクト: woundride/pingcastle
 public GraphNode(int Id, DomainKey Domain, DateTime ReferenceDate)
 {
     //Trace.WriteLine("Creating " + Domain);
     this.Id            = Id;
     this.Domain        = Domain;
     this.ReferenceDate = ReferenceDate;
     Trusts             = new Dictionary <DomainKey, GraphEdge>();
 }
コード例 #3
0
 public bool HasDomainAmbigiousName(DomainKey domainKey)
 {
     if (AmbigiousNameReference.ContainsKey(domainKey.DomainName))
     {
         return(AmbigiousNameReference[domainKey.DomainName].Count > 1);
     }
     return(true);
 }
コード例 #4
0
 public void SetForest(DomainKey forest)
 {
     // compatibility with older report without forest information
     if (String.IsNullOrEmpty(forest.DomainName))
     {
         return;
     }
     if (forest != null && Forest == null)
     {
         Forest = forest;
     }
 }
コード例 #5
0
        // SID is suppose to identify uniquely a domain
        // but we cannot guarantee that it is here (for example domain removed or firewalled)
        public GraphNode CreateNodeIfNeeded(ref int number, DomainKey Domain, string NetBiosName, DateTime ReferenceDate)
        {
            GraphNode output = null;

            if (!data.ContainsKey(Domain))
            {
                output       = new GraphNode(number++, Domain, NetBiosName, ReferenceDate);
                data[Domain] = output;
            }
            else
            {
                output = data[Domain];
            }
            return(output);
        }
コード例 #6
0
        protected string PrintDomain(DomainKey key)
        {
            string label = key.DomainName;

            if (GetUrlCallback == null)
            {
                return(label);
            }
            string htmlData = GetUrlCallback(key, label);

            if (String.IsNullOrEmpty(htmlData))
            {
                return(label);
            }
            return(htmlData);
        }
コード例 #7
0
 public void EnrichForestInformation()
 {
     if (Forest != null)
     {
         return;
     }
     foreach (var trust in Trusts.Keys)
     {
         if ((Trusts[trust].TrustAttributes & 32) != 0)
         {
             if (Trusts[trust].Destination.Forest != null)
             {
                 Forest = Trusts[trust].Destination.Forest;
                 continue;
             }
         }
     }
 }
コード例 #8
0
 public HealthcheckData GetDomain(DomainKey key)
 {
     if (key.DomainSID != null)
     {
         if (data.ContainsKey(key.DomainSID))
         {
             return(data[key.DomainSID]);
         }
         return(null);
     }
     foreach (HealthcheckData hc in data.Values)
     {
         if (String.Equals(hc.DomainFQDN, key.DomainName, StringComparison.InvariantCultureIgnoreCase))
         {
             return(hc);
         }
     }
     return(null);
 }
コード例 #9
0
 private void UpdateAmbigiousReference(DomainKey domain)
 {
     if (domain == null || String.IsNullOrEmpty(domain.DomainSID) || String.IsNullOrEmpty(domain.DomainName))
     {
         return;
     }
     if (!AmbigiousNameReference.ContainsKey(domain.DomainName))
     {
         AmbigiousNameReference[domain.DomainName] = new List <string> {
             domain.DomainSID
         }
     }
     ;
     else if (!String.IsNullOrEmpty(domain.DomainSID))
     {
         if (!AmbigiousNameReference[domain.DomainName].Contains(domain.DomainSID))
         {
             AmbigiousNameReference[domain.DomainName].Add(domain.DomainSID);
         }
     }
 }
コード例 #10
0
        public GraphNode GetDomain(string center)
        {
            DomainKey key = new DomainKey(center, null, null);

            return(Locate(key));
        }