Esempio n. 1
0
if ($mybb->input['action'] == "do_newreply" && $mybb->request_method == "post") {
    // Verify incoming POST request
    verify_post_check($mybb->get_input('my_post_key'));
    $plugins->run_hooks("newreply_do_newreply_start");
    // If this isn't a logged in user, then we need to do some special validation.
    if ($mybb->user['uid'] == 0) {
        // If they didn't specify a username then give them "Guest"
        if (!$mybb->get_input('username')) {
            $username = $lang->guest;
        } else {
            $username = $mybb->get_input('username');
        }
        $uid = 0;
        if ($mybb->settings['stopforumspam_on_newreply']) {
            require_once MYBB_ROOT . '/inc/class_stopforumspamchecker.php';
            $stop_forum_spam_checker = new StopForumSpamChecker($plugins, $mybb->settings['stopforumspam_min_weighting_before_spam'], $mybb->settings['stopforumspam_check_usernames'], $mybb->settings['stopforumspam_check_emails'], $mybb->settings['stopforumspam_check_ips'], $mybb->settings['stopforumspam_log_blocks']);
            try {
                if ($stop_forum_spam_checker->is_user_a_spammer($mybb->get_input('username'), '', get_ip())) {
                    error($lang->sprintf($lang->error_stop_forum_spam_spammer, $stop_forum_spam_checker->getErrorText(array('stopforumspam_check_usernames', 'stopforumspam_check_ips'))));
                }
            } catch (Exception $e) {
                if ($mybb->settings['stopforumspam_block_on_error']) {
                    error($lang->error_stop_forum_spam_fetching);
                }
            }
        }
    } else {
        $username = $mybb->user['username'];
        $uid = $mybb->user['uid'];
    }
    // Attempt to see if this post is a duplicate or not
Esempio n. 2
0
 // Set the data for the new user.
 $user = array("username" => $mybb->get_input('username'), "password" => $mybb->get_input('password'), "password2" => $mybb->get_input('password2'), "email" => $mybb->get_input('email'), "email2" => $mybb->get_input('email2'), "usergroup" => $usergroup, "referrer" => $mybb->get_input('referrername'), "timezone" => $mybb->get_input('timezoneoffset'), "language" => $mybb->get_input('language'), "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY), "regip" => $session->packedip, "coppa_user" => $coppauser, "regcheck1" => $mybb->get_input('regcheck1'), "regcheck2" => $mybb->get_input('regcheck2'), "registration" => true);
 // Do we have a saved COPPA DOB?
 if (isset($mybb->cookies['coppadob'])) {
     list($dob_day, $dob_month, $dob_year) = explode("-", $mybb->cookies['coppadob']);
     $user['birthday'] = array("day" => $dob_day, "month" => $dob_month, "year" => $dob_year);
 }
 $user['options'] = array("allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT), "hideemail" => $mybb->get_input('hideemail', MyBB::INPUT_INT), "subscriptionmethod" => $mybb->get_input('subscriptionmethod', MyBB::INPUT_INT), "receivepms" => $mybb->get_input('receivepms', MyBB::INPUT_INT), "pmnotice" => $mybb->get_input('pmnotice', MyBB::INPUT_INT), "pmnotify" => $mybb->get_input('pmnotify', MyBB::INPUT_INT), "invisible" => $mybb->get_input('invisible', MyBB::INPUT_INT), "dstcorrection" => $mybb->get_input('dstcorrection'));
 $userhandler->set_data($user);
 $errors = "";
 if (!$userhandler->validate_user()) {
     $errors = $userhandler->get_friendly_errors();
 }
 if ($mybb->settings['enablestopforumspam_on_register']) {
     require_once MYBB_ROOT . '/inc/class_stopforumspamchecker.php';
     $stop_forum_spam_checker = new StopForumSpamChecker($plugins, $mybb->settings['stopforumspam_min_weighting_before_spam'], $mybb->settings['stopforumspam_check_usernames'], $mybb->settings['stopforumspam_check_emails'], $mybb->settings['stopforumspam_check_ips'], $mybb->settings['stopforumspam_log_blocks']);
     try {
         if ($stop_forum_spam_checker->is_user_a_spammer($user['username'], $user['email'], get_ip())) {
             error($lang->sprintf($lang->error_stop_forum_spam_spammer, $stop_forum_spam_checker->getErrorText(array('stopforumspam_check_usernames', 'stopforumspam_check_emails', 'stopforumspam_check_ips'))));
         }
     } catch (Exception $e) {
         if ($mybb->settings['stopforumspam_block_on_error']) {
             error($lang->error_stop_forum_spam_fetching);
         }
     }
 }
 if ($mybb->settings['captchaimage']) {
     require_once MYBB_ROOT . 'inc/class_captcha.php';
     $captcha = new captcha();
     if ($captcha->validate_captcha() == false) {
         // CAPTCHA validation failed
Esempio n. 3
0
         $errors[] = $lang->contact_no_email;
     }
 }
 // Should we have a CAPTCHA? Perhaps yes, but only for guests like in other pages...
 if ($mybb->settings['captchaimage'] && !$mybb->user['uid']) {
     $captcha = new captcha();
     if ($captcha->validate_captcha() == false) {
         // CAPTCHA validation failed
         foreach ($captcha->get_errors() as $error) {
             $errors[] = $error;
         }
     }
 }
 if (!$mybb->user['uid'] && $mybb->settings['stopforumspam_on_contact']) {
     require_once MYBB_ROOT . '/inc/class_stopforumspamchecker.php';
     $stop_forum_spam_checker = new StopForumSpamChecker($plugins, $mybb->settings['stopforumspam_min_weighting_before_spam'], $mybb->settings['stopforumspam_check_usernames'], $mybb->settings['stopforumspam_check_emails'], $mybb->settings['stopforumspam_check_ips'], $mybb->settings['stopforumspam_log_blocks']);
     try {
         if ($stop_forum_spam_checker->is_user_a_spammer('', $mybb->input['email'], get_ip())) {
             $errors[] = $lang->sprintf($lang->error_stop_forum_spam_spammer, $stop_forum_spam_checker->getErrorText(array('stopforumspam_check_emails', 'stopforumspam_check_ips')));
         }
     } catch (Exception $e) {
         if ($mybb->settings['stopforumspam_block_on_error']) {
             $errors[] = $lang->error_stop_forum_spam_fetching;
         }
     }
 }
 if (empty($errors)) {
     if ($mybb->settings['contact_badwords'] == 1) {
         // Load the post parser
         require_once MYBB_ROOT . "inc/class_parser.php";
         $parser = new postParser();