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.

Is there an addon for email verification (second email field) during registration?

ProsperProsper ✭✭
edited November 2015 in Vanilla 2.0 - 2.8

Is there an addon that can be used to add another email cfield for entering email during registration. The addon will help to eliminate typo on entered email during registration and should prompt email do not match if two emails entered are different. This will force potential forum member to check and correct wrong email before registration. This addon will help to reduce the number of unverified emails.

Best Answer

«1

Answers

  • peregrineperegrine MVP
    edited November 2015

    no. there is no addon. But you could add a second field in a plugin and test whether the two were equal to validate. Probably wouldn't be too hard for someone to write.

    you could use

            public function EntryController_RegisterBeforePassword_Handler($Sender) {  
    
    
                      // add a form option
        }
    

    and then validate in

            public function EntryController_RegisterValidation_Handler($Sender) {
    
           // determine if two entered inputs for fields email and email1 are equal.
           }
    

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

  • @peregrine - thank you for your reply. I don't have much idea about writing addons. I hope someone writes the addon.

  • peregrineperegrine MVP
    edited November 2015

    you could also mimic the passwords don't match info message with the email by cloning the passwordmatch function with some js added.

    // Check to see if emails match
    $('input[name$=EmailMatch]').blur(function() {
       if ($('#Register input[name$=Email], body.register input[name$=Email]').val() == $(this).val())
          $('#EmailsDontMatch').hide();
       else
          $('#EmailsDontMatch').show();
    });
    

    public function EntryController_RegisterBeforePassword_Handler($Sender) {  
    
              echo '<li class="confirmemail">'; 
                    echo $Sender->Form->label('Confirm Email', 'EmailMatch');
                    echo $Sender->Form->Input('EmailMatch', 'email', array('Wrap' => TRUE, 'class'=>"InputBox"));
                    echo '<span id="EmailsDontMatch" class="Incorrect" style="display: none;">'.t("Emails don't match").'</span>';
               echo "</li>";  
    
    
    }
    

    You would have to move the fields around with css or js.

    or add an event after the confirm email if you want the second email below the first email.

    you could also change the view but generally people forget about old views when upgrading and you can easily lose sight of a security fix that might affect the view, which is why I would not recommend changing view.

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

  • ProsperProsper ✭✭
    edited November 2015

    @peregrine - I created a folder named EmailVerify, added a file named default.php. I added another folder inside the first folder named js with file EmailVerify.js inside. After enabling the plugin I was able to replicate as shown on your screenshot. However, when I tried to register with two email addresses, the registration goes through without showing red warning "Emails don't match". Please want am I doing wrong?
    I will also want the "confirm email" field directly under the first email field. Please can you further assist?

  • peregrineperegrine MVP
    edited November 2015

    attach a zip of your plugin and I bet someone can assist you.

    I haven't tested any code. just wanted to provide some ideas on how to go about things.

    you would probably also need to add validation.

    public function EntryController_RegisterValidation_Handler($Sender) {
               // determine if two entered inputs for fields email and email1 are equal.
    
               }
    

    as far as the placement of form input you could do it via jquery instead.

    e.g.

    http://api.jquery.com/append/
    http://api.jquery.com/prepend/
    http://api.jquery.com/before/
    http://api.jquery.com/after/

    I know someone will suggest overriding view for form placement. I'd avoid if I could.
    the other thing you could do is make a feature request to add a new event after the username field so you could trigger off of that.

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

  • @Prosper said:
    ...when I tried to register with two email addresses, the registration goes through without showing red warning "Emails don't match". Please want am I doing wrong?

    You need to add server side validation. The JS stuff is all executed on the client and is important for a great user experience. However, you need to also validate on the server side and spit out an error if the two fields don't match.

    Something like this will get you started:

    public function entryController_registrationValidation_handler($sender) {
        $sender->UserModel->Validation->ApplyRule('Email', 'Match', 'The entered emails do not match');
    }
    

    This assumes the original field is called Email and the match field is called EmailMatch.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight - @peregrine - Thank you all for your assistance.
    I have attached the zip of the plugin. I can't make the plugin work and I need to place the confirm email field directly below default email field. Modification and debugging of the addon/plugin will be appreciated.

  • peregrineperegrine MVP
    edited November 2015

    @Prosper
    this may work.

    added the js via the default.php
    changed validation.
    fixed the js
    kluged the repositioning of email and user via js.

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

  • ProsperProsper ✭✭
    edited November 2015

    Thank you @peregrine.
    I tested the modified addon but when I clicked on "sign up" button, I got the message "Whoops! View not found". I guess there is a little more thing to be fixed.

  • peregrineperegrine MVP
    edited November 2015

    @Prosper said:
    Thank you @peregrine.
    I tested the modified addon but when I clicked on "sign up" button, I got the message "Whoops! View not found". I guess there is a little more thing to be fixed.

    you're welcome.

    yes if you get a view not found, then you indeed do have a problem. Unfortunately I don't believe the plugin I provided creates the problem, since it doesn't modify views anywhere. that is another reason why I don't modify views. perhaps you are using another plugin that modifies the view.

    Here is a new version, it won't fix views not found (because the plugin does not modify views), however, the new version has cleaner js and error messages, etc.

    in any event - I tested it in vanilla 2.1.13.p1 and it works perfectly fine for me. (tested with approval registration).

    I suggest you disable all other plugins, test with bittersweet theme and try the attached plugin. I would be surprised if you get a view not found.

    some basic troubleshooting hints here.

    http://vanillaforums.org/discussion/comment/233540/#Comment_233540

    I can't help you beyond that, since as far as my testing the plugin works and the limitations of my setup prevent me from going to your site easily.. -

    perhaps, you can look for duplicate or bad plugins and remove them.

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

  • ProsperProsper ✭✭
    edited November 2015

    Thanks @peregrine
    Forum runs on version 2.1.13p1.
    Registration runs through without "Whoops! View not found" message when EmailVerify addon is disabled.
    I will disable addons as you advised and find out which addon caused the "Whoops! View not found" message when submit button is clicked.

  • @peregrine - I have been testing with NoCaptcha user registration setting. Did you test EmailVerify with NoCaptcha user registration setting? Does it make a difference?

  • peregrineperegrine MVP
    edited November 2015

    @Prosper said:
    @peregrine - I have been testing with NoCaptcha user registration setting.

    Did you test EmailVerify with NoCaptcha user registration setting?

    No, I am unable to use that. I test off-line. I tested with straight vanilla themes, approval registration, and no other plugins.

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

  • ProsperProsper ✭✭
    edited November 2015

    @peregrine - I changed from NoCaptcha user registration setting to Approval user registration setting, and just found out EmailVerify worked. However, when user registration setting is on NoCaptcha, EmailVerify shows "Whoops! View not found" message when submit button is clicked. Does it mean that the addon EmailVerify needs more modification to work on user registration setting - NoCaptcha?

  • peregrineperegrine MVP
    edited November 2015

    I don't use the other NoCaptcha plugin, and I can't test it. perhaps someone else with the ability to test both plugins can help you.

    sorry, best I can do is provide you with a plugin that works on its own doing exactly what you requested.

    Does NoCaptcha works on its own, if not that could be the issue, or else the two plugins when together collide.

    did you test with just plain Captcha registration that comes with Vanilla without the NoCaptcha plugin.

    or you can also try using the AddRegistration Question plugin and the EmailVerify plugin.

    I noticed NoCaptcha plugin sets the view - perhaps that could be something to look at.

    neither of my plugins set the view.

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

  • peregrineperegrine MVP
    edited November 2015

    @Prosper

    see my comment above, also in the js add a $ in Emailverify.js

    it won't fix your view issue with other plugin but it is better practice IMHO

    change

    jQuery(document).ready(function(){

    to

    jQuery(document).ready(function($){

    it's better practice in my opinion.

    as well as a careful read of this:

    http://vanillaforums.org/discussion/30546/no-captcha-recaptcha-0-1-6b-breaks-registration-of-v-2-2

    maybe you can get some insights from x00 if you ask question regarding plugin.

    perhaps ask a question here:

    http://vanillaforums.org/addon/1443/no-captcha-recaptcha

    My bias is towards these 2 plugins with approval registration and no confirmation by email.

    http://vanillaforums.org/addon/addregistrationquestion-plugin

    • To filter, log, and restrict registration attempts, use the

    http://vanillaforums.org/addon/registrationrestrictlogger-plugin

    you can also use applicant approval registration method.

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

  • peregrineperegrine MVP
    edited November 2015

    Google's No CAPTCHA reCAPTCHA) has been around about a year now.

    perhaps it will be a non- issue if and when this is committed to vanilla core replacing old Captcha

    or if it will be sprinted (not sure what sprinted means but it sounds fast).

    https://github.com/vanilla/vanilla/issues/3117

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

  • @peregrine - No CAPTCHA reCAPTCHA addon - "No Captcha ReCaptcha 0.1.6b" is clashing with "EmailVerify" addon and causing the "Whoops! View not found" message. I disabled "No Captcha ReCaptcha 0.1.6b" addon but could not find Vanilla default reCAPTCHA at the user registration setting page. "No Captcha ReCaptcha 0.1.6b" addon has been a wonderful addon against bot/spam registration. Is there a way to make the two addons ("No Captcha ReCaptcha 0.1.6b" and EmailVerify) work together?

    "No Captcha ReCaptcha 0.1.6b" addon was developed by @x00

  • peregrineperegrine MVP
    edited November 2015

    @Prosper said:
    @peregrine - No CAPTCHA reCAPTCHA addon - "No Captcha ReCaptcha 0.1.6b" is clashing with "EmailVerify" addon and causing the "Whoops! View not found" message. I disabled "No Captcha ReCaptcha 0.1.6b" addon but could not find Vanilla default reCAPTCHA at the user registration setting page. "No Captcha ReCaptcha 0.1.6b" addon has been a wonderful addon against bot/spam registration. Is there a way to make the two addons ("No Captcha ReCaptcha 0.1.6b" and EmailVerify) work together?

    "No Captcha ReCaptcha 0.1.6b" addon was developed by @x00

    @prosper: the only other test I can think of is the js.

    what you can do is try changing this as a test...

    public function EntryController_Render_Before($Sender) {
              $Sender->AddJsFile('EmailVerify.js', 'plugins/EmailVerify');
        }
    

    to

      public function EntryController_Render_Before($Sender) {
             //     $Sender->AddJsFile('EmailVerify.js', 'plugins/EmailVerify');
            }
    

    because you just commented out the line the js will not be loaded and
    the positioning of the fields will be like so (not reordered) ... but if you do above code change will help you tell if the js in Emailverify is causing clash with No CAPTCHA reCAPTCHA addon

    report back if you can register with both plugins after the change.

    otherwise x00 is probably your best bet to solve issue since he can solve anything.

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

  • ProsperProsper ✭✭
    edited November 2015

    @peregrine - thank you for your help.
    I tested as you described above but got the same "whoops - view no found" error message (tested with "No Captcha ReCaptcha 0.1.6b" and "EmailVerify" addons).

    I have disabled the "No Captcha reCAPTCHA "addon and setup "Add Registration Question version 2.0" instead.

    I hope "Add Registration Question version 2.0" protect the forum from spam/bot registrations.
    Let me hope @x00 fix the "No Captcha reCAPTCHA "addon.

Sign In or Register to comment.