public function addUserInfoAction() { if ($this->request->isPost() == true) { if (!$this->validFlag) { echo json_encode(array('ret' => 0, 'msg' => $this->warnMsg)); $this->view->disable(); return; } else { $user = new Users(); $objCaptcha = new Captcha(); $key = 'oauth:' . $this->_sanReq['mobile']; $data = $objCaptcha->checkAllCaptcha($this->_sanReq['mobile'], $this->_sanReq['codeImg'], $key, $this->_sanReq['regtype'], $this->_sanReq['captcha']); if ($data == 1) { switch ($this->_sanReq['thirdType']) { case 'qq': $res = $user->qqRegister($this->_sanReq['passwd'], $this->_sanReq['mobile'], $this->_sanReq['email'], $pic = $this->_sanReq['pic'], $this->_sanReq['thirdOpenid']); break; case 'wb': $res = $user->wbRegister($this->_sanReq['passwd'], $this->_sanReq['mobile'], $this->_sanReq['email'], $pic = $this->_sanReq['pic'], $this->_sanReq['thirdOpenid']); break; case 'wx': $res = $user->wxRegister($this->_sanReq['passwd'], $this->_sanReq['mobile'], $this->_sanReq['email'], $pic = $this->_sanReq['pic'], $this->_sanReq['thirdOpenid']); break; case 'alipay': $res = $user->alipayRegister($this->_sanReq['passwd'], $this->_sanReq['mobile'], $this->_sanReq['email'], $pic = $this->_sanReq['pic'], $this->_sanReq['thirdOpenid']); break; default: $res = 0; break; } if ($res == 1) { $objCaptcha->delCaptchaRedisKey($key); echo json_encode(array('ret' => 1)); } elseif ($res == 10002) { echo json_encode(array('ret' => 0, 'msg' => array('mobile' => array('msg' => $this->di['sysconfig']['flagMsg']['10002'])))); } else { echo json_encode(array('ret' => 0, 'msg' => array('service' => array('msg' => $this->di['sysconfig']['flagMsg']['10000'])))); } $this->view->disable(); return; } else { echo json_encode(array('ret' => 0, 'msg' => $data)); $this->view->disable(); return; } } } else { $tmpInfo = $this->cookies->get(substr(md5('tmpQqWb'), 8, 20)); $info = json_decode(base64_decode($tmpInfo->getValue())); switch ($info->type) { case 'qq': $typeMsg = 'QQ'; break; case 'wb': $typeMsg = '微博'; break; case 'wx': $typeMsg = '微信'; break; case 'alipay': $typeMsg = '支付宝'; break; default: $typeMsg = ''; break; } $this->view->setVar('third_type', $info->type); $this->view->setVar('third_openid', $info->uids); $this->view->setVar('pageTitle', "您已成功使用{$typeMsg} 账号登录到云朵,请先完善您的资料"); $this->view->setVar('name', $info->name); $this->view->setVar('pic', $info->pic); $this->view->pick('index/adduserinfo'); } }