Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Send User their login inform (Password Encyrption)

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

Page: 1
Go to End
Author Topic: 2021 Views
  • TerryMiddleton
    Avatar
    Community Member
    108 Posts

    Send User their login inform (Password Encyrption) Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Send User their login inform (Password Encyrption) Link to this post

    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.

  • TerryMiddleton
    Avatar
    Community Member
    108 Posts

    Re: Send User their login inform (Password Encyrption) Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Send User their login inform (Password Encyrption) Link to this post

    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.

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: Send User their login inform (Password Encyrption) Link to this post

    How must be email template for using populateData?

  • zenmonkey
    Avatar
    Community Member
    527 Posts

    Re: Send User their login inform (Password Encyrption) Link to this post

    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.

    2021 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.