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

Member Profile?


Reply


5 Posts   1090 Views

Avatar
Denny

Community Member, 55 Posts

5 September 2010 at 9:56am

Edited: 05/09/2010 10:24am

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?

Avatar
Willr

Forum Moderator, 5513 Posts

5 September 2010 at 10:24am

Edited: 05/09/2010 10:24am

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.

Avatar
Denny

Community Member, 55 Posts

6 September 2010 at 12:11am

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.

Avatar
Willr

Forum Moderator, 5513 Posts

6 September 2010 at 11:33am

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>

Avatar
Denny

Community Member, 55 Posts

8 September 2010 at 2:04pm

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.