RegisterModel::isValidPassword PHP Method

isValidPassword() public method

验证密码内容的正确性
public isValidPassword ( string $pwd, string $repwd ) : boolean
$pwd string 密码信息
$repwd string 确认密码信息
return boolean 是否验证成功
    public function isValidPassword($pwd, $repwd)
    {
        $res = true;
        $length = strlen($pwd);
        if ($length < 6) {
            $this->_error = L('PUBLIC_PASSWORD_TIPS');
            // 密码太短了,最少6位
            $res = false;
        } elseif ($length > 15) {
            $this->_error = '密码太长了,最多15位';
            $res = false;
        } elseif ($pwd !== $repwd) {
            $this->_error = L('PUBLIC_PASSWORD_UNSIMILAR');
            // 新密码与确认密码不一致
            $res = false;
        }
        return $res;
    }