public function validate($validator, $values, $arguments = array())
  {
    if (opToolkit::isMobileEmailAddress($values['mail_address']))
    {
      $mailValidator = new sfValidatorMobileEmail();
      $values['mobile_address'] = $mailValidator->clean($values['mail_address']);
      $mode = 'mobile';
    }
    else
    {
      $mailValidator = new opValidatorPCEmail();
      $values['pc_address'] = $mailValidator->clean($values['mail_address']);
      $mode = 'pc';
    }

    if (!opToolkit::isEnabledRegistration($mode))
    {
      throw new sfValidatorError($validator, 'invalid');
    }

    if (!empty($values['mobile_address']) && !$this->validateAddress('mobile_address', $values['mobile_address']))
    {
      $this->doNotSend = true;
    }
    if (!empty($values['pc_address']) && !$this->validateAddress('pc_address', $values['pc_address']))
    {
      $this->doNotSend = true;
    }

    return $values;
  }
Exemplo n.º 2
0
 public function executeRequestRegisterURL($request)
 {
     $adapter = new opAuthAdapterMailAddress('MailAddress');
     if ($adapter->getAuthConfig('invite_mode') < 2) {
         $this->forward404();
     }
     $this->forward404Unless(opToolkit::isEnabledRegistration());
     return sfView::INPUT;
 }
Exemplo n.º 3
0
 public function executeRequestRegisterURL($request)
 {
     $adapter = new opAuthAdapterMailAddress('MailAddress');
     if ($adapter->getAuthConfig('invite_mode') < 2) {
         $this->forward404();
     }
     $this->forward404Unless(opToolkit::isEnabledRegistration());
     $this->form = new opRequestRegisterURLForm(null, array('authMode' => 'MailAddress'));
     if ($request->isMethod('post')) {
         $this->form->bind($request->getParameter('request_register_url'));
         if ($this->form->isValid()) {
             $this->form->sendMail();
             return sfView::SUCCESS;
         }
     }
     return sfView::INPUT;
 }
Exemplo n.º 4
0
?>
>
<?php 
echo $form;
?>

<center>
<input type="submit" value="<?php 
echo __('Login');
?>
">
</center>
</form>

<?php 
if ($form->getAuthAdapter()->getAuthConfig('invite_mode') == 2 && opToolkit::isEnabledRegistration('mobile') && $form->getAuthAdapter()->getAuthConfig('self_invite_action')) {
    echo link_to(__('Registration'), $form->getAuthAdapter()->getAuthConfig('self_invite_action'));
}
?>

<?php 
if ($form->getAuthAdapter()->getAuthConfig('help_login_error_action')) {
    ?>
<br><?php 
    echo link_to(__('Can not access your account?'), $form->getAuthAdapter()->getAuthConfig('help_login_error_action'));
}
?>

<?php 
include_customizes($id, 'bottom');
?>
 /**
  * Executes invite action
  *
  * @param sfRequest $request A request object
  */
 public function executeInvite($request)
 {
     if (!$this->getUser()->getAuthAdapter()->getAuthConfig('invite_mode') || !opToolkit::isEnabledRegistration()) {
         return sfView::ERROR;
     }
     $this->form = new InviteForm(null, array('invited' => true));
     $this->form->setOption('is_link', true);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getParameter('member_config'));
         if ($this->form->isValid()) {
             $this->form->save();
             return sfView::SUCCESS;
         }
     }
     $id = $this->getUser()->getMemberId();
     $this->invites = $this->getUser()->getMember()->getInvitingMembers();
     $this->listform = new InvitelistForm(array(), array('invites' => $this->invites));
     if ($request->isMethod('post')) {
         $this->listform->bind($request->getParameter('invitelist'));
         if ($this->listform->isValid()) {
             $this->listform->save();
             $this->redirect('member/invite');
         }
     }
     return sfView::INPUT;
 }
Exemplo n.º 6
0
<form action="<?php 
echo url_for(sprintf('member/login?%s=%s', sfOpenPNEAuthForm::AUTH_MODE_FIELD_NAME, $form->getAuthMode()));
?>
" method="post">
<?php 
foreach ($form as $name => $field) {
    echo $field->render();
}
?>
<input type="image" name="submit" src="<?php 
echo image_path('dummy.gif');
?>
" id="button_login" alt="ログイン" />
<?php 
if ($form->getAuthAdapter()->getAuthConfig('invite_mode') == 2 && opToolkit::isEnabledRegistration('pc')) {
    echo link_to('<img src="' . image_path('dummy.gif') . '" alt="新規登録" />', $form->getAuthAdapter()->getAuthConfig('self_invite_action'), array('id' => 'button_new_regist'));
}
?>
<div class="msg lh_130">
<?php 
if ($form->getAuthAdapter()->getAuthConfig('help_login_error_action')) {
    ?>
<br />
<span class="password_query"><?php 
    echo link_to(__('Can not access your account?'), $form->getAuthAdapter()->getAuthConfig('help_login_error_action'));
    ?>
</span>
<?php 
}
?>