Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,419 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Contact Member Functions
|
||||
* 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.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6925 $
|
||||
*
|
||||
*/
|
||||
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_contact extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Temporary HTML output
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $output = "";
|
||||
|
||||
/**
|
||||
* Temporary navigation items
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $nav = array();
|
||||
|
||||
/**
|
||||
* Temporary page title
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $page_title = "";
|
||||
|
||||
/**
|
||||
* Error
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $int_error = "";
|
||||
|
||||
/**
|
||||
* Extra info
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $int_extra = "";
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case '01':
|
||||
case '00':
|
||||
case 'Mail':
|
||||
$this->mailMember();
|
||||
break;
|
||||
|
||||
case 'report':
|
||||
if( $this->request['send'] != 1 )
|
||||
{
|
||||
$this->reportPostForm();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->reportPostSend();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->registry->output->showError( 'contact_what_action', 1034, null, null, 404 );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Navigation */
|
||||
foreach( $this->nav as $nav )
|
||||
{
|
||||
$this->registry->output->addNavigation( $nav[0], $nav[1] );
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->setTitle( $this->page_title . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the report post form
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @deprecated Just redirects to report center now
|
||||
*/
|
||||
public function reportPostForm()
|
||||
{
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=reports&rcom=post&tid={$this->request['t']}&pid={$this->request['p']}&st={$this->request['st']}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the reported post
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @deprecated Just redirects to report center now
|
||||
*/
|
||||
public function reportPostSend()
|
||||
{
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=reports&rcom=post&tid={$this->request['t']}&pid={$this->request['p']}&st={$this->request['st']}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the routines called by clicking on the "email" button
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function mailMember()
|
||||
{
|
||||
/* Load Language */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_emails' ), 'core' );
|
||||
|
||||
if( empty( $this->memberData['member_id'] ) )
|
||||
{
|
||||
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, null, null, 403 );
|
||||
}
|
||||
|
||||
if( $this->request['do'] == '01' )
|
||||
{
|
||||
$this->mailMemberSend();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->mailMemberForm();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the form for mailing a member
|
||||
*
|
||||
* @access public
|
||||
* @param string Errors
|
||||
* @param string Extra data
|
||||
* @return void
|
||||
*/
|
||||
public function mailMemberForm( $errors="", $extra="" )
|
||||
{
|
||||
/* Check ID */
|
||||
$id = intval( $this->request['MID'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( 'mail_member_no_mid', 10315, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Query member information */
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
/* Make sure we have a valid user */
|
||||
if( ! $member['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'mail_member_no_member', 10316, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Check email privacy */
|
||||
if( $member['hide_email'] == 1 )
|
||||
{
|
||||
$this->registry->output->showError( 'mail_member_private', 10317 );
|
||||
}
|
||||
|
||||
/* Show errors */
|
||||
if ( $errors != "" )
|
||||
{
|
||||
$msg = $this->lang->words[$errors];
|
||||
|
||||
if ( $extra != "" )
|
||||
{
|
||||
$msg = sprintf( $msg, $extra );
|
||||
}
|
||||
|
||||
$this->output .= $this->registry->output->getTemplate('emails')->errors( $msg );
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->settings['use_mail_form']
|
||||
? $this->registry->output->getTemplate('emails')->sendMailForm(
|
||||
array(
|
||||
'NAME' => $member['members_display_name'],
|
||||
'TO' => $member['member_id'],
|
||||
'subject'=> $this->request['subject'],
|
||||
'content'=> stripslashes( htmlspecialchars( $_POST['message'] ) ),
|
||||
)
|
||||
)
|
||||
: $this->registry->output->getTemplate('emails')->show_address(
|
||||
array(
|
||||
'NAME' => $member['members_display_name'],
|
||||
'ADDRESS' => $member['email'],
|
||||
)
|
||||
);
|
||||
|
||||
$this->page_title = $this->lang->words['member_address_title'];
|
||||
$this->nav[] = array( $this->lang->words['member_address_title'], '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the email
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function mailMemberSend()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check form key first
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['k'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', 20313 );
|
||||
}
|
||||
|
||||
$this->request['to'] = intval( $this->request['to'] );
|
||||
|
||||
if( $this->request['to'] == 0 )
|
||||
{
|
||||
$this->registry->output->showError( 'mail_member_no_mid', 10318, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Query Member */
|
||||
$member = IPSMember::load( $this->request['to'] );
|
||||
|
||||
|
||||
/* Check for schtuff */
|
||||
if( ! $member['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'mail_member_no_member', 10319, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Check email privacy */
|
||||
if( $member['hide_email'] == 1 )
|
||||
{
|
||||
$this->registry->output->showError( 'mail_member_private', 10320, true );
|
||||
}
|
||||
|
||||
/* Check for blanks */
|
||||
$check_array = array (
|
||||
'message' => 'no_message',
|
||||
'subject' => 'no_subject'
|
||||
);
|
||||
|
||||
foreach( $check_array as $input => $msg )
|
||||
{
|
||||
if( empty( $this->request[$input] ) )
|
||||
{
|
||||
$this->request['MID'] = $this->request['to'];
|
||||
$this->mailMemberForm( $msg );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for spam / delays */
|
||||
$email_check = $this->_allowToMail( $this->memberData['member_id'], $this->memberData['g_email_limit'] );
|
||||
|
||||
if( $email_check != TRUE )
|
||||
{
|
||||
$this->request['MID'] = $this->request['to'];
|
||||
$this->mailMemberForm( $this->int_error, $this->int_extra );
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* No check for injected headers in the message
|
||||
* @link http://forums.invisionpower.com/index.php?app=tracker&showissue=13098
|
||||
*/
|
||||
if( preg_match("/(content-type:|content-transfer-encoding:|content-disposition:)/i", $this->request['message'] ) )
|
||||
{
|
||||
$this->registry->output->showError( 'bad_email_message', 5021, true );
|
||||
}
|
||||
|
||||
/* Send the email */
|
||||
IPSText::getTextClass( 'email' )->getTemplate( 'email_member' );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MESSAGE' => str_replace( "<br>", "\n", str_replace( "\r", "", $this->request['message'] ) ),
|
||||
'MEMBER_NAME' => $member['members_display_name'],
|
||||
'FROM_NAME' => $this->memberData['members_display_name']
|
||||
) );
|
||||
|
||||
IPSText::getTextClass( 'email' )->subject = $this->request['subject'];
|
||||
IPSText::getTextClass( 'email' )->to = $member['email'];
|
||||
IPSText::getTextClass( 'email' )->from = $this->memberData['email'];
|
||||
IPSText::getTextClass( 'email' )->sendMail();
|
||||
|
||||
/* Store email in the database */
|
||||
$this->DB->insert( 'email_logs', array(
|
||||
'email_subject' => $this->request['subject'],
|
||||
'email_content' => $this->request['message'],
|
||||
'email_date' => time(),
|
||||
'from_member_id' => $this->memberData['member_id'],
|
||||
'from_email_address' => $this->memberData['email'],
|
||||
'from_ip_address' => $this->member->ip_address,
|
||||
'to_member_id' => $member['member_id'],
|
||||
'to_email_address' => $member['email'],
|
||||
) );
|
||||
|
||||
$this->output = $this->registry->output->getTemplate('emails')->sentScreen( $member['members_display_name'] );
|
||||
|
||||
$this->page_title = $this->lang->words['email_sent'];
|
||||
$this->nav[] = array( $this->lang->words['email_sent'], '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Flood Limit
|
||||
*
|
||||
* @access private
|
||||
* @param integer $member_id
|
||||
* @param string $email_limit
|
||||
* @return bool
|
||||
**/
|
||||
private function _allowToMail( $member_id, $email_limit )
|
||||
{
|
||||
$member_id = intval( $member_id );
|
||||
|
||||
if( ! $member_id )
|
||||
{
|
||||
$this->int_error = 'gen_error';
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
list( $limit, $flood ) = explode( ':', $email_limit );
|
||||
|
||||
if ( ! $limit and ! $flood )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get some stuff from the DB!
|
||||
// 1) FLOOD?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $flood )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'email_logs',
|
||||
'where' => "from_member_id=$member_id",
|
||||
'order' => 'email_date DESC',
|
||||
'limit' => array( 0, 1 ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$last_email = $this->DB->fetch();
|
||||
|
||||
if( $last_email['email_date'] + ( $flood * 60 ) > time() )
|
||||
{
|
||||
$this->int_error = 'exceeded_flood';
|
||||
$this->int_extra = $flood;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if( $limit )
|
||||
{
|
||||
$time_range = time() - 86400;
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'count(email_id) as cnt',
|
||||
'from' => 'email_logs',
|
||||
'where' => "from_member_id={$member_id} AND email_date > {$time_range}",
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
$quota_sent = $this->DB->fetch();
|
||||
|
||||
if( $quota_sent['cnt'] + 1 > $limit )
|
||||
{
|
||||
$this->int_error = 'exceeded_quota';
|
||||
$this->int_extra = $limit;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default messaging section
|
||||
* 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.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'messaging' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'view';
|
||||
$DEFAULT_SECTION = 'view';
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Mark a private message as read
|
||||
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Thurs 7th Jan 2010
|
||||
* @version $Rev: 6596 $
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,9 +30,8 @@ class public_members_messaging_markasread extends ipsCommand
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -55,9 +54,8 @@ class public_members_messaging_markasread extends ipsCommand
|
||||
/**
|
||||
* All done, return
|
||||
*
|
||||
* @access public
|
||||
* @param int AJAX result
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function endReturn( $_ajax )
|
||||
{
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Online list
|
||||
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 6596 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -31,23 +31,20 @@ class public_members_messaging_search extends ipsCommand
|
||||
/**
|
||||
* Page title
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_title;
|
||||
protected $_title;
|
||||
|
||||
/**
|
||||
* Navigation entries
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $_navigation;
|
||||
protected $_navigation;
|
||||
|
||||
/**
|
||||
* Messenger library
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $messengerFunctions;
|
||||
@@ -55,7 +52,6 @@ class public_members_messaging_search extends ipsCommand
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
public $_errorString = '';
|
||||
@@ -63,9 +59,8 @@ class public_members_messaging_search extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -90,7 +85,7 @@ class public_members_messaging_search extends ipsCommand
|
||||
|
||||
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227.1, null, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -141,26 +136,23 @@ class public_members_messaging_search extends ipsCommand
|
||||
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Search. Do it.
|
||||
*
|
||||
* @access private
|
||||
* @param string Any error text
|
||||
* @return string returns HTML
|
||||
*/
|
||||
private function _search( $error='' )
|
||||
protected function _search( $error='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']);
|
||||
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
|
||||
$searchFor_TAINTED = IPSText::parseCleanValue( urldecode( $_REQUEST['searchFor'] ) );
|
||||
$searchIn = '';
|
||||
$start = intval($this->request['st']);
|
||||
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
|
||||
$searchFor_TAINTED = IPSText::parseCleanValue( urldecode( $_REQUEST['searchFor'] ) );
|
||||
$searchIn = '';
|
||||
|
||||
/* Got an error? */
|
||||
if ( $error )
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Online list
|
||||
* Last Updated: $Date: 2010-10-28 08:16:00 -0400 (Thu, 28 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 7061 $
|
||||
* @version $Revision: 9483 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Page title
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_title;
|
||||
@@ -39,7 +38,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Navigation
|
||||
*
|
||||
* @access protected
|
||||
* @var array[ 0 => [ title, url ] ]
|
||||
*/
|
||||
protected $_navigation;
|
||||
@@ -47,7 +45,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Post Key
|
||||
*
|
||||
* @access protected
|
||||
* @var string Md5 key
|
||||
*/
|
||||
protected $_postKey;
|
||||
@@ -55,7 +52,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Flag: Can we upload?
|
||||
*
|
||||
* @access protected
|
||||
* @var int 1 or 0
|
||||
*/
|
||||
protected $_canUpload;
|
||||
@@ -63,7 +59,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_errorString = '';
|
||||
@@ -71,9 +66,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -106,13 +100,12 @@ class public_members_messaging_send extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::resetTextClass('bbcode');
|
||||
IPSText::resetTextClass('editor');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang file
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_error", "public_editors" ), 'core' );
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_error" ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Post Key
|
||||
@@ -177,7 +170,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
@@ -227,8 +220,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Deletes a reply
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _deleteReply()
|
||||
{
|
||||
@@ -277,7 +269,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Sends a reply
|
||||
*
|
||||
* @access protected
|
||||
* @return mixed void, or HTML form
|
||||
*/
|
||||
protected function _sendReply()
|
||||
@@ -293,7 +284,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Error checking
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( IPSText::mbstrlen( trim( IPSText::br2nl( $_POST['msgContent'] ) ) ) < 2 )
|
||||
{
|
||||
return $this->_showForm( 'reply', $this->lang->words['err_no_msg'] );
|
||||
@@ -326,6 +317,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( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
}
|
||||
@@ -347,7 +339,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Sends a reply
|
||||
*
|
||||
* @access protected
|
||||
* @return mixed void, or HTML form
|
||||
*/
|
||||
protected function _sendEdit()
|
||||
@@ -397,6 +388,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( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
}
|
||||
@@ -418,8 +410,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Sends the PM
|
||||
*
|
||||
* @access protected
|
||||
* @return void, or HTML form
|
||||
* @return @e void, or HTML form
|
||||
*/
|
||||
protected function _sendNewPersonalTopic()
|
||||
{
|
||||
@@ -452,7 +443,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
return $this->_showNewTopicForm( $this->lang->words['err_no_title'] );
|
||||
}
|
||||
|
||||
if ( IPSText::mbstrlen( trim( IPSText::br2nl( $_POST['Post'] ) ) ) < 3 )
|
||||
if ( IPSText::mbstrlen( trim( IPSText::br2nl( $msgContent ) ) ) < 3 )
|
||||
{
|
||||
return $this->_showNewTopicForm( $this->lang->words['err_no_msg'] );
|
||||
}
|
||||
@@ -511,7 +502,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
|
||||
if ( strstr( $msg, 'BBCODE_' ) )
|
||||
{
|
||||
$msg = str_replace( 'BBCODE_', '', $msg );
|
||||
@@ -522,6 +513,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( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
$_msgString = str_replace( '#DATE#' , $this->messengerFunctions->exceptionData[0], $_msgString );
|
||||
@@ -533,7 +525,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
return $this->_showNewTopicForm( $_msgString );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Swap and serve...
|
||||
//-----------------------------------------
|
||||
@@ -554,7 +546,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Show PM form
|
||||
*
|
||||
* @access protected
|
||||
* @param string Type of form (edit / reply)
|
||||
* @param string Error message
|
||||
* @return string returns HTML
|
||||
@@ -598,6 +589,14 @@ class public_members_messaging_send extends ipsCommand
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load editor
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
$_editor->setAllowHtml( $this->memberData['g_dohtml'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a message ID?
|
||||
//-----------------------------------------
|
||||
@@ -611,45 +610,29 @@ class public_members_messaging_send extends ipsCommand
|
||||
if ( $type == 'reply' )
|
||||
{
|
||||
/* We're quoting a post... */
|
||||
if ( IPSText::getTextClass( 'editor' )->method == 'rte' )
|
||||
if ( $_editor->getRteEnabled() )
|
||||
{
|
||||
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']<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 />";
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
|
||||
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')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
|
||||
$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'] . "']\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";
|
||||
}
|
||||
}
|
||||
else if ( $type == 'edit' )
|
||||
{
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' )
|
||||
{
|
||||
IPSText::getTextClass('bbcode')->parse_wordwrap = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $msgData['msg_post'] );
|
||||
/* Reset post key */
|
||||
$this->_postKey = $msgData['msg_post_key'];
|
||||
|
||||
/* Reset post key */
|
||||
$this->_postKey = $msgData['msg_post_key'];
|
||||
}
|
||||
else
|
||||
{
|
||||
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( $msgData['msg_post'] );
|
||||
}
|
||||
$displayData['message'] = $msgData['msg_post'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -657,23 +640,23 @@ class public_members_messaging_send extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Previewing...
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( $preview )
|
||||
{
|
||||
/* Grab language for attachment previews */
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_topic" ), 'forums' );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
|
||||
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')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
|
||||
|
||||
$this->settings['max_emos'] = 0;
|
||||
|
||||
$msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
|
||||
$msg = $_editor->process( $_POST['Post-NS'] );
|
||||
$msg = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $msg ) );
|
||||
|
||||
if ( ! is_object( $this->class_attach ) )
|
||||
@@ -725,27 +708,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
if ( $preview )
|
||||
{
|
||||
$displayData['message'] = ( $displayData['message'] ) ? $displayData['message'] : $_POST['Post-NS'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this RTE? If so, convert BBCode
|
||||
//-----------------------------------------
|
||||
}
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
|
||||
{
|
||||
if ( $preview )
|
||||
{
|
||||
$displayData['message'] = stripslashes( $displayData['message'] );
|
||||
}
|
||||
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
|
||||
}
|
||||
else if ( $displayData['message'] )
|
||||
{
|
||||
// Not needed as is handled in above $type == 'edit' block
|
||||
}
|
||||
|
||||
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'msgContent' );
|
||||
$_editor->setContent( $displayData['message'] );
|
||||
$displayData['editor'] = $_editor->show( 'msgContent', array( 'height' => 350 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// More Data...
|
||||
@@ -792,7 +758,6 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Show PM form
|
||||
*
|
||||
* @access protected
|
||||
* @param string Error message
|
||||
* @return string returns HTML
|
||||
*/
|
||||
@@ -829,6 +794,14 @@ class public_members_messaging_send extends ipsCommand
|
||||
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
|
||||
$_POST['Post'] = IPSText::raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load editor
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
$_editor->setAllowHtml( $this->memberData['g_dohtml'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Preview post?
|
||||
//-----------------------------------------
|
||||
@@ -838,10 +811,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
/* Grab language for attachment previews */
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_topic" ), 'forums' );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
|
||||
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')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
|
||||
@@ -854,7 +827,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$old_msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
|
||||
$old_msg = $_editor->process( $_POST['Post'] );
|
||||
}
|
||||
|
||||
$old_msg = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $old_msg ) );
|
||||
@@ -955,13 +928,13 @@ class public_members_messaging_send extends ipsCommand
|
||||
$_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_html = $this->memberData['g_dohtml'];
|
||||
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')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' )
|
||||
if ( $_editor->getRteEnabled() )
|
||||
{
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $draftTopic['msg_post'] );
|
||||
}
|
||||
@@ -1004,32 +977,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove side panel
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass('editor')->remove_side_panel = 1;
|
||||
|
||||
//-----------------------------------------
|
||||
// PM returns
|
||||
//-----------------------------------------
|
||||
$_editor->setContent( $displayData['message'] );
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
|
||||
{
|
||||
if ( count( $errors ) or $preview )
|
||||
{
|
||||
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
|
||||
}
|
||||
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
|
||||
}
|
||||
else if ( $displayData['message'] )
|
||||
{
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $displayData['message'] );
|
||||
}
|
||||
|
||||
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'Post' );
|
||||
$displayData['editor'] = $_editor->show( 'Post', array( 'height' => 350 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// More Data...
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Online list
|
||||
* Last Updated: $Date: 2010-09-14 05:48:02 -0400 (Tue, 14 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-07-11 21:16:52 -0400 (Mon, 11 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 6865 $
|
||||
* @version $Revision: 9201 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -31,31 +31,27 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Page title
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_title;
|
||||
protected $_title;
|
||||
|
||||
/**
|
||||
* Navigation
|
||||
*
|
||||
* @access private
|
||||
* @var array[ 0 => [ title, url ] ]
|
||||
*/
|
||||
private $_navigation;
|
||||
protected $_navigation;
|
||||
|
||||
/**
|
||||
* Folder totals
|
||||
*
|
||||
* @access private
|
||||
* @var mixed
|
||||
*/
|
||||
private $_totals;
|
||||
protected $_totals;
|
||||
|
||||
/**
|
||||
* Contains topic participant data
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $_topicParticipants;
|
||||
@@ -63,7 +59,6 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Messenger library
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $messengerFunctions;
|
||||
@@ -71,7 +66,6 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $_errorString = '';
|
||||
@@ -79,9 +73,8 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -94,7 +87,7 @@ class public_members_messaging_view extends ipsCommand
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( $this->memberData['members_disable_pm'] )
|
||||
if ( $this->memberData['members_disable_pm'] == 2)
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 403 );
|
||||
}
|
||||
@@ -108,6 +101,9 @@ class public_members_messaging_view extends ipsCommand
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Print CSS */
|
||||
$this->registry->output->addToDocumentHead( 'raw', "<link rel='stylesheet' type='text/css' title='Main' media='print' href='{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_print.css' />" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Language
|
||||
@@ -133,6 +129,11 @@ class public_members_messaging_view extends ipsCommand
|
||||
$this->messengerFunctions->addFolderFilter( $this->request['folderFilter'] );
|
||||
}
|
||||
|
||||
/* force disabled messenger into default */
|
||||
if ( $this->memberData['members_disable_pm'] && $this->request['do'] != 'enableMessenger' )
|
||||
{
|
||||
$this->request['do'] = 'inbox';
|
||||
}
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
@@ -175,6 +176,12 @@ class public_members_messaging_view extends ipsCommand
|
||||
case 'toggleNotifications':
|
||||
$html = $this->_toggleNotifications();
|
||||
break;
|
||||
case 'enableMessenger':
|
||||
$this->_enableMessenger();
|
||||
break;
|
||||
case 'disableMessenger':
|
||||
$this->_disableMessenger();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -197,14 +204,56 @@ class public_members_messaging_view extends ipsCommand
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable messenger
|
||||
*/
|
||||
protected function _enableMessenger()
|
||||
{
|
||||
$authKey = $this->request['authKey'];
|
||||
|
||||
/* Auth key */
|
||||
if ( $this->request['authKey'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Toggle */
|
||||
if ( $this->memberData['members_disable_pm'] != 2 )
|
||||
{
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'members_disable_pm' => 0 ) ) );
|
||||
}
|
||||
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=members&module=messaging' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable messenger
|
||||
*/
|
||||
protected function _disableMessenger()
|
||||
{
|
||||
$authKey = $this->request['authKey'];
|
||||
|
||||
/* Auth key */
|
||||
if ( $this->request['authKey'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Toggle */
|
||||
if ( $this->memberData['members_disable_pm'] != 2 )
|
||||
{
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'members_disable_pm' => 1 ) ) );
|
||||
}
|
||||
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=members&module=messaging' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Block a participant
|
||||
*
|
||||
* @access private
|
||||
* @return mixed void, or HTML
|
||||
*/
|
||||
private function _toggleNotifications()
|
||||
protected function _toggleNotifications()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -244,10 +293,9 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Block a participant
|
||||
*
|
||||
* @access private
|
||||
* @return mixed void, or HTML
|
||||
*/
|
||||
private function _blockParticipant()
|
||||
protected function _blockParticipant()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -288,10 +336,9 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Leave a conversation (non topic starter)
|
||||
*
|
||||
* @access private
|
||||
* @return mixed void, or HTML
|
||||
*/
|
||||
private function _unblockParticipant()
|
||||
protected function _unblockParticipant()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -332,10 +379,9 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Leave a conversation (non topic starter)
|
||||
*
|
||||
* @access private
|
||||
* @return mixed void, or HTML
|
||||
*/
|
||||
private function _deleteConversation()
|
||||
protected function _deleteConversation()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -376,10 +422,9 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Deletes a reply
|
||||
*
|
||||
* @access private
|
||||
* @return mixed void, or HTML
|
||||
*/
|
||||
private function _addParticipants()
|
||||
protected function _addParticipants()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -439,6 +484,7 @@ class public_members_messaging_view extends ipsCommand
|
||||
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , implode( ",", $inviteUsers), $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
$_msgString = str_replace( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -454,7 +500,6 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Redirects the user to the correct page in a conversation based on the incoming msg ID
|
||||
*
|
||||
* @access protected
|
||||
* @return string returns HTML
|
||||
*/
|
||||
protected function _findMessage()
|
||||
@@ -512,10 +557,9 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Multi Files Messages
|
||||
*
|
||||
* @access private
|
||||
* @return string returns HTML
|
||||
*/
|
||||
private function _multiFile()
|
||||
protected function _multiFile()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -620,7 +664,6 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Show a message
|
||||
*
|
||||
* @access public
|
||||
* @return string returns HTML
|
||||
*/
|
||||
public function showConversation()
|
||||
@@ -668,7 +711,16 @@ class public_members_messaging_view extends ipsCommand
|
||||
// Add to the topic data...
|
||||
//-----------------------------------------
|
||||
|
||||
$conversationData['topicData']['_canReply'] = $this->messengerFunctions->canReplyTopic( $this->memberData['member_id'], $conversationData['topicData'], $conversationData['memberData'] );
|
||||
$conversationData['topicData']['_canReply'] = $this->messengerFunctions->canReplyTopic( $this->memberData['member_id'], $conversationData['topicData'], $conversationData['memberData'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check report permissions
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/reportLibrary.php', 'reportLibrary', 'core' );
|
||||
$reports = new $classToLoad( $this->registry );
|
||||
|
||||
$conversationData['topicData']['_canReport'] = $reports->canReport( 'messages' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pages
|
||||
@@ -677,6 +729,7 @@ class public_members_messaging_view extends ipsCommand
|
||||
$conversationData['topicData']['_pages'] = $this->registry->output->generatePagination( array( 'totalItems' => $conversationData['topicData']['mt_replies'] + 1,
|
||||
'itemsPerPage' => $end,
|
||||
'currentStartValue' => $start,
|
||||
'showNumbers' => false,
|
||||
'baseUrl' => "app=members&module=messaging&section=view&do=showConversation&topicID=".$topicID."&sort=".$this->request['sort'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -704,11 +757,10 @@ class public_members_messaging_view extends ipsCommand
|
||||
/**
|
||||
* Show the folder list
|
||||
*
|
||||
* @access private
|
||||
* @param string Any error text
|
||||
* @return string returns HTML
|
||||
*/
|
||||
private function _showFolder( $error='' )
|
||||
protected function _showFolder( $error='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -761,6 +813,7 @@ class public_members_messaging_view extends ipsCommand
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $totalMsg,
|
||||
'itemsPerPage' => $p_end,
|
||||
'currentStartValue' => $start,
|
||||
'showNumbers' => false,
|
||||
'baseUrl' => $_baseURL ) );
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
Reference in new issue
Block a user