Vergleich inc/datahandlers/pm.php - 1.8.5 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 50Zeile 50

/**
* PM ID currently being manipulated by the datahandlers.


/**
* PM ID currently being manipulated by the datahandlers.

 
	 *
* @var int

	 */
public $pmid = 0;


	 */
public $pmid = 0;


Zeile 128Zeile 130
		// Check if the sender is over their quota or not - if they are, disable draft sending
if(isset($pm['options']['savecopy']) && $pm['options']['savecopy'] != 0 && empty($pm['saveasdraft']))
{

		// Check if the sender is over their quota or not - if they are, disable draft sending
if(isset($pm['options']['savecopy']) && $pm['options']['savecopy'] != 0 && empty($pm['saveasdraft']))
{

			if($sender_permissions['pmquota'] != "0" && $sender['totalpms'] >= $sender_permissions['pmquota'] && $this->admin_override != true)

			if($sender_permissions['pmquota'] != 0 && $sender['totalpms'] >= $sender_permissions['pmquota'] && $this->admin_override != true)

			{
$pm['options']['savecopy'] = 0;
}

			{
$pm['options']['savecopy'] = 0;
}

Zeile 291Zeile 293
			// 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['cancp'] != 1) && $sender_permissions['canoverridepm'] != 1)

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

			{
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($user['username']));

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

				}

// Is the recipient only allowing private messages from their buddy list?

				}

// Is the recipient only allowing private messages from their buddy list?

Zeile 306Zeile 308

// Can the recipient actually receive private messages based on their permissions or user setting?
if(($user['receivepms'] == 0 || $recipient_permissions['canusepms'] == 0) && empty($pm['saveasdraft']))


// Can the recipient actually receive private messages based on their permissions or user setting?
if(($user['receivepms'] == 0 || $recipient_permissions['canusepms'] == 0) && empty($pm['saveasdraft']))

				{
$this->set_error("recipient_pms_disabled", array($user['username']));

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

					return false;
}
}

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

					return false;
}
}

// 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'] && $recipient_permissions['cancp'] != 1 && $sender_permissions['cancp'] != 1 && empty($pm['saveasdraft']) && !$this->admin_override)

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

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

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

Zeile 357Zeile 359

if($this->admin_override != true)
{


if($this->admin_override != true)
{

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

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

				}
}


				}
}


Zeile 384Zeile 386
	/**
* Verify that the user is not flooding the system.
*

	/**
* Verify that the user is not flooding the system.
*

	* @return boolean True

	* @return boolean

	*/
