Jump to:

23378 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » email address validation

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 5106 Views
  • James Bolitho
    Avatar
    Community Member
    33 Posts

    Re: email address validation Link to this post

    Hi Marijn, I have found a better solution than turning off Dev mode.

    On line 120 and 227 of VerifyEmailRole.php instead of:
    $tmpPage->ModuleURLSegment = $this->ModuleURLSegment;

    This seems to work fine:
    $tmpPage->ModuleURLSegment = 'verification';

    That is another bug fixed for me however, I now have another problem.

    The email verification process goes well but now when I try to log in with the new account that I have just created I can't log in and it gives me the error 'That doesn't seem to be the right e-mail address or password. Please try again.'. I was wondering if you can replicate this issue or if it is just on my site?

  • MarijnKampf
    Avatar
    Community Member
    164 Posts

    Re: email address validation Link to this post

    Jim, changing it to a string, will disable the possibility to easily change the url segment to something else. I still not able to reproduce that error/notice.

    Due to previous changes something strange happened with the password salt I think. This has been resolved in the latest version on github.

  • James Bolitho
    Avatar
    Community Member
    33 Posts

    Re: email address validation Link to this post

    Marijn, thanks for the help with this and your quick responses. I have it working now. Many thanks.

  • James Bolitho
    Avatar
    Community Member
    33 Posts

    Re: email address validation Link to this post

    Marijn, I made some minor modifications to the VerifyEmailRole.php for the website I am currently building. Maybe you might find them useful and add them to the module:

    After line 25:

    /**
    * Additional columns in Member Table displayed in the CMS so that you can easily see whether members email address has been verified etc.
    */
    function IsVerified() {
        return ($this->owner->Verified)?'Yes':'No';
    }
    function MemberDateJoined() {
        return $this->owner->dbObject('Created')->Nice();
    }
    function MemberDateAgoJoined() {
        return $this->owner->dbObject('Created')->Ago();
    }
    function updateSummaryFields(Fieldset &$fields) {
          $fields['IsVerified'] = 'EmailIsVerified';
          $fields['MemberDateJoined'] = 'DateMemberJoined';
          $fields['MemberDateAgoJoined'] = 'HowLongAgoMemberJoined';
    }

    modified line 37 to get error message to appear in error box above login form.

    _t ('VerifyEmailRole.ERRORSENTEMAILAGAIN', 'if you would like us to sent the verification email again.'),'bad'

    added after line 66 to get error message to appear in error box above login form.

    Session::set("Security.Message.type", 'bad');

    modified line 198 to 199 to get error message to appear in error box above email verification link resend form when no value is entered because previously I got the white screen of death when I didn't enter a value.

    } else {
             // Adds error message if nothing is entered into Email field.
             $FormInfo = array(
                "MemberLoginForm_verifyEmailSent" => array(
                   "formError" => array(
                      "message" => "Please enter an email address to have the email verification link resent.", "type" => "bad"
                   )
                )
             );
             Session::set("FormInfo", array_merge(Session::get("FormInfo"), $FormInfo ));
             Director::redirect(VerifyEmail_Controller::$ModuleURLSegment . '/verifyemail/');
          }

    Thanks,

    Jim

  • MarijnKampf
    Avatar
    Community Member
    164 Posts

    Re: email address validation Link to this post

    Thanks for those bug fixes and improvements Jim!

    I especially like the addition in the admin section. I've added them to github.

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: email address validation Link to this post

    Hi there, according to the error/notice jim2mullered has postet, Line 161 of VerifyEmailRole.php should read

    $tmpPage->ModuleURLSegment = self::$ModuleURLSegment;


    instead of

    $tmpPage->ModuleURLSegment = $this->ModuleURLSegment;


    because ModuleURLSegment is a class variable.

    regards

    Andre

  • MarijnKampf
    Avatar
    Community Member
    164 Posts

    Re: email address validation Link to this post

    Hi Andre, thanks for the improvements you suggested, I've added them to the code on GitHub.

  • johnmblack
    Avatar
    Community Member
    61 Posts

    Re: email address validation Link to this post

    Quick question for Marijn or any of you -- I am having a lot of issues with email member validation in the memberprofiles module... If I install this module, will this conflict with that one? Anyone have luck using both?

    5106 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.