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

Changeset 10679


Ignore:
Timestamp:
Feb 6, 2009, 4:48:25 PM (12 years ago)
Author:
ebihara
Message:

#3262,#3263:reverted r10620 and r10628

Location:
OpenPNE3/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/i18n/messages.ja.xml

    r10634 r10679  
    292292      </trans-unit>
    293293      <trans-unit id="">
    294         <source>Please input by a-z or A-Z or 6-12 characters and 6-12 length.</source>
    295         <target>6~12文字の半角英数で入力してください。</target>
    296       </trans-unit>
    297       <trans-unit id="">
    298294        <source>Message(Arbitrary)</source>
    299295        <target>メッセージ(任意)</target>
  • OpenPNE3/trunk/apps/pc_frontend/i18n/messages.ja.xml

    r10675 r10679  
    468468      </trans-unit>
    469469      <trans-unit id="">
    470         <source>Please input by a-z or A-Z or 6-12 characters and 6-12 length.</source>
    471         <target>6~12文字の半角英数で入力してください。</target>
    472       </trans-unit>
    473       <trans-unit id="">
    474470        <source>Message(Arbitrary)</source>
    475471        <target>メッセージ(任意)</target>
  • OpenPNE3/trunk/lib/config/config/member_config.yml

    r10628 r10679  
    4848    Caption:    "Password"
    4949    FormType:   "password"
    50     ValueType:  "string"
     50    ValueType:  "password"
    5151    IsRegist:   true
    5252    IsConfig:   true
  • OpenPNE3/trunk/lib/form/MemberConfigForm.class.php

    r10620 r10679  
    8787      $this->widgetSchema->setLabel($name.'_confirm', $config['Caption'].' (Confirm)');
    8888
    89       $this->mergePostValidator(new sfValidatorSchemaCompare($name.'_confirm', '==', $name));
     89      $this->mergePostValidator(new sfValidatorSchemaCompare($name, '==', $name.'_confirm'));
    9090    }
    9191
  • OpenPNE3/trunk/lib/form/MemberConfigForm/MemberConfigPasswordForm.class.php

    r10620 r10679  
    2323  {
    2424    $this->setWidget('now_password', new sfWidgetFormInputPassword());
    25     $this->setValidator(
    26       'now_password',
    27       new sfValidatorCallback(
    28         array('callback' => array($this, 'isValidNowPassword'), 'required' => true)
    29       )
    30     );
     25    $this->setValidator('now_password', new sfValidatorCallback(array('callback' => array($this, 'isValidPassword'))));
    3126    $this->widgetSchema->setLabel('now_password', 'Your current password');
    3227  }
    3328
    34   public function setMemberConfigWidget($name)
    35   {
    36     $result = parent::setMemberConfigWidget($name);
    37 
    38     if ($name === 'password')
    39     {
    40       $this->setValidator( $name, new sfValidatorCallback(array(
    41         'callback'  => array($this, 'isValidPassword'),
    42         'required' => true
    43       )));
    44     }
    45 
    46     return $result;
    47   }
    48 
    49   public function isValidNowPassword($validator, $value)
     29  public function isValidPassword($validator, $value)
    5030  {
    5131    $member = sfContext::getInstance()->getUser()->getMember();
    5232    if (md5($value) !== MemberConfigPeer::retrieveByNameAndMemberId('password', $member->getId())->getValue())
    5333    {
    54       throw new sfValidatorError(new sfValidatorPass(), 'Invalid.', array('value' => $value));
     34      throw new sfValidatorError(new sfValidatorPass(), 'invalid', array('value' => $value));
    5535    }
    5636
    5737    return $value;
    5838  }
    59 
    60   public function isValidPassword($validator, $value)
    61   {
    62     $size = strlen($value);
    63     if (!preg_match("/^[a-zA-Z0-9]+$/", $value) || $size < 6 || $size > 12)
    64     {
    65       throw new sfValidatorError(new sfValidatorPass(), 'Please input by a-z or A-Z or 6-12 characters and 6-12 length.', array('value' => $value));
    66     }
    67 
    68     return $value;
    69   }
    70 
    71   public function save()
    72   {
    73     $this->values['password'] = md5($this->values['password']);
    74     parent::save();
    75   }
    7639}
Note: See TracChangeset for help on using the changeset viewer.