// ############################### start do send to friend ############################### if ($_POST['do'] == 'dosendtofriend') { $vbulletin->input->clean_array_gpc('p', array('sendtoname' => TYPE_STR, 'sendtoemail' => TYPE_STR, 'emailsubject' => TYPE_STR, 'emailmessage' => TYPE_STR, 'username' => TYPE_STR, 'imagestamp' => TYPE_STR, 'imagehash' => TYPE_STR, 'humanverify' => TYPE_ARRAY)); // Values that are used in phrases or error messages $sendtoname =& $vbulletin->GPC['sendtoname']; $emailmessage =& $vbulletin->GPC['emailmessage']; $errors = array(); if ($sendtoname == '' or !is_valid_email($vbulletin->GPC['sendtoemail']) or $vbulletin->GPC['emailsubject'] == '' or $emailmessage == '') { $errors[] = fetch_error('requiredfields'); } if ($perform_floodcheck) { require_once DIR . '/includes/class_floodcheck.php'; $floodcheck = new vB_FloodCheck($vbulletin, 'user', 'emailstamp'); $floodcheck->commit_key($vbulletin->userinfo['userid'], TIMENOW, TIMENOW - $vbulletin->options['emailfloodtime']); if ($floodcheck->is_flooding()) { $errors[] = fetch_error('emailfloodcheck', $vbulletin->options['emailfloodtime'], $floodcheck->flood_wait()); } } if (fetch_require_hvcheck('contactus')) { require_once DIR . '/includes/class_humanverify.php'; $verify =& vB_HumanVerify::fetch_library($vbulletin); if (!$verify->verify_token($vbulletin->GPC['humanverify'])) { $errors[] = fetch_error($verify->fetch_error()); } } ($hook = vBulletinHook::fetch_hook('blog_dosendtofriend_start')) ? eval($hook) : false; if ($vbulletin->GPC['username'] != '') { if ($userinfo = $db->query_first_slave("\r\n\t\t\tSELECT user.*, userfield.*\r\n\t\t\tFROM " . TABLE_PREFIX . "user AS user," . TABLE_PREFIX . "userfield AS userfield\r\n\t\t\tWHERE username='******'username'])) . "'\r\n\t\t\t\tAND user.userid = userfield.userid")) { $errors[] = fetch_error('usernametaken', $vbulletin->GPC['username'], $vbulletin->session->vars['sessionurl']); } else { $postusername = htmlspecialchars_uni($vbulletin->GPC['username']);
} else { if ($vbulletin->GPC['message'] == '') { eval(standard_error(fetch_error('nomessage'))); } if ($perform_floodcheck) { require_once(DIR . '/includes/class_floodcheck.php'); $floodcheck = new vB_FloodCheck($vbulletin, 'user', 'emailstamp'); $floodcheck->commit_key($vbulletin->userinfo['userid'], TIMENOW, TIMENOW - $vbulletin->options['emailfloodtime']); if ($floodcheck->is_flooding()) { eval(standard_error(fetch_error('emailfloodcheck', $vbulletin->options['emailfloodtime'], $floodcheck->flood_wait()))); } } ($hook = vBulletinHook::fetch_hook('sendmessage_domailmember')) ? eval($hook) : false; $message = fetch_censored_text($vbulletin->GPC['message']); eval(fetch_email_phrases('usermessage', $userinfo['languageid'])); vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']); // parse this next line with eval: $sendtoname = $userinfo['username']; eval(print_standard_redirect('redirect_sentemail'));
/** * Performs atomic floodcheck * */ function perform_floodcheck_commit() { $flood_limit = ($this->registry->options['enableemail'] AND $this->registry->options['rpemail'] ? $this->registry->options['emailfloodtime'] : $this->registry->options['floodchecktime'] ); require_once(DIR . '/includes/class_floodcheck.php'); $floodcheck = new vB_FloodCheck($this->registry, 'user', 'emailstamp'); $floodcheck->commit_key($this->registry->userinfo['userid'], TIMENOW, TIMENOW - $flood_limit); if ($floodcheck->is_flooding()) { standard_error(fetch_error('report_post_floodcheck', $flood_limit, $floodcheck->flood_wait())); } }