数据源:
1 网站loginName集合[default]
SPSite siteCollection = SPControl.GetContextSite(Context);
SPWeb site = siteCollection.RootWeb;
SPUserCollection users = site.AllUsers;
foreach (SPUser user in users)
{
user.LoginName;//LoginName集
}
2 AD的loginName集合
--截取domainName值
--int intStart = this.LDAPAddress.IndexOf("DC=");
--string strFirstDC = this.LDAPAddress.Substring(intStart+3);
--int intEnd = strFirstDC.IndexOf(",");
--string domainName = strFirstDC.Substring(0,intEnd);
DirectoryEntry myEntry = new DirectoryEnty (LDAPAddress,AdministratorName,AdministratorPwd,AuthenticationTypes.Secure);
DirectorySearcher mySearcher = new DirectorySearcher(myEntry);
mySearcher.SearchScope = SearchScope.OneLevel;
mySearcher.Filter = "(objectClass=user)";
SearchResultCollection myResultCollection = mySearcher.FindAll();
foreach(SearchResult myResult in myResultCollection)
{
DirectoryEntry userEntry = new DirectoryEntry(myResult.Path,AdministratorName,AdministratorPwd,AuthenticationTypes.Secure);
string userName = userEntry.Properties["samAccountName"].Value.ToString();
domainName +"\\"+ userName; //LoginName集
}
配置信息:
1 LDAPAddress //LDAP查询串(LDAP://CN=”department”,DC=”domain”,DC=”com”)
2 AdministratorName //域管理员帐号
3 AdministratorPwd //域管理员密码
4 ShowName //自定义配置文件的显示名称,default为姓名,手机,工作电子邮件地址,部门
5 MyQuery //筛选条件
6 Query2 //筛选值(>;>=;<;<=;=)
7 DispOder //在用户配置文件中增加配置文件属性“显示顺序”,用于排序
前台显示问题:
因为涉及很多html代码及样式,我想每个开发人员都不想陷入到与客户的变幻无常的界面,样式的修改,调整里;
所以暂时决定采用静态置标[$姓名$]的方式,让客户去维护类似的html页;鉴于此举,想征询各位同仁的高招,感谢!!!