Vergleich inc/datahandlers/pm.php - 1.8.20 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 126Zeile 126
		// Return if we've already validated
if(!empty($pm['sender']))
{

		// Return if we've already validated
if(!empty($pm['sender']))
{

 
			return true;
}

if($pm['fromid'] <= 0)
{
$pm['sender'] = array(
"uid" => 0,
"username" => ''
);


			return true;
}


			return true;
}


Zeile 187Zeile 197
				// No recipients? Skip query
if(empty($pm[$recipient_type]))
{

				// No recipients? Skip query
if(empty($pm[$recipient_type]))
{

					if($recipient_type == 'to' && !$pm['saveasdraft'])

					if($recipient_type == 'to' && empty($pm['saveasdraft']))

					{
$this->set_error("no_recipients");
return false;

					{
$this->set_error("no_recipients");
return false;

Zeile 260Zeile 270
					if($recipient_type == "bccid")
{
$user['bcc'] = 1;

					if($recipient_type == "bccid")
{
$user['bcc'] = 1;

					}


					}


					$recipients[] = $user;
$validUids[] = $user['uid'];
}

foreach($pm[$recipient_type] as $uid)

					$recipients[] = $user;
$validUids[] = $user['uid'];
}

foreach($pm[$recipient_type] as $uid)

				{

				{

					if(!in_array($uid, $validUids))
{
$invalid_recipients[] = $uid;
}

					if(!in_array($uid, $validUids))
{
$invalid_recipients[] = $uid;
}

				}
}
}


				}
}
}


		// If we have one or more invalid recipients and we're not saving a draft, error
if(count($invalid_recipients) > 0)
{
$invalid_recipients = implode($lang->comma, array_map("htmlspecialchars_uni", $invalid_recipients));
$this->set_error("invalid_recipients", array($invalid_recipients));
return false;

		// If we have one or more invalid recipients and we're not saving a draft, error
if(count($invalid_recipients) > 0)
{
$invalid_recipients = implode($lang->comma, array_map("htmlspecialchars_uni", $invalid_recipients));
$this->set_error("invalid_recipients", array($invalid_recipients));
return false;

		}

$sender_permissions = user_permissions($pm['fromid']);



		}

if($pm['fromid'] > 0)
{
$sender_permissions = user_permissions($pm['fromid']);





		// Are we trying to send this message to more users than the permissions allow?
if($sender_permissions['maxpmrecipients'] > 0 && count($recipients) > $sender_permissions['maxpmrecipients'] && $this->admin_override != true)
{
$this->set_error("too_many_recipients", array($sender_permissions['maxpmrecipients']));


			// Are we trying to send this message to more users than the permissions allow?
if($sender_permissions['maxpmrecipients'] > 0 && count($recipients) > $sender_permissions['maxpmrecipients'] && $this->admin_override != true)
{
$this->set_error("too_many_recipients", array($sender_permissions['maxpmrecipients']));
}

		}

// Now we're done with that we loop through each recipient

		}

