0

I currently have a Drupal 7 site set up to allow users with the Doctor role to create users with the Patient role, via admin/people/create.

Does Drupal store data about which user created a specific account? If the answer is yes, how can I display this information in a view?

0

2 Answers 2

0

You have to create a custom module for this.

  • First you have to add a user field here admin/config/people/accounts/fields. Add a field that will check whether the user has been created by user with role "doctor". A boolean field would suffice. Mark the field as non-mandatory
  • Create a custom module. This module will provide an interface that only the users with role "doctor" can access. In the interface provide a button, clicking that button will create user with role "patient", also flag the field you created above.
  • Now in views create a page or block that will display the users, in the filter criteria of the view check whether the boolean field is flagged for that user.
0

On admin/reports/dblog, if you filter the log messages by type, and select "user" as log type, you see who created a user.

  • The "Message" column will contain a message starting with "New User"
  • The "User" column will contain a link to the user account of who created the user, or it will not contain a link when the user has not been created from a logged-in user

created from a logged-in user

created from an anonymous user

The same is true for who deleted a user account, as visible in the first screenshot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.