Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

email address validation


Reply

26 Posts   5265 Views

Avatar
James Bolitho

28 July 2011 at 4:46am (Last edited: 28 July 2011 4:48am), Community Member, 33 Posts

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?

Avatar
MarijnKampf

28 July 2011 at 11:59pm Community Member, 164 Posts

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.

Avatar
James Bolitho

29 July 2011 at 10:36pm Community Member, 33 Posts

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

Avatar
James Bolitho

11 August 2011 at 1:54am Community Member, 33 Posts

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

Avatar
MarijnKampf

11 August 2011 at 3:26am Community Member, 164 Posts

Thanks for those bug fixes and improvements Jim!

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

Avatar
Andre

25 October 2011 at 9:26pm Community Member, 126 Posts

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

Avatar
MarijnKampf

25 October 2011 at 10:55pm Community Member, 164 Posts

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

Avatar
johnmblack

2 November 2011 at 5:48am Community Member, 61 Posts

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?