Commit f2e704fd authored by C_Logemann's avatar C_Logemann Committed by Carsten Logemann
Browse files

Issue #2854940 by C_Logemann: Make direct LDAP operation optional.

parent c9be00fb
Loading
Loading
Loading
Loading
+14 −2
Changes for ldapcontrol_usersync.module: 14 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ function ldapcontrol_usersync_user_update(&$edit, &$account, $category = NULL) {
    }

    // Synchronize data in LDAP:
    _ldapcontrol_usersync_ldapentry($account, $db);
    _ldapcontrol_usersync_update($account, $db);

  }
}
@@ -89,7 +89,19 @@ function ldapcontrol_usersync_user_delete($account) {
    }

    // Delete LDAP entry:
    _ldapcontrol_usersync_ldapentry($account, $db, TRUE);
    _ldapcontrol_usersync_update($account, $db, TRUE);
  }
}

/**
 * Call internal LDAP function and external hooks on user modification.
 */
function _ldapcontrol_usersync_update($account, $db, $delete = FALSE) {
  _ldapcontrol_usersync_ldapentry($account, $db, $delete);

  $modules = module_implements('ldapcontrol_usersync_update');
  foreach ($modules as $module) {
    module_invoke($module, 'ldapcontrol_usersync_update', $account, $db, $delete);
  }
}