Permalink
Browse files

(fixes #1668) added the validation for application and e-mail

  • Loading branch information...
1 parent 37950b4 commit 831fe849239ed00fa09ff0f5349a759de8090b70 @martini2002jp martini2002jp committed Sep 6, 2011
@@ -40,6 +40,7 @@ public function executeRegister($request)
opActivateBehavior::disable();
$authMode = $memberConfig->getMember()->getConfig('register_auth_mode');
+ $mobileAddressPre = $memberConfig->getMember()->getConfig('mobile_address_pre');
opActivateBehavior::enable();
if ('MobileUID' === $authMode)
@@ -48,6 +49,12 @@ public function executeRegister($request)
}
$this->forward404Unless($authMode === $this->getUser()->getCurrentAuthMode());
+ if (!$mobileAddressPre)
+ {
+
+ return sfView::ERROR;
+ }
+
$this->getUser()->setMemberId($memberConfig->getMemberId());
$this->getUser()->setIsSNSRegisterBegin(true);
@@ -12,5 +12,10 @@ class opAuthMailAddressComponents extends sfComponents
{
public function executeRegisterBox($request)
{
+ $token = $request->getParameter('token');
+ $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndValue('register_token', $token);
+ opActivateBehavior::disable();
+ $this->mobileAddressPre = $memberConfig->getMember()->getConfig('mobile_address_pre');
+ opActivateBehavior::enable();
}
}
@@ -1,7 +1,11 @@
+<?php if (!$mobileAddressPre): ?>
+<?php echo __('Can access this registration URL with pc only.') ?>
+<?php else: ?>
<?php op_include_parts('ButtonBox', 'opAuthMailAddressPluginRegisterBox', array(
'title' => __('Registration with your e-mail address'),
'body' => __('You can go to the registration page by clicking the button below.'),
'button' => __('Go to the registration page'),
'url' => url_for($sf_user->getRegisterInputAction()),
'method' => 'get',
)) ?>
+<?php endif; ?>
@@ -0,0 +1 @@
+<?php echo __('Can access this registration URL with pc only.') ?>
@@ -52,6 +52,7 @@ public function executeRegister($request)
opActivateBehavior::disable();
$authMode = $memberConfig->getMember()->getConfig('register_auth_mode');
+ $pcAddressPre = $memberConfig->getMember()->getConfig('pc_address_pre');
opActivateBehavior::enable();
if ('MobileUID' === $authMode)
@@ -60,6 +61,12 @@ public function executeRegister($request)
}
$this->forward404Unless($authMode === $this->getUser()->getCurrentAuthMode());
+ if (!$pcAddressPre)
+ {
+
+ return sfView::ERROR;
+ }
+
$this->getUser()->setMemberId($memberConfig->getMemberId());
$this->getUser()->setIsSNSRegisterBegin(true);
@@ -12,5 +12,10 @@ class opAuthMailAddressComponents extends sfComponents
{
public function executeRegisterBox($request)
{
+ $token = $request->getParameter('token');
+ $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndValue('register_token', $token);
+ opActivateBehavior::disable();
+ $this->pcAddressPre = $memberConfig->getMember()->getConfig('pc_address_pre');
+ opActivateBehavior::enable();
}
}
@@ -1,7 +1,16 @@
+<?php if (!$pcAddressPre): ?>
+<?php
+$options = array(
+ 'title' => __('Errors'),
+);
+op_include_box('registerError', __('Can access this registration URL with mobile only.'), $options);
+?>
+<?php else: ?>
<?php op_include_parts('ButtonBox', 'opAuthMailAddressPluginRegisterBox', array(
'title' => __('Registration with your e-mail address'),
'body' => __('You can go to the registration page by clicking the button below.'),
'button' => __('Go to the registration page'),
'url' => url_for($sf_user->getRegisterInputAction()),
'method' => 'get',
)) ?>
+<?php endif; ?>
@@ -0,0 +1,6 @@
+<?php
+$options = array(
+ 'title' => __('Errors'),
+);
+op_include_box('registerError', __('Can access this registration URL with mobile only.'), $options);
+?>
View
@@ -102,6 +102,14 @@
<source>* Participate in %1%</source>
<target>■ %1% に参加する</target>
</trans-unit>
+ <trans-unit id="">
+ <source>Can access this registration URL with pc only.</source>
+ <target>この登録用URLはPC専用です。</target>
+ </trans-unit>
+ <trans-unit id="">
+ <source>Can access this registration URL with mobile only.</source>
+ <target>この登録用URLは携帯電話専用です。</target>
+ </trans-unit>
</body>
</file>
</xliff>
@@ -7,6 +7,10 @@
<?php if ($isMobile) : ?>
<?php echo app_url_for('mobile_frontend', sprintf('opAuthMailAddress/register?token=%s&authMode=%s', $token, $authMode), true) ?>
+
+<?php echo __('Can access this registration URL with mobile only.') ?>
<?php else: ?>
<?php echo app_url_for('pc_frontend', sprintf('opAuthMailAddress/register?token=%s&authMode=%s', $token, $authMode), true) ?>
+
+<?php echo __('Can access this registration URL with pc only.') ?>
<?php endif; ?>
@@ -9,6 +9,10 @@
<?php if ($isMobile) : ?>
<?php echo app_url_for('mobile_frontend', sprintf('opAuthMailAddress/register?token=%s&authMode=%s', $token, $authMode), true) ?>
+
+<?php echo __('Can access this registration URL with mobile only.') ?>
<?php else: ?>
<?php echo app_url_for('pc_frontend', sprintf('opAuthMailAddress/register?token=%s&authMode=%s', $token, $authMode), true) ?>
+
+<?php echo __('Can access this registration URL with pc only.') ?>
<?php endif; ?>

0 comments on commit 831fe84

Please sign in to comment.