Some users are seeing SBP indexing users show up in their Who's Online block, galleries, etc.

See thread starting at comment #3 on this issue:
#716342: SBP users for indexing may have duplication problems

CommentFileSizeAuthor
#1 828006.patch1.33 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Status: Active » Needs review
FileSize
1.33 KB

I just checked into the core Drupal 6.x user blocks.

The Who's New block does not show users whose status is 'blocked'.

The Who's Online block joins users from the users table to sessions in the sessions table, and doesn't explicitly check for the status of users (since normally blocked users can't log in, it probably seems unnecessary).

So what I've just done is to set up Search by Page so that it doesn't store sessions while it's indexing pages. That should fix the Who's Online block.

As far as the other concerns in the thread: one thing you can do is rename the Search by Page user(s) to something else so that it doesn't look odd. Search by Page doesn't care what the user name is. Or you can modify the contributed modules you are using so that they don't create galleries (or show them) for users who are blocked. The core User module already won't show user profiles for blocked users (except if you are an administrator). Other modules should do similar things, and if they don't, in my opinion it's a bug.

Here's the patch... will commit shortly to the development branch.

jhodgdon’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

The tests pass in my testing environment - there seems to be something seriously wrong with the testing bot's environment right now, not sure what. So I committed this change to the development 6.x version of Search by Page.

jhodgdon’s picture

Status: Patch (to be ported) » Fixed

I've also committed this fix to the Drupal 7 development version of Search by Page. The patch is pretty much the same, except the function is called drupal_save_session() instead of session_save_session().

jhodgdon’s picture

I would just add that I'm open to the idea of deleting users after indexing content. But I'm a bit worried about whether it will (a) fix the problem reported with these users showing up in various places and (b) cause other problems. So... if someone writes a patch and reopens this issue, I'll reconsider, but until now I'm tentatively saying no.

jpcwebb’s picture

Thanks for the investigations and checks. My view is that I agree that other modules should respect the blocked status, but in practice unfortunately they don't always, and in the case of integration with other software (like Gallery and SMF), this relies on the other software having a blocked status within its user system or the integration module being designed to ignore blocked users when they synchronise. But certainly for Drupal modules this should be the case.

I think SMF does have blocking capability but I don't know if the status is carried from Drupal to it via the integration module - but it doesn't stop the user being created or showing up on the forum's newest member block at the front page which is the main problem. Gallery doesn't have blocking capability as far as I know, but also the Gallery integration module maintainer doesn't seem to be very active and requests for updates/ changes are largely ignored, so I have little hope of getting this issue dealt with there.

What happens with Gallery is that the users are created, but then not deleted, so it continues to accumulate dummy users - right now I have 5 sbp users showing up in Gallery for example.

Thus, if sbp could delete the user, at least that would save some administrative hassle in having to delete the user (and their associated album) in Gallery, and the same in SMF, even if the user appears temporarily during indexing. The ability to change the name of the dummy user would certainly help in making it less obvious.

jhodgdon’s picture

Title: SBP indexing users are showing up on site » SBP indexing users - delete after indexing or allow name change
Version: 7.x-1.x-dev » 6.x-1.x-dev
Category: bug » feature
Status: Fixed » Active

Hmmm. SBP should just create the user once, then continue to use it (one user per role you've asked for in indexing). Once the user has been created, you can definitely change the name from the user management screen in Drupal, and it shouldn't affect SBP.

Anyway, I do see your point. Let's leave this issue open as a feature request to either have SBP delete its temporary users after indexing, or to have the ability to change the dummy user names to something else.

jhodgdon’s picture

I would also like to point out that setting users to "blocked" rather than deleting them is a common practice of Drupal site webmasters for dealing with spammers. The reason is that Drupal requires email addresses to be unique, so a blocked user cannot re-apply with the same email address. Of course in today's world it's not that hard to get another email address... but still, it is a fairly common practice (for instance, drupal.org webmasters do that).

It's also fairly simple to modify a module to understand "blocked" status. All you have to do is find the database queries on the {users} table and add a status = 1 WHERE clause to them.

jhodgdon’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes