Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Feedback on BotStop Plugin

peregrineperegrine MVP
edited June 2012 in Vanilla 2.0 - 2.8

nice little plugin.

did see this though

A typo in settings page -

Enter the second acceptable ansewr:

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Best Answers

  • Answer ✓

    Me and my typos... corrected and uploaded.. thanks for the spot!

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    Thanks very much to @brainache for the original add-on, and @peregrine for the additions.

    I've been getting plagued by bots recently, and this seems like just the ticket.

    Huzzah! (A word, I feel, that doesn't get out as much as it should.)

  • markcbainmarkcbain New
    Answer ✓

    Could I point out a typo on the registration screen: it says "Not bots allowed", when it should be "No bots allowed". Could you fix that? We're running a forum for, ahem, English teachers, so...

  • impuwatimpuwat New
    Answer ✓

    Peregrine,

    In /plugins/Botstop/locale/en-CA/definitions.php that you have listed above you have an error in line 3.

    $Definition['two'] = 'one';

«13

Answers

  • Answer ✓

    Me and my typos... corrected and uploaded.. thanks for the spot!

  • This is AWESOME , thank you @brainache . i have a private community-w/registration approval for 4000+ users and in the last month** have had to manually delete up to 30 bot reg. a day...since setting this up -not one! so e relieved..i added it to my custom theme > views> registrationapprovalphp file-
    thanks again
    **( prior to - never had a problem)

  • Glad its helping out!

  • Is this strong enough protection that I can turn off the recapcha & use this in place of it?

    Thanks

  • PamelaPamela ✭✭

    Great, we do not like image capcha :) and external service, many thank to you too @brainache

  • Heya, solid! However, First/Last Names is an integral addon to my site, and unfortunately they won't work together. Is it possible to adjust this addon to work in conjunction with FirstLastNames or other similar "additional registration info" plugins?

    Thanks!

  • Hi, and thank you for this plugin.
    How can I enable this plugin when somebody will start new discussion or reply post ?? ( I will use it for new users or guest posting)

  • I made a change for the plugin for my personal experimentation.

    This one will allow you to make changes in definitions file to change questions and answers just for internationalization and locale.

    This only works if you use Registration : Approval as your registration process.

    if you want it to work with others e.g. Basic Captcha - you can use the code I post to make your own mods.

    in class.BotStop.plugin.php

    replace the old function with this code:

        public function UserModel_BeforeRegister_Handler($Sender)
        {
            $test = $Sender->EventArguments['User']['BotCheck'];
            $a1 = C('Plugins.BotStop.Answer1');
            $a2 = C('Plugins.BotStop.Answer2');
    
               $randnumber = $Sender->EventArguments['User']['BotResult'];
    
           //  test for random question
             if ($randnumber != $test)
           // unrandomized answer one and two commented out 
           //  if ($test != $a1 && $test != $a2)
            {
            $Sender->Validation->AddValidationResult('BotCheck',T('Your humanity is suspect... Please try again.'));
            $Sender->EventArguments['Valid'] = FALSE;
            }
           // return FALSE;
        }
    

    /botstop/views/registerapproval.php

    <?php if (!defined('APPLICATION')) exit(); ?>
    <h1><?php echo T("Apply for Membership") ?></h1>
    <div class="Box">
       <?php
       $TermsOfServiceUrl = Gdn::Config('Garden.TermsOfService', '#');
       $TermsOfServiceText = sprintf(T('I agree to the <a id="TermsOfService" class="Popup" target="terms" href="%s">terms of service</a>'), Url($TermsOfServiceUrl));
    
       // Make sure to force this form to post to the correct place in case the view is
       // rendered within another view (ie. /dashboard/entry/index/):
       echo $this->Form->Open(array('Action' => Url('/entry/register'), 'id' => 'Form_User_Register'));
       echo $this->Form->Errors();
       ?>
       <ul>
          <li>
             <?php
                echo $this->Form->Label('Email', 'Email');
                echo $this->Form->TextBox('Email');
                    echo '<span id="EmailUnavailable" class="Incorrect" style="display: none;">'.T('Email Unavailable').'</span>';
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Username', 'Name');
                echo $this->Form->TextBox('Name');
                echo '<span id="NameUnavailable" class="Incorrect" style="display: none;">'.T('Name Unavailable').'</span>';
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Password', 'Password');
                echo $this->Form->Input('Password', 'password');
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Confirm Password', 'PasswordMatch');
                echo $this->Form->Input('PasswordMatch', 'password');
                echo '<span id="PasswordsDontMatch" class="Incorrect" style="display: none;">'.T("Passwords don't match").'</span>';
             ?>
          </li>
          <li class="Gender">
             <?php
                echo $this->Form->Label('Gender', 'Gender');
                echo $this->Form->RadioList('Gender', $this->GenderOptions, array('default' => 'm'))
             ?>
          </li>
            <li>
             <?php
                echo "<br><hr>".$this->Form->Label(T('Humanity Check...  Not bots allowed!'), '');
    $q = C('Plugins.BotStop.Question');
    
    
                       $num[1] = T("one");
                       $num[2] = T("two");
                       $num[3] = T("three");
                       $num[4] = T("four");
                       $num[5] = T("five");
                       $num[6] = T("six");
                       $num[7] = T("seven");
                       $num[8] = T("eight");
                       $num[9] = T("nine");
    
                       $frand = rand(1,9);
                       $srand = rand(1,9);
    
                       $frandname = $num[$frand];
                       $srandname = $num[$srand];
                       $operand = "and";
                     //  $operand = "times";
    
                       if ($operand == "and") 
                       $answer = $frand + $srand;
    
                       if ($operand == "times") 
                       $answer = $frand * $srand;
    
    
                    // show answer
                    //  echo "the answer is $answer";
    
    
    
    
                      echo $this->Form->Hidden('BotResult',array('value' => "$answer"));
    
                      $q = sprintf(T("How much is %1s %2s %3s?"),$frandname,$operand,$srandname);
    
    
                echo $this->Form->Label($q, 'BotCheck');
                echo $this->Form->TextBox('BotCheck');    
             ?> 
                </li>
          <li>
             <?php
                echo $this->Form->Label('Why do you want to join?', 'DiscoveryText');
                echo $this->Form->TextBox('DiscoveryText', array('MultiLine' => TRUE));
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->CheckBox('TermsOfService', $TermsOfServiceText, array('value' => '1'));
             ?>
          </li>
          <li class="Buttons">
             <?php echo $this->Form->Button('Apply for Membership'); ?>
          </li>
       </ul>
       <?php echo $this->Form->Close(); ?>
    </div>
    

    definitions.php placed in /plugins/Botstop/locale/en-CA/definitions.php

        <?php if (!defined('APPLICATION')) exit();
        $Definition['one'] = 'one';
        $Definition['two'] = 'one';
        $Definition['three'] = 'three';
        $Definition['four'] = 'four';
        $Definition['five'] = 'five';
        $Definition['six'] = 'six';
        $Definition['seven'] = 'seven';
        $Definition['eight'] = 'eight';
        $Definition['nine'] = 'nine';
        $Definition['Your humanity is suspect... Please try again.'] = "Your humanity is suspect... Please try again.";
        $Definition['How much is %1s %2s %3s?'] = 'How much is %1s %2s %3s?';
        $Definition['Humanity Check...  Not bots allowed!'] = "Humanity Check...  Not bots allowed!";
    

    the above code will give a different set of numbers to add each time.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    Thanks very much to @brainache for the original add-on, and @peregrine for the additions.

    I've been getting plagued by bots recently, and this seems like just the ticket.

    Huzzah! (A word, I feel, that doesn't get out as much as it should.)

  • markcbainmarkcbain New
    Answer ✓

    Could I point out a typo on the registration screen: it says "Not bots allowed", when it should be "No bots allowed". Could you fix that? We're running a forum for, ahem, English teachers, so...

  • To keep your english teachers from getting out the red pen - you could....

    change your definition in locale/en-Ca/definitions.php in the plugin to

    $Definition['Humanity Check... Not bots allowed!'] = "Humanity Check... No bots allowed!";

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    Went from 20+ a day bot registrations to 0 right after setting this up.

    It's reet champion!

  • I've been bombarded by spam bots in my registration lately. Hope this helps, just installed it.

  • It is not working for me. Please update your pluging. I got BONK : Something funky happened. Please bear with us while we iron out the kinks.

    Thanks

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @carlavoie

    read this thread, and also search for Bonk on this forum, to see how to get a detailed error report.

    The plugin works fine - so it's something you need to sort at your end.

  • This looks great, and while it appears to be working (it the fact its not throwing a bonk) at the start of my registration application page the first line of the php code from the class script is being echoed out !
    ?php if (!defined('APPLICATION')) exit(); ?>
    Minus the opening <
    Ive checked over the code and its verbatim to that above with the changes peregrine suggests
    Any ideas why this may be ?

    Cheers
    Jim

  • peregrineperegrine MVP
    edited October 2012

    I've cut and pasted it and it works for me.
    verify if the definitions.php, registerapproval.php, and
    class.BotStop.plugin.php

    all have

            <?php if (!defined('APPLICATION')) exit(); ?>
    

    or try starting over and cutting and pasting.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Ah clearly my checking was not up to scratch ! I had indeed missed the < when copy and pasting it seems. Thanks works great :)

  • impuwatimpuwat New
    Answer ✓

    Peregrine,

    In /plugins/Botstop/locale/en-CA/definitions.php that you have listed above you have an error in line 3.

    $Definition['two'] = 'one';

  • peregrineperegrine MVP
    edited November 2012

    @impuwat said:
    Peregrine,

    In /plugins/Botstop/locale/en-CA/definitions.php that you have listed above you have an error in line 3.

    $Definition['two'] = 'one';

    good spotting. let the record be corrected

    $Definition['two'] = 'two';

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.