HomeHelpTrac

Changeset 15824 for tags


Ignore:
Timestamp:
01/04/12 06:24:16 (5 months ago)
Author:
Alexander Trofimov
Message:

Ticket #2709

Location:
tags/7.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/7.0/inc/classes/BxDolMailBox.php

    r15200 r15824  
    787787           * @return         : signaling information with Html ; 
    788788           */ 
    789           function sendMessage( $sMessageSubject, $sMessageBody, $vRecipientID, &$aComposeSettings ) 
     789          function sendMessage( $sMessageSubject, $sMessageBody, $vRecipientID, &$aComposeSettings, $isSimulateSending = false ) 
    790790          { 
    791791               $sMessageSubject = process_db_input($sMessageSubject, BX_TAGS_STRIP); 
     
    795795               $sCopyMessage = $GLOBALS['MySQL']->unescape ($sMessageBody); 
    796796 
    797                if(!$sMessageSubject || !$sMessageBody) { 
     797               if(!$isSimulateSending && (!$sMessageSubject || !$sMessageBody)) { 
    798798                    $this -> iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED; 
    799799                    return MsgBox( _t('_please_fill_next_fields_first') ); 
     
    874874 
    875875                // chek membership level; 
    876                 if(!$this -> isSendMessageAlowed($this -> aMailBoxSettings['member_id'], true) ) { 
     876                if(!$this -> isSendMessageAlowed($this -> aMailBoxSettings['member_id'], $isSimulateSending ? false : true) ) { 
    877877                    $sReturnMessage = MsgBox( _t('_FAILED_TO_SEND_MESSAGE_MEMBERSHIP_DISALLOW') ); 
    878878                    $this -> iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED_MEMBERSHIP_DISALLOW; 
     
    881881 
    882882                // ** allow to send message ; 
    883                 if ( $bAllowToSend ) 
     883                if ( !$isSimulateSending && $bAllowToSend ) 
    884884                { 
    885885                    $sQuery =  
  • tags/7.0/templates/base/scripts/BxBaseMailBox.php

    r15333 r15824  
    104104                ? getProfileInfo($this -> aMailBoxSettings['recipient_id'])  
    105105                : null; 
     106 
     107            // check if send message is allowed 
     108            $aComposeSettings = array(); 
     109            $sErrMsg = $this->sendMessage('', '', $aMemberInfo ? $aMemberInfo['ID'] : 0, $aComposeSettings, true); 
     110            if ($sErrMsg) 
     111                return $sErrMsg; 
    106112 
    107113            $aLanguageKeys     = array 
     
    14911497            $iRecipientID = (int) $iRecipientID; 
    14921498 
     1499            // check if send message is allowed 
     1500            $aComposeSettings = array(); 
     1501            $sErrMsg = $this->sendMessage('', '', $iRecipientID, $aComposeSettings, true); 
     1502            if ($sErrMsg) 
     1503                return $sErrMsg; 
     1504 
    14931505            // init some needed variables ; 
    14941506            $sOutputHtml     = ''; 
Note: See TracChangeset for help on using the changeset viewer.