I am creating a website where a person uses their email and a password to log in. I am wondering how to create a page or some type of method where a person can cancel them self out?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Moving post to general questions. Please put your question in the correct forum. As for how to do that are you using any existing profile module? a function to delete a member is pretty easy (you would want to add additional 'Do you want to do this' checks)
// Page_Controller
function deleteself() {
$member = Member::currentUser();
if($member) {
$member->delete();
$member->logOut();
}
}
return false;
}
Then you just need a link to home/deleteself to allow the user to delete themselves.
I accidently clicked on the wrong selection in the forum area. My mouse is kind of sensitive. As far as a profile module. Yes I am using one. The information you have provided, I was wondering where to place the code to allow a user to delete themself from the site? I am sorry if I'm being specific. I am not really good with understanding website creation, but being here and learning about Silver Stripe helps, especially the forums section.
As far as a profile module. Yes I am using one...
Which one are you using?
I was wondering where to place the code to allow a user to delete themself from the site? I am sorry if I'm being specific. I am not really good with understanding website creation, but being here and learning about Silver Stripe helps, especially the forums section.
As I said you would put that specific code from my previous post in a controller, eg your Page controller. Then to make a link to that functionality put this in any of the template (.ss) files in your theme (eg themes/yourthemename/templates/Page.ss)
<a href="home/deleteself">Delete your Account</a>
I will try it, because like I said, I'm sort of new to the placement of code to make things work. So far I been doing fine.