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   5411 Views

Avatar
James Bolitho

Community Member, 33 Posts

28 July 2011 at 4:46am

Edited: 28/07/2011 4:48am

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

Community Member, 164 Posts

28 July 2011 at 11:59pm

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

Community Member, 33 Posts

29 July 2011 at 10:36pm

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

Avatar
James Bolitho

Community Member, 33 Posts

11 August 2011 at 1:54am

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

Community Member, 164 Posts

11 August 2011 at 3:26am

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

Community Member, 126 Posts

25 October 2011 at 9:26pm

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

Community Member, 164 Posts

25 October 2011 at 10:55pm

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

Avatar
johnmblack

Community Member, 61 Posts

2 November 2011 at 5:48am

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?