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

  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 3879 2008-06-01 15:48:47Z Tikitiki $

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

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 205Zeile 205
						// Check that this recipient actually exists
$query = $db->simple_select("users", "*", "uid='".intval($uid)."'");
$user = $db->fetch_array($query);

						// Check that this recipient actually exists
$query = $db->simple_select("users", "*", "uid='".intval($uid)."'");
$user = $db->fetch_array($query);

						if($recipient_type == "bcc")

						if($recipient_type == "bccid")

						{
$user['bcc'] = 1;
}

						{
$user['bcc'] = 1;
}

Zeile 225Zeile 225
		// If we have one or more invalid recipients and we're not saving a draft, error
if(count($invalid_recipients) > 0)
{

		// If we have one or more invalid recipients and we're not saving a draft, error
if(count($invalid_recipients) > 0)
{

			$invalid_recipients = implode(", ", $invalid_recipients);

			$invalid_recipients = implode(", ", array_map("htmlspecialchars_uni", $invalid_recipients));

			$this->set_error("invalid_recipients", array($invalid_recipients));
return false;
}

			$this->set_error("invalid_recipients", array($invalid_recipients));
return false;
}

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

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

				
// 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;
}

			}

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

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

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

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

Zeile 320Zeile 320
			if($user['bcc'] == 1)
{
$pm['recipients'][$user['uid']]['bcc'] = 1;

			if($user['bcc'] == 1)
{
$pm['recipients'][$user['uid']]['bcc'] = 1;

			}
}
return true;
}

			}
}
return true;
}


/**
* Verifies if the various 'options' for sending PMs are valid.


/**
* Verifies if the various 'options' for sending PMs are valid.

	 *

	 *

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

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

Zeile 354Zeile 354
	 * Validate an entire private message.
*
* @return boolean True when valid, false when invalid.

	 * Validate an entire private message.
*
* @return boolean True when valid, false when invalid.

	 */

	 */

	function validate_pm()
{
global $plugins;

	function validate_pm()
{
global $plugins;

Zeile 418Zeile 418
		// Assign data to common variable
$pm = &$this->data;


		// Assign data to common variable
$pm = &$this->data;


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


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


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

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

		}


		}


		$uid = 0;


		$uid = 0;


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


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

			$recipient_list = array();
}

			$recipient_list = array();
}

		else {


		else
{

			// Build recipient list
foreach($pm['recipients'] as $recipient)
{

			// Build recipient list
foreach($pm['recipients'] as $recipient)
{

Zeile 506Zeile 508
				{
$uselang = "english";
}

				{
$uselang = "english";
}

				if($uselang == $mybb->settings['bblanguage'])

				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 514Zeile 516
				else
{
$userlang = new MyLanguage;

				else
{
$userlang = new MyLanguage;

					$userlang->set_path("./inc/languages");

					$userlang->set_path(MYBB_ROOT."inc/languages");

					$userlang->set_language($uselang);
$userlang->load("messages");
$emailsubject = $userlang->emailsubject_newpm;

					$userlang->set_language($uselang);
$userlang->load("messages");
$emailsubject = $userlang->emailsubject_newpm;