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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Front-end Password issue on Front-end Member Registration


Go to End


1060 Views

Avatar
congii

Community Member, 6 Posts

5 February 2013 at 4:30pm


Hi, on SS 3.0.3 I have a front-end registration form and it seems the password saved using the form is different than the one saved on the database. Thus when a member register, he/she can't login. I have to manually change the password on the CMS.

Front-end Form Fields

,new TextField('Email', 'Email *')
,new TextField('JobTitle', 'Job Title *')
, new ConfirmedPasswordField('Password', 'New Password')

Form Action

if($member = DataObject::get_one("Member", "`Email` = '". Convert::raw2sql($data['Email']) . "'"))
{
$form->AddErrorMessage('Email', "Sorry, that email address already exists. Please choose another.", 'bad');

Session::set("FormInfo.StaffManagementPage_StaffManagementPage.data", $data);

return $this->redirectBack();;
}

$member = new Member();
$form->saveInto($member);
$member->write();

if($userGroup = DataObject::get_one('Group', "Code = 'staff'"))
{
Group::addToGroupByName($member, 'staff');
}

Any idea would be very much appreaciated.

Thanks!