30 protected $_aReqFields = array(
'rec_email',
'send_name',
'send_email',
'send_message',
'send_subject');
87 if (!$oConfig->getConfigParam(
"blInvitationsEnabled")) {
108 if (!$oConfig->getConfigParam(
"blInvitationsEnabled")) {
114 if (!is_array($aParams) || !$oUser) {
119 $oParams = (object) $aParams;
127 if (!$oCaptcha->pass($sMac, $sMacHash)) {
129 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'MESSAGE_WRONG_VERIFICATION_CODE');
137 foreach ($this->_aReqFields as $sFieldName) {
139 if ($sFieldName ==
"rec_email") {
140 foreach ($aParams[$sFieldName] as $sKey => $sEmail) {
142 if (empty($sEmail)) {
143 unset($aParams[$sFieldName][$sKey]);
148 if (count($aParams[$sFieldName]) < 1) {
149 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_COMPLETE_FIELDS_CORRECTLY');
155 $oParams->rec_email = $aParams[$sFieldName];
158 if (!isset($aParams[$sFieldName]) || !$aParams[$sFieldName]) {
159 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_COMPLETE_FIELDS_CORRECTLY');
168 foreach ($aParams[
"rec_email"] as $sRecipientEmail) {
169 if (!$oUtils->isValidEmail($sRecipientEmail)) {
170 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_INVITE_INCORRECTEMAILADDRESS');
176 if (!$oUtils->isValidEmail($aParams[
"send_email"])) {
177 $oUtilsView->addErrorToDisplay(
'ERROR_MESSAGE_INVITE_INCORRECTEMAILADDRESS');
183 $oEmail =
oxNew(
'oxemail');
185 if ($oEmail->sendInviteMail($oParams)) {
186 $this->_iMailStatus = 1;
192 $oUser->updateInvitationStatistics($aParams[
"rec_email"]);
194 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'ERROR_MESSAGE_CHECK_EMAIL');
206 if ($this->_iMailStatus == 1) {
220 $this->_aInviteData = $oData;
242 if ($this->_oCaptcha === null) {
243 $this->_oCaptcha =
oxNew(
'oxCaptcha');
260 $aPath[
'title'] =
oxRegistry::getLang()->translateString(
'INVITE_YOUR_FRIENDS', $iLang,
false);
261 $aPath[
'link'] = $this->
getLink();