Index: branches/RC/core/units/users/users_event_handler.php =================================================================== diff -u -N -r11538 -r11623 --- branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 11538) +++ branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 11623) @@ -739,14 +739,31 @@ if (preg_match('/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', $friend_email)) { - $send_params = array(); - $send_params['to_email']=$friend_email; - $send_params['to_name']=$friend_name; + /*$cutoff = adodb_mktime() + (int)$this->Application->ConfigValue('Suggest_MinInterval'); + $sql = 'SELECT * + FROM ' . TABLE_PREFIX . 'SuggestMail + WHERE email = ' . $this->Conn->qstr($friend_email) . ' AND sent < ' . $cutoff; + if ($this->Conn->GetRow($sql) !== false) { + $object->SetError('Email', 'send_error', 'lu_email_already_suggested'); + $event->status = erFAIL; + return ; + }*/ + $send_params = Array (); + $send_params['to_email'] = $friend_email; + $send_params['to_name'] = $friend_name; + $user_id = $this->Application->RecallVar('user_id'); $email_event =& $this->Application->EmailEventUser('USER.SUGGEST', $user_id, $send_params); if ($email_event->status == erSUCCESS){ + /*$fields_hash = Array ( + 'email' => $friend_email, + 'sent' => adodb_mktime(), + ); + + $this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'SuggestMail');*/ + $event->redirect_params = array('opener' => 's', 'pass' => 'all'); $event->redirect = $this->Application->GetVar('template_success'); }