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

Send User their login inform (Password Encyrption)


Reply


6 Posts   2108 Views

Avatar
TerryMiddleton

Community Member, 108 Posts

16 May 2009 at 3:32am

I need to send the user their login infomation (email, password)

When I do this their password is encrypted.

How can I decrypt so they can see their password?

Terry

Avatar
Willr

Forum Moderator, 5513 Posts

16 May 2009 at 10:56am

Edited: 16/05/2009 10:57am

You cannot decrypt passwords, thats kinda the point of Encryption!

Depending on how you are doing this (eg is it straight after signup) you can keep there password clear - for example a client of mine wanted to email confirmation of the password to the user on signup so I did something like

// this is in the form submission method, $data is the passed values
$Member->Password = $data['Password']; // $Password will be encrypted
$Member->ClearPassword = $data['Password']; // $ClearPassword is NOT in the database but is saved temporary to this object

$email = new MemberSignupEmail(); // my own custom class
$email->populateTemplate($Member); // $ClearPassword is available in the email template but not stored in the DB
$email->send();

In other cases you cannot get the Password. You must reset it.

Avatar
TerryMiddleton

Community Member, 108 Posts

16 May 2009 at 11:18am

willr,

Thanks for reply.

This client has a process where they have to approve the user before they can gain access to the site. So I the user fill out a form and I email the results to company rep who will decide to approve/deny them based on if they are a paying customer. Once they approve them, they will get an email confirmation saying they have been approved and here is their login information.

hmmm...I wonder if I need to add a text field to the member and spoof it as a password field.

Is there a way to turn off encryption?

Terry

Avatar
Hamish

Community Member, 712 Posts

16 May 2009 at 2:53pm

When the user first signs up, flag them as unapproved, then add a process where the rep recieves the notification and can approve them (or not). Add a check for this flag on the appropriate pages and you've got your approval system in place without the need to email clear text passwords around.

Avatar
biapar

Forum Moderator, 435 Posts

29 January 2010 at 1:53am

How must be email template for using populateData?

Avatar
zenmonkey

Community Member, 532 Posts

29 January 2010 at 7:06am

I created a User Registration and Approval system using the DataObjectManager, When a user applies it saves the application to DataObject containing the same fields as the member field and sends a copy to an admin. I then add added a custom function to the DOM that approves the user, sends out an approval email and copies the data object to correct Member Group. So far its been effective.