Concept

This module is for sites that allow users to create an account, but require administrator approval for account activation. This module creates a block that shows a list of unactivated user accounts, with links to their account pages. This block is visible for anyone with 'administer users' permission, and will not be shown to any other users.

Drupal 7 version

The Drupal 7 version has been released. I overhauled a lot of the code in this version, removing the custom javascript entirely and replacing it with D7 Ajax Helpers. The module is currently a release candidate, as there are potentially issues that will creep up, but for the most part it should be ok.

Directions

After enabling the module, go to Structure -> blocks (Drupal 6: Administer -> Site building -> blocks) and place the block in the region of your choice. The block is not enabled by default.

Note

There isn't actually anything in the database (that I know of) that specifically says a user has registered but not had their account approved. Their account status is just set to 'blocked' when they register, and the administrator has to set it to active. As such, in creating this module, I determined that a user is awaiting administrator approval when the following conditions are met in the 'users' table:

  • The user's status is zero (blocked)
  • The account creation date is greater than zero
  • Login is zero (never logged in)

What this means is that there is a 'bug', in that if a user's account is activated, and then blocked again before they have logged in, they will show up on the list as awaiting activation. This could probably be worked around by creating a new table in the database whereby any users who have their account activated are added to this table, and when rendering the block, a check is run against this new table to see if the above circumstance has occurred. However, this would add an extra query to the database each time the block is rendered, for a situation that I don't see occurring with enough frequency to make it worth adding the performance drag it would cause.

Drupal 6 Note

Only five users are shown at a time. For users with javascript turned off, they will only be able to see these five users. For users with javascript turned on, if there are more than five accounts awaiting approval, they will be given a pagination list at the bottom. This pagination is done using javascript/ajax, and will not require a page reload to go through all the pending user accounts.

The D7 version has been re-written, and pagination will be shown (and work) whether javascript is on or off. At some point after I have upgraded my other modules to D7, I will probably come back and re-work the D6 pagination to work without javascript.

Project Information

Downloads