// Now we're done with that we loop through each recipient

 
		$pm['recipients'] = array();

		foreach($recipients as $user)
{
// Collect group permissions for this recipient.

		foreach($recipients as $user)
{
// Collect group permissions for this recipient.

Zeile 301Zeile 315
			// See if the sender is on the recipients ignore list and that either
// - admin_override is set or
// - sender is an administrator

			// 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['canoverridepm'] != 1)
{

			if($this->admin_override != true && empty($sender_permissions['canoverridepm']))
{

				if(!empty($user['ignorelist']) && strpos(','.$user['ignorelist'].',', ','.$pm['fromid'].',') !== false)

				if(!empty($user['ignorelist']) && strpos(','.$user['ignorelist'].',', ','.$pm['fromid'].',') !== false)

				{

				{

					$this->set_error("recipient_is_ignoring", array(htmlspecialchars_uni($user['username'])));
}

// Is the recipient only allowing private messages from their buddy list?
if(empty($pm['saveasdraft']) && $mybb->settings['allowbuddyonly'] == 1 && $user['receivefrombuddy'] == 1 && !empty($user['buddylist']) && strpos(','.$user['buddylist'].',', ','.$pm['fromid'].',') === false)

					$this->set_error("recipient_is_ignoring", array(htmlspecialchars_uni($user['username'])));
}

// Is the recipient only allowing private messages from their buddy list?
if(empty($pm['saveasdraft']) && $mybb->settings['allowbuddyonly'] == 1 && $user['receivefrombuddy'] == 1 && !empty($user['buddylist']) && strpos(','.$user['buddylist'].',', ','.$pm['fromid'].',') === false)

				{

				{

					$this->set_error('recipient_has_buddy_only', array(htmlspecialchars_uni($user['username'])));
}


					$this->set_error('recipient_has_buddy_only', array(htmlspecialchars_uni($user['username'])));
}


Zeile 323Zeile 337
			}

// Check to see if the user has reached their private message quota - if they have, email them.

			}

// Check to see if the user has reached their private message quota - if they have, email them.

			if($recipient_permissions['pmquota'] != 0 && $user['totalpms'] >= $recipient_permissions['pmquota'] && $sender_permissions['cancp'] != 1 && empty($pm['saveasdraft']) && !$this->admin_override)

			if($recipient_permissions['pmquota'] != 0 && $user['totalpms'] >= $recipient_permissions['pmquota'] && empty($sender_permissions['cancp']) && empty($pm['saveasdraft']) && !$this->admin_override)

			{
if(trim($user['language']) != '' && $lang->language_exists($user['language']))
{
$uselang = trim($user['language']);
}

			{
if(trim($user['language']) != '' && $lang->language_exists($user['language']))
{
$uselang = trim($user['language']);
}

				elseif($mybb->settings['bblanguage'])
{
$uselang = $mybb->settings['bblanguage'];
}

				elseif($mybb->settings['bblanguage'])
{
$uselang = $mybb->settings['bblanguage'];
}

				else
{
$uselang = "english";

				else
{
$uselang = "english";

Zeile 403Zeile 417
		$pm = &$this->data;

// Check if post flooding is enabled within MyBB or if the admin override option is specified.

		$pm = &$this->data;

// Check if post flooding is enabled within MyBB or if the admin override option is specified.

		if($mybb->settings['pmfloodsecs'] > 0 && $pm['fromid'] != 0 && $this->admin_override == false && !is_moderator(0, '', $pm['fromid']))

		if($mybb->settings['pmfloodsecs'] > 0 && $pm['fromid'] > 0 && $this->admin_override == false && !is_moderator(0, '', $pm['fromid']))

		{
// Fetch the senders profile data.
$sender = get_user($pm['fromid']);

		{
// Fetch the senders profile data.
$sender = get_user($pm['fromid']);

Zeile 463Zeile 477
	 * @return boolean True when valid, false when invalid.
*/
function validate_pm()

	 * @return boolean True when valid, false when invalid.
*/
function validate_pm()

	{

	{

		global $plugins;

$pm = &$this->data;

		global $plugins;

$pm = &$this->data;

Zeile 543Zeile 557

$uid = 0;



$uid = 0;


		if(!is_array($pm['recipients']))



		// Build recipient list
$recipient_list = array();
if(isset($pm['recipients']) && is_array($pm['recipients']))

		{

		{

			$recipient_list = array();
}
else
{
// Build recipient list

 
			foreach($pm['recipients'] as $recipient)
{
if(!empty($recipient['bcc']))

			foreach($pm['recipients'] as $recipient)
{
if(!empty($recipient['bcc']))

Zeile 585Zeile 596
		$draftcheck = $db->fetch_array($query);

// This PM was previously a draft

		$draftcheck = $db->fetch_array($query);

// This PM was previously a draft

		if($draftcheck['pmid'])

		if($draftcheck)

		{
if($draftcheck['deletetime'])
{

		{
if($draftcheck['deletetime'])
{

Zeile 629Zeile 640
			// Send email notification of new PM if it is enabled for the recipient
$query = $db->simple_select("privatemessages", "dateline", "uid='".$recipient['uid']."' AND folder='1'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));
$lastpm = $db->fetch_array($query);

			// Send email notification of new PM if it is enabled for the recipient
$query = $db->simple_select("privatemessages", "dateline", "uid='".$recipient['uid']."' AND folder='1'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));
$lastpm = $db->fetch_array($query);

			if($recipient['pmnotify'] == 1 && $recipient['lastactive'] > $lastpm['dateline'])

			if($recipient['pmnotify'] == 1 && (empty($lastpm['dateline']) || $recipient['lastactive'] > $lastpm['dateline']))

			{
if($recipient['language'] != "" && $lang->language_exists($recipient['language']))
{

			{
if($recipient['language'] != "" && $lang->language_exists($recipient['language']))
{

Zeile 665Zeile 676

require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new Postparser;


require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new Postparser;

			



				$parser_options = array(
'me_username' => $pm['sender']['username'],
'filter_badwords' => 1

				$parser_options = array(
'me_username' => $pm['sender']['username'],
'filter_badwords' => 1