My scenario:
I have a drupal server connecting to the LDAP server.
I have the drupal server set to only allow the admin to add users.
On this particular server, users should never be allowed to register themselves.
Note: I am not the ldap admin myself, so I do not know how to nor do I have authorization to make & use ldap group capabilities.

The problem:
Most of the users on the LDAP server should not so much as be able to login to the drupal server.
However, because of the auto-register process, users who have a valid LDAP accounts can bypass drupal's "Only site administrators can create new user accounts." process.

Tne request:
Provide an ldap option to either respect the public registration flags of drupal core or provide the ability to explicitly allow/deny auto-registration on login.

I have a patch that provides a wrapper around the autoregister on login process.
This patch provides the variable but hardcodes it to false because I do not know the variable or function call needed to process the "Only site administrators can.." settings. (this is the line: $autoregister_users = FALSE;)

Comments

miglius’s picture

You're asking drupal to do what it is not supposed to do. LDAP is an authentication backend for drupal. If the user has a LDAP account, he will be able to login to drupal.

Registration flag you mentioned is used for creating the new accounts both in drupal or ldap (using http://drupal.org/project/ldap_provisioning module). This flag is not used to authenticate a user.

This logic can be done in LDAP by groups and other means, but if you cannot change LDAP settings, drupal will not help you in this case either.

miglius’s picture

Status: Active » Closed (works as designed)