Jump to:

23355 Posts in 17838 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Member Profile?

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

Page: 1
Go to End
Author Topic: 1030 Views
  • Denny
    Avatar
    Community Member
    55 Posts

    Member Profile? Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Member Profile? Link to this post

    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.

  • Denny
    Avatar
    Community Member
    55 Posts

    Re: Member Profile? Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Member Profile? Link to this post

    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>

  • Denny
    Avatar
    Community Member
    55 Posts

    Re: Member Profile? Link to this post

    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.

    1030 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.