Ejemplo n.º 1
0
 /**
  * 添加替换
  *
  * @param App_Verify_Dm $dm
  * @return bool 
  */
 public function replaceVerify(App_Verify_Dm $dm)
 {
     if (($result = $dm->beforeAdd()) instanceof PwError) {
         return $result;
     }
     return $this->_getDao()->replace($dm->getData());
 }
Ejemplo n.º 2
0
 /**
  * 单条修改
  *
  * @param int $uid
  * @param array $data
  * @return bool
  */
 public function updateVerifyCheck($id, App_Verify_Dm $dm)
 {
     if (($result = $dm->beforeUpdate()) instanceof PwError) {
         return $result;
     }
     return $this->_getDao()->update($id, $dm->getData());
 }
Ejemplo n.º 3
0
 public function verifyRealnameAction()
 {
     $statu = $this->_checkState();
     $realname = trim($this->getInput('realname'));
     if (!$realname) {
         $this->showError('请输入真实姓名');
     }
     if (Pw::strlen($realname) > 50) {
         $this->showError('真实姓名长度不能超过50个字');
     }
     $dm = new App_Verify_Dm();
     $dm->setUid($this->loginUser->uid)->setUsername($this->loginUser->username)->setType(App_Verify::VERIFY_REALNAME)->setData(serialize(array('realname' => $realname)));
     $this->_getService()->addCheck($dm);
     $this->showMessage('success');
 }
Ejemplo n.º 4
0
 public function updateVerifyInfo($uid, $type, $bool = true)
 {
     $result = $this->checkVerifyOpen($type);
     if (!$result) {
         return new PwError('未开启该类型实名认证');
     }
     Wind::import('EXT:verify.service.dm.App_Verify_Dm');
     $dm = new App_Verify_Dm($uid);
     $info = $this->_getDs()->getVerify($uid);
     if (!$info) {
         $dm->setUid($uid)->setType($this->buildVerifyBit(array($type => $bool)));
         $result = $this->_getDs()->addVerify($dm);
         if ($result instanceof PwError) {
             return $result;
         }
     }
     $dm->setBitType($type, $bool);
     $result = $this->_getDs()->updateVerify($uid, $dm);
     if ($result instanceof PwError) {
         return $result;
     }
     return true;
 }