Browse Source

域控 Domain Users 所有人都可以访问

master
rui_li 1 month ago
parent
commit
b1040dc285
  1. 8
      src/main/java/com/spring/modules/sys/service/impl/CheckLdapDirectoryImpl.java

8
src/main/java/com/spring/modules/sys/service/impl/CheckLdapDirectoryImpl.java

@ -48,6 +48,10 @@ public class CheckLdapDirectoryImpl implements CheckLdapDirectory {
public boolean checkUserLdapDirectory(String username, String directoryPath) throws NamingException { public boolean checkUserLdapDirectory(String username, String directoryPath) throws NamingException {
//查询文件的域控账号或分组 //查询文件的域控账号或分组
Map<String, String> directoryGroupAccount = this.getDirectoryLdapAccount(directoryPath); Map<String, String> directoryGroupAccount = this.getDirectoryLdapAccount(directoryPath);
//检查是否含有Domain Users
if(directoryGroupAccount.containsKey("Domain Users")){
return true;
}
//查询用户是否是该文件夹的域控账号或分组 //查询用户是否是该文件夹的域控账号或分组
//Map<String, String> ldapAccountGroup = this.getLapAccountGroup(username); //Map<String, String> ldapAccountGroup = this.getLapAccountGroup(username);
if (directoryGroupAccount.containsKey(username)) { if (directoryGroupAccount.containsKey(username)) {
@ -172,6 +176,7 @@ public class CheckLdapDirectoryImpl implements CheckLdapDirectory {
if (checkMemberIsGroupWithName(ctx, strKey)){ if (checkMemberIsGroupWithName(ctx, strKey)){
System.out.println("新Group:"+strKey); System.out.println("新Group:"+strKey);
ldapAccount.putAll(getLdapAccountListFromGroup(ctx, strKey)); ldapAccount.putAll(getLdapAccountListFromGroup(ctx, strKey));
ldapAccount.put(strKey, strKey);//添加组信息
}else { }else {
ldapAccount.put(strKey, strKey); ldapAccount.put(strKey, strKey);
} }
@ -234,10 +239,9 @@ public class CheckLdapDirectoryImpl implements CheckLdapDirectory {
/** /**
*
* 查询用列表
* @return * @return
* @throws NamingException * @throws NamingException
* @throws 查询用列表
*/ */
public Map<String, String> getLdapAccountListPage() throws NamingException { public Map<String, String> getLdapAccountListPage() throws NamingException {
Properties env = new Properties(); Properties env = new Properties();

Loading…
Cancel
Save