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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

How to save Member Password manually?

Go to End

3 Posts   1587 Views


Community Member, 116 Posts

3 April 2012 at 4:26pm


I am trying to make a registration form for Members, but cannot use $form->saveInto($member) due to custom functionality.

This does not work:

It gives me a server error and defaults to the blackcandy template.

Can anyone advise?



Forum Moderator, 1899 Posts

4 April 2012 at 5:13am


I've done this in the past that should save you some lines of code too (assuming your form is setup correctly)...

$doMember = new Member($data);

alternativly if you check the docs you could make the member and then set the password with a fucntion...


Community Member, 116 Posts

4 April 2012 at 10:45am

Thanks Swaiba, I couldn't do you first method as I was not able to make the Form Field Names match the Names of the Fields in the Database due to third party applications relying on certain Field Names. However, your changePassword suggestion helped me do the following:

	function doRegister($data, $form) {

			// Write the new member to the SilverStripe Database
			$member = new Member();
			$member->FirstName = $data['GivenName'];
			$member->Surname = $data['FamilyName'];
			$member->Email = $data['EMail']['Home'];
			$password = $data['Password']['_Password'];
			return Director::redirect('please-verify-your-account/');