Esempio n. 1
0
 public function change_mobile()
 {
     $userModel = new \Common\Model\UserModel();
     $mobile = I('post.mobile');
     if (!session('verify_old')) {
         $this->ajaxReturn(array('ok' => 0, 'message' => '短信验证未通过,请刷新页面重试'));
     }
     if ($userModel->verifyCode($mobile, I('post.verify_new')) === true && $userModel->changeMobile($this->user['mobile'], $mobile, 0) && $userModel->changeMobile($this->user['mobile'], $mobile, 1) && $userModel->changeMobile($this->user['mobile'], $mobile, 2)) {
         session('verify_old', false);
         $this->ajaxReturn(array('ok' => 1));
     } else {
         $this->ajaxReturn(array('ok' => 0, 'message' => $userModel->getError()));
     }
 }
Esempio n. 2
0
 public function changeMobile()
 {
     $uid = I('uid', 0, 'intval');
     $user = M('user')->find($uid) or $this->error('找不到此用户信息!');
     if (IS_POST) {
         $model = new \Common\Model\UserModel();
         $model->changeMobile($user['mobile'], I('mobile'), 3) or $this->error($model->getError());
         $this->success('手机号已成功更换为:' . I('mobile'));
         exit;
     }
     $this->assign('info', $user);
     $this->meta_title = '更换手机号';
     $this->display();
 }