MyBB Community Forums

Full Version: [F] Admin override not work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If $user['receivepms'] == 0 then administrators can't send pm to user!
I think "inc/datahandlers/pm.php" must have this change:

Now is:
			// See if the sender is on the recipients ignore list and that either
			// - admin_override is set or
			// - sender is an administrator
			if($this->admin_override != true && $sender_permissions['cancp'] != 1)
			{
				$ignorelist = explode(",", $user['ignorelist']);
				foreach($ignorelist as $uid)
				{
					if($uid == $pm['fromid'])
					{
						$this->set_error("recipient_is_ignoring", array($user['username']));
					}
				}
			}
	
			// Can the recipient actually receive private messages based on their permissions or user setting?
			if($user['receivepms'] == 0 || $recipient_permissions['canusepms'] == 0 && !$pm['saveasdraft'])
			{
				$this->set_error("recipient_pms_disabled", array($user['username']));
				return false;
			}

After change will be: (as a suggestion)
			// See if the sender is on the recipients ignore list and that either
			// - admin_override is set or
			// - sender is an administrator
			if($this->admin_override != true && $sender_permissions['cancp'] != 1)
			{
				$ignorelist = explode(",", $user['ignorelist']);
				foreach($ignorelist as $uid)
				{
					if($uid == $pm['fromid'])
					{
						$this->set_error("recipient_is_ignoring", array($user['username']));
					}
				}

				// Can the recipient actually receive private messages based on their permissions or user setting?
				if($user['receivepms'] == 0 || $recipient_permissions['canusepms'] == 0 && !$pm['saveasdraft'])
				{
					$this->set_error("recipient_pms_disabled", array($user['username']));
					return false;
				}
			}	
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.