Vergleich inc/datahandlers/pm.php - 1.4.2 - 1.4.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: pm.php 4188 2008-09-14 05:05:26Z Tikitiki $

 * $Id: pm.php 4372 2009-05-15 16:13:13Z Tomm $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 322Zeile 322
				$pm['recipients'][$user['uid']]['bcc'] = 1;
}
}

				$pm['recipients'][$user['uid']]['bcc'] = 1;
}
}

 
		return true;
}

/**
* Verify that the user is not flooding the system.
* Temporary fix until a better one can be made for 1.6
*
* @return boolean True
*/
function verify_pm_flooding()
{
global $mybb, $db;

$pm = &$this->data;

// Check if post flooding is enabled within MyBB or if the admin override option is specified.
if($mybb->settings['postfloodcheck'] == 1 && $pm['fromid'] != 0 && $this->admin_override == false)
{
// Fetch the senders profile data.
$sender = get_user($pm['fromid']);

// Calculate last post
$query = $db->simple_select("privatemessages", "dateline", "fromid='".$db->escape_string($pm['fromid'])."'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));
$sender['lastpm'] = $db->fetch_field($query, "dateline");

// A little bit of calculation magic and moderator status checking.
if(TIME_NOW-$sender['lastpm'] <= $mybb->settings['postfloodsecs'] && !is_moderator("", "", $pm['fromid']))
{
// Oops, user has been flooding - throw back error message.
$time_to_wait = ($mybb->settings['postfloodsecs'] - (TIME_NOW-$sender['lastpm'])) + 1;
if($time_to_wait == 1)
{
$this->set_error("pm_flooding_one_second");
}
else
{
$this->set_error("pm_flooding", array($time_to_wait));
}
return false;
}
}
// All is well that ends well - return true.

		return true;
}


		return true;
}


Zeile 386Zeile 428

// We are done validating, return.
$this->set_validated(true);


// We are done validating, return.
$this->set_validated(true);

		if(count($this->get_errors()) > 0)
{

		if(count($this->get_errors()) > 0)
{

			return false;
}
else

			return false;
}
else

		{

		{

			return true;
}
}

			return true;
}
}





	/**
* Insert a new private message.
*

	/**
* Insert a new private message.
*

Zeile 407Zeile 449

// Yes, validating is required.
if(!$this->get_validated())


// Yes, validating is required.
if(!$this->get_validated())

		{

		{

			die("The PM needs to be validated before inserting it into the DB.");
}
if(count($this->get_errors()) > 0)

			die("The PM needs to be validated before inserting it into the DB.");
}
if(count($this->get_errors()) > 0)

Zeile 419Zeile 461
		$pm = &$this->data;

$pm['pmid'] = intval($pm['pmid']);

		$pm = &$this->data;

$pm['pmid'] = intval($pm['pmid']);





		if(!$pm['icon'] || $pm['icon'] < 0)
{
$pm['icon'] = 0;

		if(!$pm['icon'] || $pm['icon'] < 0)
{
$pm['icon'] = 0;

Zeile 450Zeile 492
		$recipient_list = serialize($recipient_list);

$this->pm_insert_data = array(

		$recipient_list = serialize($recipient_list);

$this->pm_insert_data = array(

			'fromid' => $pm['sender']['uid'],

			'fromid' => intval($pm['sender']['uid']),

			'folder' => $pm['folder'],
'subject' => $db->escape_string($pm['subject']),
'icon' => intval($pm['icon']),

			'folder' => $pm['folder'],
'subject' => $db->escape_string($pm['subject']),
'icon' => intval($pm['icon']),

Zeile 465Zeile 507
		);

// Check if we're updating a draft or not.

		);

// Check if we're updating a draft or not.

		$query = $db->simple_select("privatemessages", "pmid", "folder='3' AND uid='{$pm['sender']['uid']}' AND pmid='{$pm['pmid']}'");

		$query = $db->simple_select("privatemessages", "pmid", "folder='3' AND uid='".intval($pm['sender']['uid'])."' AND pmid='{$pm['pmid']}'");

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

// This PM was previously a draft

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

// This PM was previously a draft

Zeile 522Zeile 564
					$emailsubject = $userlang->emailsubject_newpm;
$emailmessage = $userlang->email_newpm;
}

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

 
				
if(!$pm['sender']['username'])
{
$pm['sender']['username'] = 'MyBB Engine';
}


				$emailmessage = $lang->sprintf($emailmessage, $recipient['username'], $pm['sender']['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
$emailsubject = $lang->sprintf($emailsubject, $mybb->settings['bbname']);
my_mail($recipient['email'], $emailsubject, $emailmessage);

				$emailmessage = $lang->sprintf($emailmessage, $recipient['username'], $pm['sender']['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
$emailsubject = $lang->sprintf($emailsubject, $mybb->settings['bbname']);
my_mail($recipient['email'], $emailsubject, $emailmessage);

Zeile 579Zeile 627
			{
$this->pm_insert_data['toid'] = 0;
}

			{
$this->pm_insert_data['toid'] = 0;
}

			$this->pm_insert_data['uid'] = $pm['sender']['uid'];

			$this->pm_insert_data['uid'] = intval($pm['sender']['uid']);

			$this->pm_insert_data['folder'] = 2;
$this->pm_insert_data['status'] = 1;
$this->pm_insert_data['receipt'] = 0;

			$this->pm_insert_data['folder'] = 2;
$this->pm_insert_data['status'] = 1;
$this->pm_insert_data['receipt'] = 0;