Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I need to provide my members the ability to change their email address and password and delete their member account. I'm using SafeCracker. How do I do the following:

  • Allow users to enter a new email address, but that address will only become effective once the user has verified the new email address (meaning they need to go to their inbox and click a link)
  • Change the current password. Just in case, I also don't want the users to have to enter their existing password. As a matter of fact, I would prefer if they just entered the new password without having to confirm it. (I won't be using password input type.)
  • Delete member account, which will delete some Channel entries, but not all
share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

For a custom plugin, you would probably want to build a module that has its own tables to manage elements 'outside' the normal ee processes. For the first element listed above:

Allow users to enter a new email address, but that address will only become effective once the user has verified the new email address (meaning they need to go to their inbox and click a link)

  • What I would do on a custom module is have a member lookup by logged in member id, pulling out their current email address.
  • The form submission would send to a template that saves the current email and new email to a temporary email table.
  • This would then fire off a custom email to the new address via postmaster.
  • On receipt of the new email, the user would click the link which opens a new template and a custom tag generated by your mod file.
  • This tag checks the same table as above, looks for both the old and new. If verified the mod does a lookup of the existing member id and them replaces old with new and removes the record from your temp db table.

A couple of things you would need to look for would be what happens if:

  1. They don't click the link, but want to use their new email, what happens? or...
  2. When they do click the link, it should probably redirect them to a login of some sort (assuming they aren't logged in and login by email is your preferred method.

For the second element:

Change the current password. Just in case, I also don't want the users to have to enter their existing password. As a matter of fact, I would prefer if they just entered the new password without having to confirm it. (I won't be using password input type.)

You could do a lookup of the existing pass and place it into a hidden div or field and throw a little javascript verification to make sure the new pass != the old pass. Not sure you can submit this without a confirmation field, but haven't tried it before either.

For the last bit:

Delete member account, which will delete some Channel entries, but not all

Again, some sort of custom module with tags would sort this, but the key would be to make sure the person deleting their account is the actual person, so tied to their logged in member id, and loads of 'are you sure?' messages.

The custom mod would remove the member account from member tables, making sure to kill anything related in the EE structure.

Also, whatever channel entries required removing would need to be looked at, because field types might be more complicated to kill than others (playa or relationships or channel images have a few tables linked). You need to make sure comments, if used, are not linked and you don't end up with orphaned entries in the DB.

But the key is to define which needs to be removed and go through it methodically.

Hope this helps.

share|improve this answer
    
Aren't these functionalities already available in EE? I just want to be able to tap into them. I'm just looking for something similar to the logout functionality where EE just provides a path and I just need to display it as a link for users to click. –  ExpressionEngineNewbie Dec 29 '12 at 0:27
    
They aren't available within EE natively - no. It would take a custom plugin to do the job. –  Aaron Dec 29 '12 at 9:35
    
To cleanup channel entries you can take a look at the channel entries API. ellislab.com/expressionengine/user-guide/development/api/… –  GDmac Jan 15 '13 at 9:29
add comment

The functionality you ask is very specific and
quite far of from the default behavior of EE or any member add-on.

to achieve this you will probably need a custom add-on.

share|improve this answer
    
Any suggestions? –  ExpressionEngineNewbie Dec 28 '12 at 10:15
    
The functionality you ask is very specific and quite far of from the default behavior of EE or any member add-on. You could hire a developer to develop such an add-on. –  GDmac Dec 28 '12 at 10:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.