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

  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 4277 2008-11-23 20:47:16Z Tikitiki $

 */

// 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 333Zeile 375
	function verify_options()
{
$options = &$this->data['options'];

	function verify_options()
{
$options = &$this->data['options'];





		$this->verify_yesno_option($options, 'signature', 1);
$this->verify_yesno_option($options, 'savecopy', 1);
$this->verify_yesno_option($options, 'disablesmilies', 0);

		$this->verify_yesno_option($options, 'signature', 1);
$this->verify_yesno_option($options, 'savecopy', 1);
$this->verify_yesno_option($options, 'disablesmilies', 0);

Zeile 342Zeile 384
		if(isset($options['readreceipt']) && $options['readreceipt'] == 1)
{
$options['readreceipt'] = 1;

		if(isset($options['readreceipt']) && $options['readreceipt'] == 1)
{
$options['readreceipt'] = 1;

		}

		}

		else
{
$options['readreceipt'] = 0;
}
return true;

		else
{
$options['readreceipt'] = 0;
}
return true;

	}

	}


/**
* Validate an entire private message.


/**
* Validate an entire private message.

Zeile 358Zeile 400
	function validate_pm()
{
global $plugins;

	function validate_pm()
{
global $plugins;





		$pm = &$this->data;

// Verify all PM assets.

		$pm = &$this->data;

// Verify all PM assets.

Zeile 373Zeile 415
		$this->verify_options();

$plugins->run_hooks_by_ref("datahandler_pm_validate", $this);

		$this->verify_options();

$plugins->run_hooks_by_ref("datahandler_pm_validate", $this);





		// Choose the appropriate folder to save in.
if($pm['saveasdraft'])
{

		// Choose the appropriate folder to save in.
if($pm['saveasdraft'])
{

Zeile 497Zeile 539
			if($recipient['pmnotify'] == 1 && $recipient['lastactive'] > $lastpm['dateline'])
{
if($recipient['language'] != "" && $lang->language_exists($recipient['language']))

			if($recipient['pmnotify'] == 1 && $recipient['lastactive'] > $lastpm['dateline'])
{
if($recipient['language'] != "" && $lang->language_exists($recipient['language']))

				{

				{

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

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

				}

				}

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

				else
{
$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;

				}

				}

				else
{
$userlang = new MyLanguage;

				else
{
$userlang = new MyLanguage;

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);