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

source: OpenPNE3/plugins/opAuthPCAddressPlugin/trunk/apps/pc_frontend/modules/pcAddress/actions/actions.class.php @ 9041

Last change on this file since 9041 was 9041, checked in by ebihara, 12 years ago

#2944:deleted useless method

File size: 1.9 KB
Line 
1<?php
2
3/**
4 * pcAddress actions.
5 *
6 * @package    OpenPNE
7 * @subpackage pcAddress
8 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
9 * @version    SVN: $Id: actions.class.php 9301 2008-05-27 01:08:46Z dwhittle $
10 */
11class pcAddressActions extends sfActions
12{
13  public function executeRequestRegisterURL($request)
14  {
15    $this->form = new PCAddressForm();
16
17    if ($request->isMethod('post')) {
18      $params = $request->getParameter('pc_address');
19      $this->form->bind($params);
20
21      if ($this->form->isValid()) {
22        $member = $this->getUser()->getAuthContainer()->registerEmailAddress($params['pc_address']);
23        $token = MemberConfigPeer::retrieveByNameAndMemberId('pc_address_token', $member->getId());
24
25        $subject = OpenPNEConfig::get('sns_name').'の招待状が届いています';
26        $body = $this->getPartial('global/requestRegisterURLMail', array('token' => $token->getValue()));
27        sfOpenPNEMailSend::execute($subject, $params['pc_address'], OpenPNEConfig::get('admin_mail_address'), $body);
28
29        return sfView::SUCCESS;
30      }
31    }
32
33    return sfView::INPUT;
34  }
35
36  public function executeRegister($request)
37  {
38    $token = $request->getParameter('token');
39    $memberConfig = MemberConfigPeer::retrieveByNameAndValue('pc_address_token', $token);
40    $this->forward404Unless($memberConfig, 'This URL is invalid.');
41
42    $this->getUser()->setMemberId($memberConfig->getMemberId());
43    $this->getUser()->setIsSNSRegisterBegin(true);
44
45    $this->redirect('member/registerInput');
46  }
47
48  public function executeRegisterEnd($request)
49  {
50    $member = $this->getUser()->getMember();
51    $member->setIsActive(true);
52    $member->save();
53
54    $memberConfig = MemberConfigPeer::retrieveByNameAndMemberId('pc_address_token', $member->getId());
55    $memberConfig->delete();
56
57    $this->getUser()->setIsSNSMember(true);
58    $this->redirect('member/home');
59  }
60}
Note: See TracBrowser for help on using the repository browser.