26 protected $_aReqFields = array(
'rec_email',
'send_name',
'send_email',
'send_message',
'send_subject' );
73 if ( !$oConfig->getConfigParam(
"blInvitationsEnabled" ) ) {
93 if ( !$oConfig->getConfigParam(
"blInvitationsEnabled" ) ) {
99 if ( !is_array( $aParams ) || !$oUser ) {
104 $oParams = (object) $aParams;
112 if ( !$oCaptcha->pass( $sMac, $sMacHash ) ) {
114 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'MESSAGE_WRONG_VERIFICATION_CODE' );
121 foreach ( $this->_aReqFields as $sFieldName ) {
123 if ( $sFieldName ==
"rec_email" ) {
124 foreach ( $aParams[$sFieldName] as $sKey => $sEmail ) {
126 if ( empty( $sEmail ) ) {
127 unset( $aParams[$sFieldName][$sKey] );
132 if ( count( $aParams[$sFieldName] ) < 1 ) {
133 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_COMPLETE_FIELDS_CORRECTLY');
138 $oParams->rec_email = $aParams[$sFieldName];
141 if ( !isset( $aParams[$sFieldName] ) || !$aParams[$sFieldName] ) {
142 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_COMPLETE_FIELDS_CORRECTLY');
150 foreach ( $aParams[
"rec_email"] as $sRecipientEmail ) {
151 if ( !$oUtils->isValidEmail( $sRecipientEmail ) ) {
152 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_INVITE_INCORRECTEMAILADDRESS');
157 if ( !$oUtils->isValidEmail( $aParams[
"send_email"] ) ) {
158 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_INVITE_INCORRECTEMAILADDRESS');
163 $oEmail =
oxNew(
'oxemail' );
165 if ( $oEmail->sendInviteMail( $oParams ) ) {
166 $this->_iMailStatus = 1;
172 $oUser->updateInvitationStatistics( $aParams[
"rec_email"] );
174 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'ERROR_MESSAGE_CHECK_EMAIL');
186 if ( $this->_iMailStatus == 1 ) {
201 $this->_aInviteData = $oData;
221 if ( $this->_oCaptcha === null ) {
222 $this->_oCaptcha =
oxNew(
'oxCaptcha');
238 $aPath[
'link'] = $this->
getLink();