Exemplo n.º 1
0
 /** 
  * 检查转换数据
  * 
  * @return boolean|PwError 
  */
 private function check()
 {
     if ($this->_data['groups']) {
         $this->_data['groups'] = implode(',', $this->_data['groups']);
     }
     //【用户资料验证】手机号码格式验证
     if (($_tmp = $this->getField('mobile')) && true !== ($r = PwUserValidator::isMobileValid($_tmp))) {
         return $r;
     }
     //【用户资料验证】固定电话号码格式验证
     if (($_tmp = $this->getField('telphone')) && true !== ($r = PwUserValidator::isTelPhone($_tmp))) {
         return $r;
     }
     //【用户资料验证】邮编格式验证
     if (($_tmp = $this->getField('zipcode')) && false === WindValidator::isZipcode($_tmp)) {
         return new PwError('USER:error.zipcode');
     }
     //【用户资料验证】个人主页长度限制
     if (($_tmp = $this->getField('homepage')) && (false === WindValidator::isUrl($_tmp) || true === WindValidator::isLegalLength($_tmp, 200))) {
         return new PwError('USER:error.homepage');
     }
     //【用户资料验证】自我简介长度限制
     if (($_tmp = $this->getField('profile')) && true === WindValidator::isLegalLength($_tmp, 250)) {
         return new PwError('USER:error.profile.length', array('{length}' => 250));
     }
     //TODO【用户资料验证】BBS签名验证长度判断----后台权限设置
     /*
     if (($_tmp = $this->getField('bbs_sign')) && (true === WindValidator::isLegalLength($_tmp, 500))) {
     	return new PwError('USER:error.bbs_sign.length', array('{length}' => 500));
     }
     */
     return true;
 }