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:
- They don't click the link, but want to use their new email, what happens? or...
- 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.)
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.