Something that irks me when fighting spam on drupal.org is that there is no visible cue on the user's profile page as to whether an account is active or blocked (contrary to node pages, where the node's status is passed as a class to node.tpl.php).

Attached patch slightly alters the user-profile.tpl.php template and template_preprocess_user_profile() function to introduce an additional class, profile-banned or profile-active, based on account status and similar to how core handles status for nodes.

Comments

mr.baileys’s picture

StatusFileSize
new985 bytes

And one without debug statements....

Status: Needs review » Needs work

The last submitted patch, user-profile-status.patch, failed testing.

mr.baileys’s picture

Status: Needs work » Needs review
StatusFileSize
new2.08 KB

New patch that fixes the test failure (RDFa test was checking for a hardcoded "class='profile'") and adds a CSS rule to set the background for blocked users (using the same background-color core uses for unpublished nodes)

bryanhirsch’s picture

Status: Needs review » Needs work

I can't get this patch to apply any changes. I suspect the pass above is a false positive. Git doesn't report errors when applied inside the modules directory. But it doesn't change anything.

The first line of the patch in post #3 looks like this:
diff --git modules/user/user-profile.tpl.php modules/user/user-profile.tpl.php

I think it's missing the "a" and "b" git puts in front of these file paths. When I make a change and do git diff, the beginning of my patch file looks like this:
diff --git a/modules/user/user-profile.tpl.php b/modules/user/user-profile.tpl.php

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.