30 protected $_aReqFields = array(
'rec_email',
'send_name',
'send_email',
'send_message',
'send_subject');
83 if (!$oConfig->getConfigParam(
"blInvitationsEnabled")) {
104 if (!$oConfig->getConfigParam(
"blInvitationsEnabled")) {
110 if (!is_array($aParams) || !$oUser) {
115 $oParams = (object) $aParams;
123 if (!$oCaptcha->pass($sMac, $sMacHash)) {
125 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'MESSAGE_WRONG_VERIFICATION_CODE');
133 foreach ($this->_aReqFields as $sFieldName) {
135 if ($sFieldName ==
"rec_email") {
136 foreach ($aParams[$sFieldName] as $sKey => $sEmail) {
138 if (empty($sEmail)) {
139 unset($aParams[$sFieldName][$sKey]);
144 if (count($aParams[$sFieldName]) < 1) {
145 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_COMPLETE_FIELDS_CORRECTLY');
151 $oParams->rec_email = $aParams[$sFieldName];
154 if (!isset($aParams[$sFieldName]) || !$aParams[$sFieldName]) {
155 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_COMPLETE_FIELDS_CORRECTLY');
164 foreach ($aParams[
"rec_email"] as $sRecipientEmail) {
165 if (!$oUtils->isValidEmail($sRecipientEmail)) {
166 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_INVITE_INCORRECTEMAILADDRESS');
172 if (!$oUtils->isValidEmail($aParams[
"send_email"])) {
173 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_INVITE_INCORRECTEMAILADDRESS');
179 $oEmail =
oxNew(
'oxemail');
181 if ($oEmail->sendInviteMail($oParams)) {
182 $this->_iMailStatus = 1;
188 $oUser->updateInvitationStatistics($aParams[
"rec_email"]);
190 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'ERROR_MESSAGE_CHECK_EMAIL');
202 if ($this->_iMailStatus == 1) {
216 $this->_aInviteData = $oData;
236 if ($this->_oCaptcha === null) {
237 $this->_oCaptcha =
oxNew(
'oxCaptcha');
254 $aPath[
'title'] =
oxRegistry::getLang()->translateString(
'INVITE_YOUR_FRIENDS', $iLang,
false);
255 $aPath[
'link'] = $this->
getLink();