当前位置: 首页>>代码示例>>PHP>>正文


PHP opToolkit::isMobileEmailAddress方法代码示例

本文整理汇总了PHP中opToolkit::isMobileEmailAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP opToolkit::isMobileEmailAddress方法的具体用法?PHP opToolkit::isMobileEmailAddress怎么用?PHP opToolkit::isMobileEmailAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在opToolkit的用法示例。


在下文中一共展示了opToolkit::isMobileEmailAddress方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 public function save()
 {
     parent::save();
     $emailAddress = $this->member->getEmailAddress();
     $params = array('mailAddress' => $emailAddress, 'newPassword' => $this->plainPassword, 'isMobile' => opToolkit::isMobileEmailAddress($emailAddress));
     $this->sendConfirmMail($emailAddress, $params);
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:7,代码来源:ReissuePasswordForm.class.php

示例2: execute

 protected function execute($arguments = array(), $options = array())
 {
     parent::execute($arguments, $options);
     sfContext::createInstance($this->createConfiguration('pc_frontend', 'prod'), 'pc_frontend');
     $pcGadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('dailyNews');
     $mobileGadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('mobileDailyNews');
     $targetMembers = Doctrine::getTable('Member')->findAll();
     foreach ($targetMembers as $member) {
         if (!$member->getConfig('daily_news')) {
             continue;
         }
         if (1 == $member->getConfig('daily_news') && !$this->isDailyNewsDay()) {
             continue;
         }
         $address = $member->getEmailAddress();
         $gadgets = $pcGadgets['dailyNewsContents'];
         if (opToolkit::isMobileEmailAddress($address)) {
             $gadgets = $mobileGadgets['mobileDailyNewsContents'];
         }
         $filteredGadgets = array();
         if ($gadgets) {
             foreach ($gadgets as $gadget) {
                 if ($gadget->isEnabled()) {
                     $filteredGadgets[] = array('component' => array('module' => $gadget->getComponentModule(), 'action' => $gadget->getComponentAction()), 'gadget' => $gadget, 'member' => $member);
                 }
             }
         }
         $context = $this->getContextByEmailAddress($address);
         $params = array('member' => $member, 'gadgets' => $filteredGadgets, 'subject' => $context->getI18N()->__('デイリーニュース'), 'today' => time());
         opMailSend::sendTemplateMail('dailyNews', $address, opConfig::get('admin_mail_address'), $params, $context);
     }
 }
开发者ID:TadahiroKudo,项目名称:OpenPNE3,代码行数:32,代码来源:openpneSendDailyNewsTask.class.php

示例3: sendTemplateMail

 public static function sendTemplateMail($template, $to, $from, $params = array(), $context = null)
 {
     if (!$to) {
         return false;
     }
     if (empty($params['target'])) {
         $target = opToolkit::isMobileEmailAddress($to) ? 'mobile' : 'pc';
     } else {
         $target = $params['target'];
     }
     if (in_array($target . '_' . $template, Doctrine::getTable('NotificationMail')->getDisabledNotificationNames())) {
         return false;
     }
     if (null === $context) {
         $context = sfContext::getInstance();
     }
     $body = self::getMailTemplate($template, $target, $params, false, $context);
     $signature = self::getMailTemplate('signature', $target, array(), true, $context);
     if ($signature) {
         $signature = "\n" . $signature;
     }
     $subject = $params['subject'];
     $notificationMail = Doctrine::getTable('NotificationMail')->fetchTemplate($target . '_' . $template);
     if ($notificationMail instanceof NotificationMail && $notificationMail->getTitle()) {
         $subject = $notificationMail->getTitle();
         $templateStorage = new sfTemplateStorageString($subject);
         $renderer = new opTemplateRendererTwig();
         $params['sf_type'] = null;
         $parameterHolder = new sfViewParameterHolder($context->getEventDispatcher(), $params);
         $subject = $renderer->evaluate($templateStorage, $parameterHolder->toArray());
         $notificationMail->free(true);
     }
     return self::execute($subject, $to, $from, $body . $signature);
 }
开发者ID:shotaatago,项目名称:OpenPNE3,代码行数:34,代码来源:opMailSend.class.php

示例4: sendDailyNews

 private function sendDailyNews($app)
 {
     $isAppMobile = 'mobile_frontend' === $app;
     $dailyNewsName = $isAppMobile ? 'mobileDailyNews' : 'dailyNews';
     $context = sfContext::createInstance($this->createConfiguration($app, 'prod'), $app);
     $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName($dailyNewsName);
     $gadgets = $gadgets[$dailyNewsName . 'Contents'];
     $targetMembers = Doctrine::getTable('Member')->findAll();
     foreach ($targetMembers as $member) {
         $address = $member->getEmailAddress();
         if ($isAppMobile !== opToolkit::isMobileEmailAddress($address)) {
             continue;
         }
         $dailyNewsConfig = $member->getConfig('daily_news');
         if (null !== $dailyNewsConfig && 0 === (int) $dailyNewsConfig) {
             continue;
         }
         if (1 === (int) $dailyNewsConfig && !$this->isDailyNewsDay()) {
             continue;
         }
         $filteredGadgets = array();
         if ($gadgets) {
             foreach ($gadgets as $gadget) {
                 if ($gadget->isEnabled($member)) {
                     $filteredGadgets[] = array('component' => array('module' => $gadget->getComponentModule(), 'action' => $gadget->getComponentAction()), 'gadget' => $gadget, 'member' => $member);
                 }
             }
         }
         $params = array('member' => $member, 'gadgets' => $filteredGadgets, 'subject' => $context->getI18N()->__('デイリーニュース'), 'today' => time());
         opMailSend::sendTemplateMail('dailyNews', $address, opConfig::get('admin_mail_address'), $params, $context);
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:32,代码来源:openpneSendDailyNewsTask.class.php

示例5: doClean

 /**
  * @see sfValidatorString
  */
 protected function doClean($value)
 {
     $clean = parent::doClean($value);
     if (opToolkit::isMobileEmailAddress($clean)) {
         throw new sfValidatorError($this, 'invalid', array('value' => $value));
     }
     return $clean;
 }
开发者ID:balibali,项目名称:OpenPNE3,代码行数:11,代码来源:opValidatorPCEmail.class.php

示例6: getContextByEmailAddress

 protected function getContextByEmailAddress($address)
 {
     $application = 'pc_frontend';
     if (opToolkit::isMobileEmailAddress($address)) {
         $application = 'mobile_frontend';
     }
     if (!sfContext::hasInstance($application)) {
         $context = sfContext::createInstance($this->createConfiguration($application, 'prod'), $application);
     } else {
         $context = sfContext::getInstance($application);
     }
     return $context;
 }
开发者ID:phenom,项目名称:OpenPNE3,代码行数:13,代码来源:opBaseSendMailTask.class.php

示例7: checkSecretQuestion

 public function checkSecretQuestion($validator, $values, $arguments = array())
 {
     $configName = opToolkit::isMobileEmailAddress($values['mail_address']) ? 'mobile_address' : 'pc_address';
     $memberConfig = Doctrine::getTable('MemberConfig')->findOneByNameAndValue($configName, $values['mail_address']);
     if (!$memberConfig) {
         throw new sfValidatorError($validator, 'invalid');
     }
     $this->member = $memberConfig->Member;
     if ($values['secret_question'] != $this->member->getConfig('secret_question')) {
         throw new sfValidatorError($validator, 'invalid');
     }
     // To keep backward compatibility with OpenPNE 1.x, your answer is checked as Shift-JIS too.
     if (!in_array($this->member->getConfig('secret_answer'), array(md5($values['secret_answer']), md5(mb_convert_encoding($values['secret_answer'], 'SJIS-win', 'UTF-8'))))) {
         throw new sfValidatorError($validator, 'invalid');
     }
     return $values;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:17,代码来源:opAuthMailAddressPasswordRecoveryForm.class.php

示例8: sendTemplateMail

 public static function sendTemplateMail($template, $to, $from, $params = array(), $context = null)
 {
     if (!$to) {
         return false;
     }
     if (empty($params['target'])) {
         $target = opToolkit::isMobileEmailAddress($to) ? 'mobile' : 'pc';
     } else {
         $target = $params['target'];
     }
     if (in_array($target . '_' . $template, Doctrine::getTable('NotificationMail')->getDisabledNotificationNames())) {
         return false;
     }
     $body = self::getMailTemplate($template, $target, $params, false, $context);
     $signature = self::getMailTemplate('signature', $target, array(), true, $context);
     if ($signature) {
         $signature = "\n" . $signature;
     }
     return self::execute($params['subject'], $to, $from, $body . $signature);
 }
开发者ID:phenom,项目名称:OpenPNE3,代码行数:20,代码来源:sfOpenPNEMailSend.class.php

示例9: __call

 public function __call($name, $arguments)
 {
     if (0 === strpos($name, 'set')) {
         $data = $arguments[0];
         $key = $arguments[1];
         if (in_array($key, $this->profiles)) {
             if (empty($data[$key])) {
                 return null;
             }
             $this->setMemberProfile($this->member, $this->tableToOpenPNE[$key], array_shift($data[$key]));
         } elseif (in_array($key, $this->names)) {
             $nickname = $this->getValue($data, 'namePerson/friendly');
             if (!$nickname) {
                 $nickname = $this->getValue($data, 'namePerson');
             }
             $this->member->setName(array_shift($nickname));
         } elseif (in_array($key, $this->emails)) {
             $email = $this->getValue($data, 'contact/email');
             if (!$email) {
                 return null;
             }
             $email = array_shift($email);
             if (opToolkit::isMobileEmailAddress($email)) {
                 $this->member->setConfig('mobile_address', $email);
             } else {
                 $this->member->setConfig('pc_address', $email);
             }
         } elseif (in_array($key, $this->images)) {
             return null;
         } elseif (in_array($key, $this->configs)) {
             if (empty($data[$key])) {
                 return null;
             }
             $this->member->setConfig($this->tableToOpenPNE[$key], array_shift($data[$key]));
         } else {
             throw new BadMethodCallException(sprintf('Unknown method %s::%s', get_class($this), $name));
         }
     } else {
         throw new BadMethodCallException(sprintf('Unknown method %s::%s', get_class($this), $name));
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:41,代码来源:opProfileImport.class.php

示例10: validate

 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;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:22,代码来源:opRequestRegisterURLForm.class.php

示例11: sendConfirmMail

 protected function sendConfirmMail($token, $to, $params = array())
 {
     $authMode = $this->getOption('authMode', null);
     if (!$authMode) {
         $authMode = sfContext::getInstance()->getUser()->getCurrentAuthMode();
     }
     $params = array('token' => $token, 'authMode' => $authMode, 'isMobile' => opToolkit::isMobileEmailAddress($to), 'name' => $this->getOption('invited') ? sfContext::getInstance()->getUser()->getMember()->getName() : null, 'message' => $this->getOption('invited') ? $this->getValue('message') : null, 'subject' => opConfig::get('sns_name') . '招待状');
     sfOpenPNEMailSend::sendTemplateMail('requestRegisterURL', $to, opConfig::get('admin_mail_address'), $params);
 }
开发者ID:phenom,项目名称:OpenPNE3,代码行数:9,代码来源:InviteForm.class.php

示例12: sendMail

  public function sendMail()
  {
    if ($this->doNotSend)
    {
      return null;
    }

    $address = '';

    $member = $this->member;
    if (!$member)
    {
      $member = Doctrine::getTable('Member')->createPre();
    }

    if ($this->getValue('pc_address'))
    {
      $address = $this->getValue('pc_address');

      $member->setConfig('pc_address_pre', $address);
    }
    elseif ($this->getValue('mobile_address'))
    {
      $address = $this->getValue('mobile_address');

      $member->setConfig('mobile_address_pre', $address);
    }

    $token = $member->generateRegisterToken();

    $authMode = $this->getOption('authMode', null);
    if (!$authMode)
    {
      $authMode = sfContext::getInstance()->getUser()->getCurrentAuthMode();
    }
    $member->setConfig('register_auth_mode', $authMode);

    $params = array(
      'token'    => $token,
      'authMode' => 'MailAddress',
      'isMobile' => opToolkit::isMobileEmailAddress($address),
      'subject' => opConfig::get('sns_name').'招待状',
    );
    opMailSend::sendTemplateMail('notifyRegisterURL', $address, opConfig::get('admin_mail_address'), $params);
  }
开发者ID:nothan,项目名称:opAuthMailAddressPlugin,代码行数:45,代码来源:opRequestRegisterURLForm.class.php

示例13: save

 protected function save($data)
 {
     $event = new sfEvent(null, 'op_csv.import_filter_data');
     sfContext::getInstance()->getEventDispatcher()->filter($event, $data);
     $fields = $event->getReturnValue();
     $member = new Member();
     $memberConfigs = array();
     $memberProfiles = array();
     foreach ($data as $key => $col) {
         $field = $this->fields[$key];
         if ($field['is_profile']) {
             $validator = $field['validator'];
             $memberProfiles[$field['name']] = $validator->clean($col);
             continue;
         } else {
             switch ($field['name']) {
                 case "nickname":
                     $validator = new opValidatorString(array('max_length' => 64, 'trim' => true, 'required' => true));
                     $member->name = $validator->clean($col);
                     break;
                 case "mail_address":
                     $validator = new sfValidatorEmail(array('trim' => true, 'required' => true));
                     $address = $validator->clean($col);
                     if (opToolkit::isMobileEmailAddress($address)) {
                         $memberConfigs['mobile_address'] = $address;
                     }
                     $memberConfigs['pc_address'] = $address;
                     break;
                 case "pc_mail_address":
                     $validator = new sfValidatorEmail(array('trim' => true, 'required' => true));
                     $address = $validator->clean($col);
                     if (opToolkit::isMobileEmailAddress($address)) {
                         throw new opCsvPluginImportException("'pc_mail_address' is mobile address.");
                     }
                     $memberConfigs['pc_address'] = $address;
                     break;
                 case "mobile_mail_address":
                     $validator = new sfValidatorEmail(array('trim' => true, 'required' => true));
                     $address = $validator->clean($col);
                     if (!opToolkit::isMobileEmailAddress($address)) {
                         throw new opCsvPluginImportException("'mobile_mail_address' is not support mobile address.");
                     }
                     $memberConfigs['mobile_address'] = $address;
                     break;
                 case "password":
                     $validator = new sfValidatorPassword(array('trim' => true, 'required' => true));
                     $memberConfigs['password'] = $validator->clean($col);
                     break;
             }
         }
     }
     // check unique for member config
     foreach ($this->uniqueMemberConfigFields as $name) {
         if (isset($memberConfigs[$name]) && Doctrine::getTable('MemberConfig')->retrieveByNameAndValue($name, $memberConfigs[$name])) {
             throw new opCsvPluginImportException("'" . $name . "' duplicated.");
         }
     }
     $member->setIsActive(true);
     $member->save();
     foreach ($memberConfigs as $key => $value) {
         $member->setConfig($key, $value);
     }
     foreach ($memberProfiles as $key => $value) {
         $profile = $this->field[$key]['profile'];
     }
 }
开发者ID:kawahara,项目名称:opCsvPlugin,代码行数:66,代码来源:opCsvPluginImportMember.class.php


注:本文中的opToolkit::isMobileEmailAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。