addition of part of functionality of security groups for organization users
This commit is contained in:
parent
b6d03a3ecb
commit
53dc8efa5d
37 changed files with 3235 additions and 6 deletions
|
@ -44,6 +44,35 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return de;
|
||||
}
|
||||
|
||||
public static string[] GetUsersGroup(string group)
|
||||
{
|
||||
List<string> rets = new List<string>();
|
||||
|
||||
DirectorySearcher deSearch = new DirectorySearcher
|
||||
{
|
||||
Filter =
|
||||
("(&(objectClass=user))")
|
||||
};
|
||||
|
||||
SearchResultCollection srcUsers = deSearch.FindAll();
|
||||
|
||||
foreach (SearchResult srcUser in srcUsers)
|
||||
{
|
||||
DirectoryEntry de = srcUser.GetDirectoryEntry();
|
||||
PropertyValueCollection props = de.Properties["memberOf"];
|
||||
|
||||
foreach (string str in props)
|
||||
{
|
||||
if (str.IndexOf(group) != -1)
|
||||
{
|
||||
rets.Add(de.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rets.ToArray();
|
||||
}
|
||||
|
||||
public static bool IsUserInGroup(string samAccountName, string group)
|
||||
{
|
||||
bool res = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue