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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Figuring out where to put this code?


Go to End


5 Posts   1156 Views

Avatar
Denny

Community Member, 55 Posts

2 December 2010 at 11:33am

A few months ago I tried to figure out how to delete a member from my site. I am using the member profile module. There was someone whom gave me specific instructions on how to do this. I did manage to create the link to the page, but I don't know where to place this code. I was told to place it in my page controller, but how? Anyway, it's real simple, and I have posted the code given to me a few months ago on how to do this. I been busy constructing other visuals for my site, and I apologize for the delay of this problem.

Attached Files
Avatar
Willr

Forum Moderator, 5523 Posts

2 December 2010 at 3:38pm

but I don't know where to place this code. I was told to place it in my page controller, but how?

* Open mysite/code/Page.php.
* Go down to the Page_Controller section and paste that code within the { } surrounding the Controller.
* Additionally you may need to tell SS that function is allowed to be called. Again in the Page_Controller class (normally at the top of the class)

static $allowed_actions = array('deleteself')

Avatar
Denny

Community Member, 55 Posts

3 December 2010 at 12:08am

I tried to figure out where to place this code, but I'm not sure? Anyway, I will send you a copy of this file, and maybe you can spot where to put this code. I am afraid of ruining my site.

Attached Files
Avatar
Willr

Forum Moderator, 5523 Posts

3 December 2010 at 12:05pm

Avatar
Denny

Community Member, 55 Posts

5 December 2010 at 9:11am

I did try the pastie.org, and I figured it out. Thank you for your help.