✏️ 编辑:opAuthValidatorMemberConfigAndPassword.class.php
路径:
/virtual/bigbrother/sns/lib/validator/opAuthValidatorMemberConfigAndPassword.class.php
大小:1.35 KB · 修改:2010-08-10 13:59:42 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php /** * This file is part of the OpenPNE package. * (c) OpenPNE Project (http://www.openpne.jp/) * * For the full copyright and license information, please view the LICENSE * file and the NOTICE file that were distributed with this source code. */ /** * opAuthValidatorMemberConfigAndPassword * * @package OpenPNE * @subpackage validator * @author Kousuke Ebihara <ebihara@tejimaya.com> */ class opAuthValidatorMemberConfigAndPassword extends opAuthValidatorMemberConfig { /** * @see opAuthValidatorMemberConfig */ protected function configure($options = array(), $messages = array()) { parent::configure($options, $messages); $this->setMessage('invalid', 'ID or password is not a valid.'); } /** * @see opAuthValidatorMemberConfig */ protected function doClean($values) { opActivateBehavior::disable(); $values = parent::doClean($values); if (empty($values['member']) || !($values['member'] instanceof Member)) { throw new sfValidatorError($this, 'invalid'); opActivateBehavior::enable(); } $valid_password = MemberConfigPeer::retrieveByNameAndMemberId('password', $values['member']->getId())->getValue(); opActivateBehavior::enable(); if (md5($values['password']) !== $valid_password) { throw new sfValidatorError($this, 'invalid'); } return $values; } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF