mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

floblanc
29.40.2008 2964e0f4cbf0dcee17b1d333a0ac3312e9a5370d
opends/src/server/org/opends/server/plugins/NetworkGroupPlugin.java
@@ -177,7 +177,7 @@
          ArrayList<Message> messages)
  {
    boolean fullCheck = false;
    if (connection.mustEvaluateNetworkGroup()) {
    if (connection.mustEvaluateNetworkGroup(operation)) {
        NetworkGroup ng = NetworkGroup.findMatchingNetworkGroup(connection);
        if (ng != connection.getNetworkGroup()) {
          connection.setNetworkGroup(ng);
@@ -230,24 +230,26 @@
    ArrayList<Message> messages = new ArrayList<Message>();
    ClientConnection connection = bindOperation.getClientConnection();
    boolean fullCheck = false;
    DN dn;
    try {
      dn = DN.decode(bindOperation.getRawBindDN());
    } catch (DirectoryException ex) {
      return PluginResult.PreParse.stopProcessing(ResultCode.OPERATIONS_ERROR,
              ex.getMessageObject());
    if (connection.mustEvaluateNetworkGroup(bindOperation)) {
      DN dn;
      try {
        dn = DN.decode(bindOperation.getRawBindDN());
      } catch (DirectoryException ex) {
        return PluginResult.PreParse.stopProcessing(ResultCode.OPERATIONS_ERROR,
                ex.getMessageObject());
      }
      AuthenticationType authType = bindOperation.getAuthenticationType();
      NetworkGroup ng = NetworkGroup.findBindMatchingNetworkGroup(connection,
            dn, authType, connection.isSecure());
      if (ng != connection.getNetworkGroup()) {
        connection.setNetworkGroup(ng);
        fullCheck = true;
      }
      connection.mustEvaluateNetworkGroup(false);
    }
    AuthenticationType authType = bindOperation.getAuthenticationType();
    NetworkGroup ng = NetworkGroup.findBindMatchingNetworkGroup(connection, dn,
            authType, connection.isSecure());
    if (ng != connection.getNetworkGroup()) {
      connection.setNetworkGroup(ng);
      fullCheck = true;
    }
    connection.mustEvaluateNetworkGroup(false);
    if (!checkNetworkGroup(connection, bindOperation, fullCheck, messages)) {
      return PluginResult.PreParse.stopProcessing(
              ResultCode.ADMIN_LIMIT_EXCEEDED, messages.get(0));