ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Ignore:
Timestamp:
Jan 23, 2009, 11:57:42 PM (14 years ago)
Author:
ebihara
Message:

#3287:added ability to delete the member's account himself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/action/sfOpenPNEMemberAction.class.php

    r10119 r10348  
    270270    return sfView::INPUT;
    271271  }
     272
     273 /**
     274  * Executes delete action
     275  *
     276  * @param sfRequest $request A request object
     277  */
     278  public function executeDelete($request)
     279  {
     280    if (1 == $this->getUser()->getMemberId())
     281    {
     282      return sfView::ERROR;
     283    }
     284
     285    $this->form = new sfOpenPNEPasswordForm(array(), array('member' => $this->getUser()->getMember()));
     286    if ($request->isMethod('post'))
     287    {
     288      $this->form->bind($request->getParameter('password'));
     289      if ($this->form->isValid())
     290      {
     291        $this->getUser()->getMember()->delete();
     292        $this->getUser()->setFlash('notice', '退会が完了しました');
     293        $this->getUser()->logout();
     294        $this->redirect('member/login');
     295      }
     296    }
     297
     298    return sfView::INPUT;
     299  }
    272300}
Note: See TracChangeset for help on using the changeset viewer.