We have enable new account approval in Drupal. That is, a mail is sent to the site admin when a new user validates its email address. In that mail there is a URL (e.g http://mysite.com/admin/user/accounts/pending/create/) where I can see a form to accept or reject the new account. In that form, the profile fields for firstname and lastename are empty, even if the user fill them in the registration form.

I think the problem is in _ldapprov_profile(). The form is created by ldapprov_create() that take the account information from the db. The fistname and the lastname are stored in $data['first_name'] and $data['last_name']. _ldapprov_profile() invoke _ldapprov_register_form($data) that call _ldapprov_profile(), where the $edit argument of _ldapprov_profile() contains the $data array. The problem is that _ldapprov_profile access to $edit using the names of profile fields to retrieve the corresponding array values but, for example, the profile field for firstname is realname and not first_name meanwhile the profile field for lastname is surname and not last_name. _ldapprov_profile() is not using the good keys.

Comments

miglius’s picture

First, make sure you're running the latest code since I fixed similar bug couple a weeks ago. Just download and overwrite the module files.

Then make sure that "Profile first name" and "Profile last name" at admin/settings/ldapprov "Registration form" are exactly the same as profile "Name" entries at admin/user/profile for the first and last names (for instance profile_first and profile_last, but can be arbitrary). If those fields matche then ldapprov database table's first_name and last_name should be populated with the corresponding profile fields.

When a new user enters his registration data, can you check if first_name and last_name columns are populated in the ldapprov table for that user?

miglius’s picture

jesustorres’s picture

> First, make sure you're running the latest code since I fixed similar bug couple a weeks ago. Just download and overwrite the module files.

Yes. I updated my local repository two days ago.

> Then make sure that "Profile first name" and "Profile last name" at admin/settings/ldapprov "Registration form" > are exactly the same as profile "Name" entries at admin/user/profile for the first and last names (for instance
> profile_first and profile_last, but can be arbitrary). If those fields matche then ldapprov database table's
> first_name and last_name should be populated with the corresponding profile fields.
>
> When a new user enters his registration data, can you check if first_name and last_name columns are
> populated in the ldapprov table for that user?

Yes, the first_name and last name columns are populated. The problem is that _ldapprov_register_form() does not use the values of those columns as default values in the form fields during account approval.

miglius’s picture

Do you use a "profile_" prefix for a profile names?

miglius’s picture

Assigned: Unassigned » miglius
Status: Active » Closed (duplicate)

Closing at is duplicate for http://drupal.org/node/193319