Add an option to enable/disable hash lookup via the LDAP provider.
This commit is contained in:
@@ -159,6 +159,10 @@ public class LdapThreePidProvider extends LdapBackend implements IThreePidProvid
|
|||||||
@Override
|
@Override
|
||||||
public Iterable<ThreePidMapping> populateHashes() {
|
public Iterable<ThreePidMapping> populateHashes() {
|
||||||
List<ThreePidMapping> result = new ArrayList<>();
|
List<ThreePidMapping> result = new ArrayList<>();
|
||||||
|
if (!getCfg().getIdentity().isLookup()) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
String filter = getCfg().getIdentity().getFilter();
|
String filter = getCfg().getIdentity().getFilter();
|
||||||
|
|
||||||
try (LdapConnection conn = getConn()) {
|
try (LdapConnection conn = getConn()) {
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ public abstract class LdapConfig {
|
|||||||
private String filter;
|
private String filter;
|
||||||
private String token = "%3pid";
|
private String token = "%3pid";
|
||||||
private Map<String, String> medium = new HashMap<>();
|
private Map<String, String> medium = new HashMap<>();
|
||||||
|
private boolean lookup = false;
|
||||||
|
|
||||||
public String getFilter() {
|
public String getFilter() {
|
||||||
return filter;
|
return filter;
|
||||||
@@ -262,6 +263,13 @@ public abstract class LdapConfig {
|
|||||||
this.medium = medium;
|
this.medium = medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLookup() {
|
||||||
|
return lookup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLookup(boolean lookup) {
|
||||||
|
this.lookup = lookup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Profile {
|
public static class Profile {
|
||||||
|
|||||||
Reference in New Issue
Block a user