下記コード部で20行目や21行目では登録開始あるいは終了かどうかでリダイレクトを行なっているが,13行目でlogin()処理を行なっている.これは新規登録時だとloginできない(登録されていないため)ので20行目および21行目に到達することができず,プロフィール登録ができない状態となっている.
apps/pc_frontend/modules/OpenID/actions/registerOpenIDConfirmAction.class.php
11 class RegisterOpenIDConfirmAction extends sfAction
12 {
13 public function execute($request)
14 {
15 $this->forward404Unless($request->hasParameter('authMode'));
16 $this->getUser()->setCurrentAuthMode('OpenID');
17
18 if ($uri = $this->getUser()->login())
19 {
20 $this->redirectIf($this->getUser()->isRegisterBegin(), $this->getUser()->getRegisterInputAction());
21 $this->redirectIf($this->getUser()->isRegisterFinish(), $this->getUser()->getRegisterEndAction());
22 $this->redirectIf($this->getUser()->isMember(), $uri);
23 }
24
25 $this->getUser()->setFlash('error', 'Invalid.');
26 $this->redirect('member/register?token='.$request['token']);
27 }
28 }
修正案¶
login処理を行う前に新規登録状態かどうかのリダイレクト処理を行う.
diff --git a/apps/pc_frontend/modules/OpenID/actions/registerOpenIDConfirmAction.class.php b/apps/pc_frontend/modules/OpenID/actions/registerOpenIDConfirmAction.class.php
index 3f99c6c..4003f86 100644
--- a/apps/pc_frontend/modules/OpenID/actions/registerOpenIDConfirmAction.class.php
+++ b/apps/pc_frontend/modules/OpenID/actions/registerOpenIDConfirmAction.class.php
@@ -15,10 +15,10 @@ class RegisterOpenIDConfirmAction extends sfAction
$this->forward404Unless($request->hasParameter('authMode'));
$this->getUser()->setCurrentAuthMode('OpenID');
+ $this->redirectIf($this->getUser()->isRegisterBegin(), $this->getUser()->getRegisterInputAction());
+ $this->redirectIf($this->getUser()->isRegisterFinish(), $this->getUser()->getRegisterEndAction());
if ($uri = $this->getUser()->login())
{
- $this->redirectIf($this->getUser()->isRegisterBegin(), $this->getUser()->getRegisterInputAction());
- $this->redirectIf($this->getUser()->isRegisterFinish(), $this->getUser()->getRegisterEndAction());
$this->redirectIf($this->getUser()->isMember(), $uri);
}