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

Changeset 12228


Ignore:
Timestamp:
Jul 11, 2009, 7:11:15 PM (11 years ago)
Author:
ebihara
Message:

#3970:メンバーのメール投稿アドレスにハッシュを含められるようにした

Location:
OpenPNE3/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/config/OpenPNE.yml.sample

    r12215 r12228  
    1717
    1818# メール投稿アドレスにメンバー毎にユニークなハッシュを含める
    19 # Contain an individual hash to an e-mail address that is used for posting something to the SNS
    20 is_mail_address_contain_hash: false
     19# Contain an individual hash for an e-mail address that is used to post something to the SNS
     20is_mail_address_contain_hash: true
     21
     22# メール投稿アドレスのハッシュの長さ
     23# Length of hash for an e-mail address for posting
     24mail_address_hash_length: 12
    2125
    2226
     
    3135  options:
    3236
     37
    3338######################################
    3439# プロキシ (Proxy)
  • OpenPNE3/trunk/config/ProjectConfiguration.class.php.sample

    r12227 r12228  
    44sfCoreAutoload::register();
    55
    6 define('OPENPNE_CONFIGURAIOTN_SAMPLE_HASH', '64b6863a70e4a74930c6c00e140d61f7');
     6define('OPENPNE_CONFIGURAIOTN_SAMPLE_HASH', 'ffc9f45bbeb1cb8832c211b87f225c8d');
    77
    88class ProjectConfiguration extends sfProjectConfiguration
  • OpenPNE3/trunk/lib/helper/opUtilHelper.php

    r12056 r12228  
    553553  $files = array_merge(array(sfConfig::get('sf_apps_dir').$configPath), $configuration->globEnablePlugin('/apps'.$configPath));
    554554
     555  $user = sfContext::getInstance()->getUser();
     556
     557  if (sfConfig::get('op_is_mail_address_contain_hash') && $user->hasCredential('SNSMember'))
     558  {
     559    $params['hash'] = $user->getMember()->getMailAddressHash();
     560  }
     561
    555562  $routing = new opMailRouting(new sfEventDispatcher());
    556563  $config = new sfRoutingConfigHandler();
  • OpenPNE3/trunk/lib/model/doctrine/Member.class.php

    r12110 r12228  
    265265    return parent::delete($conn);
    266266  }
     267
     268  public function getMailAddressHash($length = null)
     269  {
     270    if (is_null($length))
     271    {
     272      $length = sfConfig::get('op_mail_address_hash_length', 12);
     273    }
     274
     275    $hash = $this->getConfig('mail_address_hash');
     276    if (!$hash)
     277    {
     278      $hash = md5(strval($this->id).$this->getConfig('password'));
     279    }
     280
     281    return substr($hash, 0, (int)$length);
     282  }
    267283}
  • OpenPNE3/trunk/lib/model/doctrine/MemberImage.class.php

    r11479 r12228  
    1818    }
    1919
    20     $primaryImage = $this->Member->Image;
     20    $primaryImage = $this->Member->MemberImage;
    2121    if ($primaryImage)
    2222    {
  • OpenPNE3/trunk/lib/routing/opMailRoute.class.php

    r11786 r12228  
    2828      {
    2929        $this->member = $config->getMember();
     30        if (isset($this->requirements['hash']))
     31        {
     32          $hash = $this->member->getMailAddressHash();
     33          if (!isset($this->parameters['hash']) || $hash !== $this->parameters['hash'])
     34          {
     35            $this->member = null;
     36          }
     37        }
    3038      }
    3139    }
Note: See TracChangeset for help on using the changeset viewer.