Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Contact Member Functions
* Last Updated: $Date: 2009-04-14 03:01:20 -0400 (Tue, 14 Apr 2009) $
* Last Updated: $Date: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4453 $
* @version $Rev: 6925 $
*
*/
if ( ! defined( 'IN_IPB' ) )
@@ -93,7 +95,7 @@ class public_members_messaging_contact extends ipsCommand
break;
default:
$this->registry->output->showError( 'contact_what_action', 1034 );
$this->registry->output->showError( 'contact_what_action', 1034, null, null, 404 );
break;
}
@@ -104,7 +106,7 @@ class public_members_messaging_contact extends ipsCommand
}
/* Output */
$this->registry->output->setTitle( $this->page_title );
$this->registry->output->setTitle( $this->page_title . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
@@ -146,13 +148,13 @@ class public_members_messaging_contact extends ipsCommand
if( empty( $this->memberData['member_id'] ) )
{
ipsRegistry::getClass('output')->showError( 'members_only_mail', 10313 );
ipsRegistry::getClass('output')->showError( 'members_only_mail', 10313, null, null, 403 );
}
/* Check email permission */
if( ! $this->memberData['g_email_friend'] )
{
ipsRegistry::getClass('output')->showError( 'no_member_mail', 10314 );
ipsRegistry::getClass('output')->showError( 'no_member_mail', 10314, null, null, 403 );
}
if( $this->request['do'] == '01' )
@@ -181,7 +183,7 @@ class public_members_messaging_contact extends ipsCommand
if( ! $id )
{
$this->registry->output->showError( 'mail_member_no_mid', 10315 );
$this->registry->output->showError( 'mail_member_no_mid', 10315, null, null, 404 );
}
/* Query member information */
@@ -190,7 +192,7 @@ class public_members_messaging_contact extends ipsCommand
/* Make sure we have a valid user */
if( ! $member['member_id'] )
{
$this->registry->output->showError( 'mail_member_no_member', 10316 );
$this->registry->output->showError( 'mail_member_no_member', 10316, null, null, 404 );
}
/* Check email privacy */
@@ -254,7 +256,7 @@ class public_members_messaging_contact extends ipsCommand
if( $this->request['to'] == 0 )
{
$this->registry->output->showError( 'mail_member_no_mid', 10318 );
$this->registry->output->showError( 'mail_member_no_mid', 10318, null, null, 404 );
}
/* Query Member */
@@ -264,7 +266,7 @@ class public_members_messaging_contact extends ipsCommand
/* Check for schtuff */
if( ! $member['member_id'] )
{
$this->registry->output->showError( 'mail_member_no_member', 10319 );
$this->registry->output->showError( 'mail_member_no_member', 10319, null, null, 404 );
}
/* Check email privacy */
@@ -397,7 +399,7 @@ class public_members_messaging_contact extends ipsCommand
$this->DB->build( array(
'select' => 'count(email_id) as cnt',
'from' => 'email_logs',
'where' => "from_member_id=$member_id AND email_date > $time_range",
'where' => "from_member_id={$member_id} AND email_date > {$time_range}",
) );
$this->DB->execute();
@@ -406,12 +408,12 @@ class public_members_messaging_contact extends ipsCommand
if( $quota_sent['cnt'] + 1 > $limit )
{
$this->int_error = 'exceeded_quota';
$this->int_extra = limit;
$this->int_extra = $limit;
return FALSE;
}
}
return TRUE; //<{%dyn.down.var.md5p2%}> If we get here...
return TRUE;
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Define the default messaging section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*
*/
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,77 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Mark a private message as read
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
* </pre>
*
* @author Brandon Farber
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since Thurs 7th Jan 2010
* @version $Rev: 6596 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_messaging_markasread extends ipsCommand
{
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
$_ajax = intval($this->request['ajax']);
$topic = intval($this->request['topicID']);
if( !$topic )
{
$this->endReturn( $_ajax );
}
$_className = IPSLib::loadLibrary( IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
$_messenger = new $_className( $this->registry );
$_messenger->toggleReadStatus( $this->memberData['member_id'], array( $topic ), true );
$this->endReturn( $_ajax );
}
/**
* All done, return
*
* @access public
* @param int AJAX result
* @return void
*/
public function endReturn( $_ajax )
{
if( !$_ajax )
{
$_returnTo = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $this->settings['base_url'];
$this->registry->output->silentRedirect( $_returnTo );
}
else
{
print 'ok';
}
exit;
}
}
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Online list
* Last Updated: $Date: 2009-07-08 17:04:40 -0400 (Wed, 08 Jul 2009) $
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
* </pre>
*
* @author $Author: josh $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 12th March 2002
* @version $Revision: 4855 $
* @version $Revision: 6596 $
*
*/
@@ -73,22 +75,22 @@ class public_members_messaging_search extends ipsCommand
if ( ! $this->memberData['g_use_pm'] )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226, null, null, 403 );
}
if ( $this->memberData['members_disable_pm'] )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 403 );
}
if ( ! $this->memberData['member_id'] )
{
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10228 );
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10228, null, null, 403 );
}
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
}
//-----------------------------------------
@@ -102,8 +104,8 @@ class public_members_messaging_search extends ipsCommand
// Grab class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
$this->messengerFunctions = new messengerFunctions( $registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
$this->messengerFunctions = new $classToLoad( $registry );
/* Messenger Totals */
$totals = $this->messengerFunctions->buildMessageTotals();
@@ -125,7 +127,7 @@ class public_members_messaging_search extends ipsCommand
//-----------------------------------------
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('messaging')->messengerTemplate( $html, $this->messengerFunctions->_jumpMenu, $this->messengerFunctions->_dirData, $totals, $this->_topicParticipants, $this->_errorString ) );
$this->registry->output->setTitle( $this->_title );
$this->registry->output->setTitle( $this->_title . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation( $this->lang->words['messenger__nav'], 'app=members&amp;module=messaging' );
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Online list
* Last Updated: $Date: 2009-08-24 20:56:22 -0400 (Mon, 24 Aug 2009) $
* Last Updated: $Date: 2010-10-28 08:16:00 -0400 (Thu, 28 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 12th March 2002
* @version $Revision: 5041 $
* @version $Revision: 7061 $
*
*/
@@ -29,42 +31,42 @@ class public_members_messaging_send extends ipsCommand
/**
* Page title
*
* @access private
* @access protected
* @var string
*/
private $_title;
protected $_title;
/**
* Navigation
*
* @access private
* @access protected
* @var array[ 0 => [ title, url ] ]
*/
private $_navigation;
protected $_navigation;
/**
* Post Key
*
* @access private
* @access protected
* @var string Md5 key
*/
private $_postKey;
protected $_postKey;
/**
* Flag: Can we upload?
*
* @access private
* @access protected
* @var int 1 or 0
*/
private $_canUpload;
protected $_canUpload;
/**
* Error string
*
* @access private
* @access protected
* @var string
*/
private $_errorString = '';
protected $_errorString = '';
/**
* Class entry point
@@ -81,22 +83,22 @@ class public_members_messaging_send extends ipsCommand
if ( ! $this->memberData['g_use_pm'] )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10222 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10222, null, null, 403 );
}
if ( $this->memberData['members_disable_pm'] )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10223 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10223, null, null, 403 );
}
if ( ! $this->memberData['member_id'] )
{
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10224 );
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10224, null, null, 403 );
}
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
}
//-----------------------------------------
@@ -141,8 +143,8 @@ class public_members_messaging_send extends ipsCommand
// Grab class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
$this->messengerFunctions = new messengerFunctions( $registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
$this->messengerFunctions = new $classToLoad( $registry );
/* Messenger Totals */
$totals = $this->messengerFunctions->buildMessageTotals();
@@ -207,7 +209,7 @@ class public_members_messaging_send extends ipsCommand
//-----------------------------------------
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('messaging')->messengerTemplate( $html, $this->messengerFunctions->_jumpMenu, $this->messengerFunctions->_dirData, $totals, array(), $this->_errorString ) );
$this->registry->output->setTitle( $this->_title );
$this->registry->output->setTitle( $this->_title . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation( $this->lang->words['messenger__nav'], 'app=members&amp;module=messaging' );
@@ -225,10 +227,10 @@ class public_members_messaging_send extends ipsCommand
/**
* Deletes a reply
*
* @access private
* @access protected
* @return void
*/
private function _deleteReply()
protected function _deleteReply()
{
//-----------------------------------------
// INIT
@@ -244,7 +246,7 @@ class public_members_messaging_send extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -253,7 +255,7 @@ class public_members_messaging_send extends ipsCommand
if ( $this->messengerFunctions->canAccessTopic( $this->memberData['member_id'], $topicID ) !== TRUE )
{
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229 );
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
}
//-----------------------------------------
@@ -262,7 +264,7 @@ class public_members_messaging_send extends ipsCommand
if ( $this->messengerFunctions->deleteMessages( array( $msgID ), $this->memberData['member_id'] ) !== TRUE )
{
$this->registry->getClass('output')->showError( 'messenger_no_delete_permission', 10264 );
$this->registry->getClass('output')->showError( 'messenger_no_delete_permission', 10264, null, null, 403 );
}
//-----------------------------------------
@@ -275,10 +277,10 @@ class public_members_messaging_send extends ipsCommand
/**
* Sends a reply
*
* @access private
* @access protected
* @return mixed void, or HTML form
*/
private function _sendReply()
protected function _sendReply()
{
//-----------------------------------------
// INIT
@@ -299,7 +301,7 @@ class public_members_messaging_send extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -324,14 +326,14 @@ class public_members_messaging_send extends ipsCommand
{
$_msgString = $this->lang->words[ 'err_' . $msg ];
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
}
else
{
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
}
return $this->_showForm( 'reply', $_msgString );
}
@@ -345,10 +347,10 @@ class public_members_messaging_send extends ipsCommand
/**
* Sends a reply
*
* @access private
* @access protected
* @return mixed void, or HTML form
*/
private function _sendEdit()
protected function _sendEdit()
{
//-----------------------------------------
// INIT
@@ -370,7 +372,7 @@ class public_members_messaging_send extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -395,7 +397,7 @@ class public_members_messaging_send extends ipsCommand
{
$_msgString = $this->lang->words[ 'err_' . $msg ];
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
}
else
@@ -416,10 +418,10 @@ class public_members_messaging_send extends ipsCommand
/**
* Sends the PM
*
* @access private
* @access protected
* @return void, or HTML form
*/
private function _sendNewPersonalTopic()
protected function _sendNewPersonalTopic()
{
//-----------------------------------------
// INIT
@@ -457,14 +459,14 @@ class public_members_messaging_send extends ipsCommand
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->getClass('output')->_showNewTopicForm( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
}
if ( $sendToID AND $sendToName == "" )
if ( !$sendToID AND !$sendToName )
{
return $this->_showNewTopicForm( $this->lang->words['err_no_chosen_member'] );
}
//-----------------------------------------
// Invite Users
//-----------------------------------------
@@ -528,7 +530,7 @@ class public_members_messaging_send extends ipsCommand
{
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
}
return $this->_showNewTopicForm( $_msgString );
}
@@ -543,7 +545,7 @@ class public_members_messaging_send extends ipsCommand
}
else
{
$text = "Your message has been saved as a draft";
$text = $this->lang->words['saved_as_a_draft'];
}
$this->registry->getClass('output')->redirectScreen( $text , $this->settings['base_url'] . 'app=members&amp;module=messaging&amp;section=view&amp;do=inbox' );
@@ -552,12 +554,12 @@ class public_members_messaging_send extends ipsCommand
/**
* Show PM form
*
* @access private
* @access protected
* @param string Type of form (edit / reply)
* @param array Array of errors
* @param string Error message
* @return string returns HTML
*/
private function _showForm( $type, $errors='' )
protected function _showForm( $type, $errors='' )
{
//-----------------------------------------
// INIT
@@ -566,14 +568,14 @@ class public_members_messaging_send extends ipsCommand
$topicID = intval( $this->request['topicID'] );
$msgID = intval( $this->request['msgID'] );
$preview = isset( $this->request['previewReply'] ) ? 1 : 0;
$displayData = array( 'errors' => $errors,
$displayData = array( 'errors' => $errors ? array( $errors ) : array(),
'topicID' => $topicID,
'msgID' => $msgID,
'type' => $type,
'message' => '' );
$_POST['Post-NS'] = isset($_POST['msgContent']) ? $_POST['msgContent'] : '';
$_POST['msgContent'] = IPSText::removeMacrosFromInput( IPSText::raw2form( isset($_POST['msgContent']) ? $_POST['msgContent'] : '' ) );
$_POST['msgContent'] = IPSText::raw2form( isset($_POST['msgContent']) ? $_POST['msgContent'] : '' );
//-----------------------------------------
// Fetch topic Data
@@ -593,7 +595,7 @@ class public_members_messaging_send extends ipsCommand
if ( $this->messengerFunctions->canAccessTopic( $this->memberData['member_id'], $topicData, $topicParticipants ) !== TRUE )
{
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229 );
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
}
//-----------------------------------------
@@ -611,7 +613,7 @@ class public_members_messaging_send extends ipsCommand
/* We're quoting a post... */
if ( IPSText::getTextClass( 'editor' )->method == 'rte' )
{
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "' date='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($this->registry->getClass( 'class_localization')->getDate( $msgData['msg_date'], 'LONG', 1 ))."']<br />{$msgData['msg_post']}".'[/quote]'."<br /><br /><br />";
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']<br />{$msgData['msg_post']}".'[/quote]'."<br /><br /><br />";
}
else
{
@@ -623,7 +625,7 @@ class public_members_messaging_send extends ipsCommand
$msgData['msg_post'] = IPSText::getTextClass('bbcode')->preEditParse( $msgData['msg_post'] );
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "' date='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($this->registry->getClass( 'class_localization')->getDate( $msgData['msg_date'], 'LONG', 1 ))."']\n{$msgData['msg_post']}".'[/quote]'."\n\n\n";
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']\n{$msgData['msg_post']}".'[/quote]'."\n\n\n";
}
}
else if ( $type == 'edit' )
@@ -680,8 +682,8 @@ class public_members_messaging_send extends ipsCommand
// Grab render attach class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
$this->class_attach = new class_attach( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
}
//-----------------------------------------
@@ -701,7 +703,12 @@ class public_members_messaging_send extends ipsCommand
// Errors
//-----------------------------------------
if ( $errors OR ( IPSText::getTextClass('bbcode')->error != "" ) )
if( is_array($errors) AND count($errors) )
{
$preview = 1;
}
if ( IPSText::getTextClass('bbcode')->error != "" )
{
if ( IPSText::getTextClass('bbcode')->error )
{
@@ -726,7 +733,7 @@ class public_members_messaging_send extends ipsCommand
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
{
if ( count( $errors ) or $preview )
if ( $preview )
{
$displayData['message'] = stripslashes( $displayData['message'] );
}
@@ -734,8 +741,8 @@ class public_members_messaging_send extends ipsCommand
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
}
else if ( $displayData['message'] )
{
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
{
// Not needed as is handled in above $type == 'edit' block
}
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'msgContent' );
@@ -751,8 +758,8 @@ class public_members_messaging_send extends ipsCommand
// Load attachments so we get some stats
//-----------------------------------------
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
$class_attach = new class_attach( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$class_attach = new $classToLoad( $this->registry );
$class_attach->type = 'msg';
$class_attach->init();
$class_attach->getUploadFormSettings();
@@ -785,11 +792,11 @@ class public_members_messaging_send extends ipsCommand
/**
* Show PM form
*
* @access private
* @param array Array of errors
* @access protected
* @param string Error message
* @return string returns HTML
*/
private function _showNewTopicForm( $errors='' )
protected function _showNewTopicForm( $errors='' )
{
//-----------------------------------------
// INIT
@@ -812,16 +819,16 @@ class public_members_messaging_send extends ipsCommand
$topicID = intval($this->request['topicID']);
$preview = $this->request['preview'];
$inviteUsers = array();
$displayData = array( 'errors' => $errors,
$displayData = array( 'errors' => $errors ? array( $errors ) : array(),
'topicID' => $topicID,
'preview' => '',
'name' => '',
'title' => '',
'message' => '' );
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = IPSText::removeMacrosFromInput( IPSText::raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' ) );
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = IPSText::raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' );
//-----------------------------------------
// Preview post?
//-----------------------------------------
@@ -841,7 +848,15 @@ class public_members_messaging_send extends ipsCommand
$this->settings['max_emos'] = 0;
$old_msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
if( $this->request['_from'] == 'quickPM' )
{
$old_msg = $_POST['Post'];
}
else
{
$old_msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
}
$old_msg = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $old_msg ) );
if ( ! is_object( $this->class_attach ) )
@@ -850,8 +865,8 @@ class public_members_messaging_send extends ipsCommand
// Grab render attach class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
$this->class_attach = new class_attach( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
}
//-----------------------------------------
@@ -906,39 +921,58 @@ class public_members_messaging_send extends ipsCommand
if ( $preview )
{
$displayData['message'] = $_POST['Post-NS'];
if( $this->request['_from'] == 'quickPM' )
{
$displayData['message'] = IPSText::parseCleanValue( $displayData['message'], true );
}
$displayData['title'] = str_replace( "'", "&#39;", str_replace( '"', '&#34;', IPSText::stripslashes($_POST['msg_title']) ) );
}
//-----------------------------------------
// Sending as draft...
//-----------------------------------------
else if ( $topicID )
{
$draftTopic = $this->messengerFunctions->fetchTopicDataWithMessage( $topicID, TRUE );
if ( $draftTopic['mt_to_member_id'] )
/* Permission to view this? */
if ( $draftTopic['mt_starter_id'] == $this->memberData['member_id'] )
{
$displayData['name'] = $draftTopic['from_name'];
}
if ( $draftTopic['mt_title'] )
{
$_member = IPSMember::load( $draftTopic['mt_to_member_id'], 'core' );
$displayData['name'] = $_member['members_display_name'];
$displayData['title'] = $draftTopic['mt_title'];
$_msg_id = $draftTopic['msg_id'];
$this->_postKey = $draftTopic['msg_post_key'];
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $draftTopic['msg_post'] );
}
if ( $draftTopic['mt_to_member_id'] )
{
$displayData['name'] = $draftTopic['from_name'];
}
if ( $draftTopic['mt_title'] )
{
$_member = IPSMember::load( $draftTopic['mt_to_member_id'], 'core' );
$displayData['name'] = $_member['members_display_name'];
$displayData['title'] = $draftTopic['mt_title'];
$_msg_id = $draftTopic['msg_id'];
$this->_postKey = $draftTopic['msg_post_key'];
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
if ( IPSText::getTextClass('editor')->method == 'rte' )
{
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $draftTopic['msg_post'] );
}
else
{
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $draftTopic['msg_post'] );
}
}
}
}
//-----------------------------------------
// CC Boxes
//-----------------------------------------
@@ -981,31 +1015,18 @@ class public_members_messaging_send extends ipsCommand
// PM returns
//-----------------------------------------
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] AND $fromMsgID )
{
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( nl2br( $displayData['message'] ) );
}
else if( IPSText::getTextClass('editor')->method == 'std' AND $displayData['message'] AND $fromMsgID )
{
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $displayData['message'] );
}
//-----------------------------------------
// Is this RTE? If so, convert BBCode
//-----------------------------------------
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
{
if ( count( $errors ) or $preview )
{
$displayData['message'] = stripslashes( $displayData['message'] );
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
}
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
}
else if ( $displayData['message'] )
{
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $displayData['message'] );
}
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'Post' );
@@ -1021,8 +1042,8 @@ class public_members_messaging_send extends ipsCommand
// Load attachments so we get some stats
//-----------------------------------------
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
$class_attach = new class_attach( $this->registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$class_attach = new $classToLoad( $this->registry );
$class_attach->type = 'msg';
$class_attach->init();
$class_attach->getUploadFormSettings();
@@ -1035,7 +1056,7 @@ class public_members_messaging_send extends ipsCommand
$this->_title = $this->lang->words['sendMsgTitle'];
$this->_navigation[] = array( $this->lang->words['sendMsgTitle'], '' );
return $this->registry->getClass('output')->getTemplate('messaging')->sendNewPersonalTopicForm( $displayData );
}
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Online list
* Last Updated: $Date: 2009-08-31 20:32:10 -0400 (Mon, 31 Aug 2009) $
* Last Updated: $Date: 2010-09-14 05:48:02 -0400 (Tue, 14 Sep 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 12th March 2002
* @version $Revision: 5066 $
* @version $Revision: 6865 $
*
*/
@@ -89,22 +91,22 @@ class public_members_messaging_view extends ipsCommand
if ( ! $this->memberData['g_use_pm'] )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226, null, null, 403 );
}
if ( $this->memberData['members_disable_pm'] )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 403 );
}
if ( ! $this->memberData['member_id'] )
{
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10228 );
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10228, null, null, 403 );
}
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
}
//-----------------------------------------
@@ -119,8 +121,8 @@ class public_members_messaging_view extends ipsCommand
// Grab class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
$this->messengerFunctions = new messengerFunctions( $registry );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
$this->messengerFunctions = new $classToLoad( $registry );
/* Messenger Totals */
$this->_totals = $this->messengerFunctions->buildMessageTotals();
@@ -180,7 +182,7 @@ class public_members_messaging_view extends ipsCommand
//-----------------------------------------
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('messaging')->messengerTemplate( $html, $this->messengerFunctions->_jumpMenu, $this->messengerFunctions->_dirData, $this->_totals, $this->_topicParticipants, $this->_errorString, $this->_deletedTopic ) );
$this->registry->output->setTitle( $this->_title );
$this->registry->output->setTitle( $this->_title . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation( $this->lang->words['messenger__nav'], 'app=members&amp;module=messaging' );
@@ -217,7 +219,7 @@ class public_members_messaging_view extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -261,7 +263,7 @@ class public_members_messaging_view extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -305,7 +307,7 @@ class public_members_messaging_view extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -348,7 +350,7 @@ class public_members_messaging_view extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -394,7 +396,7 @@ class public_members_messaging_view extends ipsCommand
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
//-----------------------------------------
@@ -435,7 +437,7 @@ class public_members_messaging_view extends ipsCommand
{
$_msgString = $this->lang->words[ 'err_' . $msg ];
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
$_msgString = str_replace( '#TONAME#' , implode( ",", $inviteUsers), $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
}
else
@@ -452,10 +454,10 @@ class public_members_messaging_view extends ipsCommand
/**
* Redirects the user to the correct page in a conversation based on the incoming msg ID
*
* @access private
* @access protected
* @return string returns HTML
*/
private function _findMessage()
protected function _findMessage()
{
$msgID = ( $this->request['msgID'] == '__firstUnread__' ) ? '__firstUnread__' : intval( $this->request['msgID'] );
$topicID = intval( $this->request['topicID'] );
@@ -558,10 +560,16 @@ class public_members_messaging_view extends ipsCommand
if ( $method == 'delete' )
{
$this->messengerFunctions->deleteTopics( $this->memberData['member_id'], $ids );
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
$start = ( count( $ids ) >= $p_end ) ? $start-$p_end : $start;
}
else if ( $method == 'move' )
{
$this->messengerFunctions->moveTopics( $this->memberData['member_id'], $ids, $folderID );
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
$start = ( count( $ids ) >= $p_end ) ? $start-$p_end : $start;
}
else if ( $method == 'markread' OR $method == 'markunread' )
{
@@ -631,7 +639,7 @@ class public_members_messaging_view extends ipsCommand
if ( ! $topicID )
{
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10225 );
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10225, null, null, 404 );
}
//-----------------------------------------
@@ -648,11 +656,11 @@ class public_members_messaging_view extends ipsCommand
if ( $_msg == 'NO_READ_PERMISSION' )
{
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229 );
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
}
else if ( $_msg == 'YOU_ARE_BANNED' )
{
$this->registry->getClass('output')->showError( 'messenger_you_be_banned_yo', 99910229 );
$this->registry->getClass('output')->showError( 'messenger_you_be_banned_yo', 10275, null, null, 403 );
}
}