How to view banned members in forum

Phillip

Active member
What is the best way to give mods the ability to see that members have banned without control panel access? Is there a reliable add-on that will let mods see on the forum (like user pages, member cards, etc.) if a member has banned?

It appears that the only way to view banned info by default is through the admin control panel. I'd like to adjust this so that mods can view whether a member has been banned or not on the forum itself.
 

Jake Bunce

XenForo moderator
Staff member
Here is one option:

http://xenforo.com/community/threads/template-files-see-if-user-is-banned.18026/#post-234310

That template edit affects avatars in posts.

Mouth is talking about setting a user title. You would have to create a new group for banned users and then specify it as the banned group:

Admin CP -> Home -> Options -> User Discouragement and Discipline -> Add User Group on Ban

Then set an appropriate user title and high display priority (higher than other groups) for the banned group:

Admin CP -> Users -> List User Groups -> [click the group]
> Display Styling Priority
> User Title Override
 

1l1

Member
Is there any way to let registered users view banned profiles? If I check "Bypass user privacy: Allow" for this group it also makes possible for them to view invisible members online.
 

Jake Bunce

XenForo moderator
Staff member
Is there any way to let registered users view banned profiles? If I check "Bypass user privacy: Allow" for this group it also makes possible for them to view invisible members online.

library/XenForo/Model/UserProfile.php

Remove (or comment) the red code:

Rich (BB code):
	public function canViewFullUserProfile(array $user, &$errorPhraseKey = '', array $viewingUser = null)
	{
		$this->standardizeViewingUserReference($viewingUser);

		if ($viewingUser['user_id'] == $user['user_id'])
		{
			return true; // always let a user view their own profile
		}

		if (!XenForo_Permission::hasPermission($viewingUser['permissions'], 'general', 'viewProfile'))
		{
			return false;
		}

		$userModel = $this->_getUserModel();

		if (!$userModel->passesPrivacyCheck($user['allow_view_profile'], $user, $viewingUser))
		{
			$errorPhraseKey = 'member_limits_viewing_profile';
			return false;
			// TODO: we should do a limited profile at some point
		}

		// don't display the profiles of unconfirmed users
		if ($user['user_state'] != 'valid' & $user['user_state'] != 'email_confirm_edit' && !$userModel->canByPassUserPrivacy($user['user_id']))
		{
			$errorPhraseKey = 'this_users_profile_is_not_available';
			return false;
		}

		// user profiles of permanently-banned users should be unavailable to all but privacy-bypassing users
		if ($user['is_banned'])
		{
			$ban = $this->getModelFromCache('XenForo_Model_Banning')->getBannedUserById($user['user_id']);

			if ($ban && $ban['end_date'] == 0 && !$userModel->canBypassUserPrivacy($null, $viewingUser))
			{
				$errorPhraseKey = 'this_users_profile_is_not_available';
				return false;
			}
		}

		return true;
	}

That will make it so banned user profiles are viewable to all (who have permission to view profiles).

This can be made into an addon by extending XenForo_Model_UserProfile.
 
Top