function verify_pm_flooding()
{

	*/
function verify_pm_flooding()
{

Zeile 393Zeile 395
		$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)

		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 403Zeile 405
			$sender['lastpm'] = $db->fetch_field($query, "dateline");

// A little bit of calculation magic and moderator status checking.

			$sender['lastpm'] = $db->fetch_field($query, "dateline");

// A little bit of calculation magic and moderator status checking.

			if(TIME_NOW-$sender['lastpm'] <= $mybb->settings['pmfloodsecs'] && !is_moderator("", "", $pm['fromid']))

			if(TIME_NOW-$sender['lastpm'] <= $mybb->settings['pmfloodsecs'])

			{
// Oops, user has been flooding - throw back error message.
$time_to_wait = ($mybb->settings['pmfloodsecs'] - (TIME_NOW-$sender['lastpm'])) + 1;

			{
// Oops, user has been flooding - throw back error message.
$time_to_wait = ($mybb->settings['pmfloodsecs'] - (TIME_NOW-$sender['lastpm'])) + 1;

Zeile 480Zeile 482
		if(!empty($pm['saveasdraft']))
{
$pm['folder'] = 3;

		if(!empty($pm['saveasdraft']))
{
$pm['folder'] = 3;

		}

		}

		else
{
$pm['folder'] = 1;

		else
{
$pm['folder'] = 1;

Zeile 600Zeile 602
			}

$plugins->run_hooks("datahandler_pm_insert_updatedraft", $this);

			}

$plugins->run_hooks("datahandler_pm_insert_updatedraft", $this);

			$db->insert_query("privatemessages", $this->pm_insert_data);





$this->pmid = $db->insert_query("privatemessages", $this->pm_insert_data);

$plugins->run_hooks("datahandler_pm_insert_updatedraft_commit", $this);


// If this is a draft, end it here - below deals with complete messages
return array(


// If this is a draft, end it here - below deals with complete messages
return array(

Zeile 631Zeile 636
					$uselang = "english";
}
if($uselang == $mybb->settings['bblanguage'] && !empty($lang->emailsubject_newpm))

					$uselang = "english";
}
if($uselang == $mybb->settings['bblanguage'] && !empty($lang->emailsubject_newpm))

				{

				{

					$emailsubject = $lang->emailsubject_newpm;
$emailmessage = $lang->email_newpm;
}

					$emailsubject = $lang->emailsubject_newpm;
$emailmessage = $lang->email_newpm;
}

Zeile 643Zeile 648
					$userlang->load("messages");
$emailsubject = $userlang->emailsubject_newpm;
$emailmessage = $userlang->email_newpm;

					$userlang->load("messages");
$emailsubject = $userlang->emailsubject_newpm;
$emailmessage = $userlang->email_newpm;

				}

				}


if(!$pm['sender']['username'])
{
$pm['sender']['username'] = $lang->mybb_engine;
}


if(!$pm['sender']['username'])
{
$pm['sender']['username'] = $lang->mybb_engine;
}





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


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


Zeile 669Zeile 674
					"subject" => $db->escape_string($emailsubject),
"message" => $db->escape_string($emailmessage),
"headers" => ''

					"subject" => $db->escape_string($emailsubject),
"message" => $db->escape_string($emailmessage),
"headers" => ''

				);


				);


				$db->insert_query("mailqueue", $new_email);
$cache->update_mailqueue();
}

				$db->insert_query("mailqueue", $new_email);
$cache->update_mailqueue();
}





			$this->pm_insert_data['uid'] = $recipient['uid'];
$this->pm_insert_data['toid'] = $recipient['uid'];

			$this->pm_insert_data['uid'] = $recipient['uid'];
$this->pm_insert_data['toid'] = $recipient['uid'];





			$plugins->run_hooks("datahandler_pm_insert", $this);

			$plugins->run_hooks("datahandler_pm_insert", $this);

 


			$this->pmid[] = $db->insert_query("privatemessages", $this->pm_insert_data);

			$this->pmid[] = $db->insert_query("privatemessages", $this->pm_insert_data);

 

$plugins->run_hooks("datahandler_pm_insert_commit", $this);


// If PM noices/alerts are on, show!
if($recipient['pmnotice'] == 1)


// If PM noices/alerts are on, show!
if($recipient['pmnotice'] == 1)

Zeile 702Zeile 710
			{
$sql_array = array(
'status' => 3,

			{
$sql_array = array(
'status' => 3,

					'statustime' => TIME_NOW

					'statustime' => TIME_NOW

				);
$db->update_query("privatemessages", $sql_array, "pmid={$pm['pmid']} AND uid={$pm['sender']['uid']}");
}

				);
$db->update_query("privatemessages", $sql_array, "pmid={$pm['pmid']} AND uid={$pm['sender']['uid']}");
}

Zeile 733Zeile 741
			$this->pm_insert_data['receipt'] = 0;

$plugins->run_hooks("datahandler_pm_insert_savedcopy", $this);

			$this->pm_insert_data['receipt'] = 0;

$plugins->run_hooks("datahandler_pm_insert_savedcopy", $this);

 


			$db->insert_query("privatemessages", $this->pm_insert_data);

			$db->insert_query("privatemessages", $this->pm_insert_data);

 

$plugins->run_hooks("datahandler_pm_insert_savedcopy_commit", $this);


// Because the sender saved a copy, update their total pm count
require_once MYBB_ROOT."/inc/functions_user.php";


// Because the sender saved a copy, update their total pm count
require_once MYBB_ROOT."/inc/functions_user.php";