public function idCheck()
 {
     $id5tip = '';
     // 开启错误提示
     ini_set('display_errors', 'on');
     error_reporting(E_ALL);
     list($id5enable, $id5arr) = $this->getSetId5();
     $shua = 0;
     if ($id5enable == 0) {
         //echo '实名验证授权没有开启!!!';
         $this->saveid();
         exit;
     } elseif ($id5arr['nums'] > 0) {
         $res = $id5arr['nums'] - $id5arr['unums'] - 1 == 0 ? 2 : 0;
         if ($id5arr['unums'] >= $id5arr['nums']) {
             ajaxmsg('自动认证免费次数已用完,请使用人工认证', 2);
             exit;
         } else {
             $id5tip = ',请检查姓名、身份证号码是否正确!(还有' . ($id5arr['nums'] - $id5arr['unums'] - 1) . '次免费机会)';
         }
     }
     $arr['name'] = $data['real_name'] = text($_POST['real_name']);
     $arr['idcard'] = $data['idcard'] = text($_POST['idcard']);
     $data['up_time'] = time();
     // ///////////////////////
     $data1['idcard'] = text($_POST['idcard']);
     $data1['up_time'] = time();
     $data1['uid'] = $this->uid;
     $data1['status'] = 0;
     $xuid = M('member_info')->getFieldByIdcard($data['idcard'], 'uid');
     if ($xuid > 0 && $xuid != $this->uid) {
         ajaxmsg("此身份证号码已被占用,请确认!", 0);
     }
     // dump(11222);exit;
     $b = M('name_apply')->where("uid = {$this->uid}")->count('uid');
     if (0 < $b) {
         M('name_apply')->where("uid ={$this->uid}")->save($data1);
     } else {
         M('name_apply')->add($data1);
     }
     if (empty($data['real_name']) || empty($data['idcard'])) {
         ajaxmsg("请填写真实姓名和身份证号码", $res);
     }
     $c = M('member_info')->where("uid = {$this->uid}")->count('uid');
     if (0 < $c) {
         $newid = M('member_info')->where("uid = {$this->uid}")->save($data);
     } else {
         $data['uid'] = $this->uid;
         $newid = M('member_info')->add($data);
     }
     import("ORG.Io.id5");
     $synPlatApi = new SynPlatAPI();
     try {
         $result = $synPlatApi->getData('1A020201', implode(',', $arr));
         $xml = simplexml_load_string($result);
         M('id5log')->add(array('uid' => $this->uid, 'addtime' => time()));
     } catch (Exception $e) {
         ajaxmsg($e->getMessage(), $res);
         exit;
     }
     if (0 != (int) $xml->message->status) {
         ajaxmsg((string) $xml->message->value . $id5tip, $res);
     } else {
         if (false === empty($xml->policeCheckInfos->policeCheckInfo->compResult) && @(string) $xml->policeCheckInfos->policeCheckInfo->compResult == '一致') {
             $temp = M('members_status')->where("uid={$this->uid}")->find();
             if (is_array($temp)) {
                 $cid['id_status'] = 1;
                 $status = M('members_status')->where("uid={$this->uid}")->save($cid);
             } else {
                 $dt['uid'] = $this->uid;
                 $dt['id_status'] = 1;
                 $status = M('members_status')->add($dt);
             }
             if ($status) {
                 $data2['status'] = 1;
                 $data2['deal_info'] = '会员中心实名认证成功';
                 $new = M("name_apply")->where("uid={$this->uid}")->save($data2);
                 if ($new) {
                     ajaxmsg();
                 }
             } else {
                 $data2['status'] = 0;
                 $data2['deal_info'] = '会员中心实名认证失败' . $id5tip;
                 $new = M("name_apply")->where("uid={$this->uid}")->save($data2);
                 ajaxmsg("认证失败" . $id5tip, $res);
             }
         } else {
             ajaxmsg("认证失败" . $id5tip, $res);
             exit;
             $mm = M('members_status')->where("uid={$this->uid}")->setField('id_status', 3);
             if ($mm == 1) {
                 ajaxmsg('待审核', $res);
             } else {
                 $dt['uid'] = $this->uid;
                 $dt['id_status'] = 3;
                 M('members_status')->add($dt);
                 ajaxmsg('等待审核', $res);
             }
         }
     }
 }
 public function idCheck()
 {
     $this->uid = session('u_id');
     if (!$this->uid) {
         return '请先登录';
     }
     // 开启错误提示
     ini_set('display_errors', 'on');
     error_reporting(E_ALL);
     $id5_config = FS("Webconfig/id5");
     if ($id5_config[enable] == 0) {
         return '实名验证授权没有开启!!!';
     }
     $txtUser = text($_POST['txtUser']);
     $txtCard = text($_POST['txtCard']);
     if (empty($txtUser) || empty($txtCard)) {
         return '请填写真实姓名和身份证号码';
     }
     $xuid = M('member_info')->getFieldByIdcard($txtCard, 'uid');
     if ($xuid > 0 && $xuid != $this->uid) {
         return '此身份证号码已被占用,请确认!';
     }
     import("ORG.Io.id5");
     $synPlatApi = new SynPlatAPI();
     try {
         $result = $synPlatApi->getData('1A020201', implode(',', array($txtUser, $txtCard)));
         $xml = simplexml_load_string($result);
     } catch (Exception $e) {
         return $e->getMessage();
     }
     if (0 != (int) $xml->message->status) {
         return (string) $xml->message->value;
     } else {
         if (false === empty($xml->policeCheckInfos->policeCheckInfo->compResult) && @(string) $xml->policeCheckInfos->policeCheckInfo->compResult == '一致') {
             $temp = M('members_status')->where("uid={$this->uid}")->find();
             if (is_array($temp)) {
                 $cid['id_status'] = 1;
                 $status = M('members_status')->where("uid={$this->uid}")->save($cid);
             } else {
                 $dt['uid'] = $this->uid;
                 $dt['id_status'] = 1;
                 $status = M('members_status')->add($dt);
             }
             $data = array();
             $data['real_name'] = $txtUser;
             $data['idcard'] = $txtCard;
             $data['up_time'] = time();
             $data['uid'] = $this->uid;
             if (M('member_info')->where("uid = {$this->uid}")->count('uid')) {
                 M('member_info')->where("uid = {$this->uid}")->save($data);
             } else {
                 $data['uid'] = $this->uid;
                 M('member_info')->add($data);
             }
             unset($data['real_name']);
             if (M('name_apply')->where("uid = {$this->uid}")->count('uid')) {
                 M('name_apply')->where("uid ={$this->uid}")->save($data);
             } else {
                 M('name_apply')->add($data);
             }
             if ($status) {
                 $data2['status'] = 1;
                 $data2['deal_info'] = '会员中心实名认证成功';
                 $new = M("name_apply")->where("uid={$this->uid}")->save($data2);
                 if ($new) {
                     return true;
                 }
             } else {
                 $data2['status'] = 0;
                 $data2['deal_info'] = '会员中心实名认证失败';
                 M("name_apply")->where("uid={$this->uid}")->save($data2);
                 return '认证失败';
             }
         } else {
             return '认证失败,请检查姓名、身份证号码是否正确!';
         }
     }
 }
Beispiel #3
0
             //重新设置诚信值
             reset_integrity($user_arr);
             MooMessage("恭喜您,验证成功!", "index.php?n=myaccount&h=smsindex", '05');
         }
     }
     $ret = get_auth_string($seqNo, $userCode, $userName, $msisdn);
     include MooTemplate('public/myaccount_sfzsms', 'module');
 } else {
     //高级会员认证免费接口
     $tagValue = "";
     $result = $_MooClass['MooMySQL']->getOne("select sms from {$dbTablePre}certification where uid={$uid}");
     if ($result['sms'] == 1) {
         MooMessage("您已经通过了身份通的验证,无需再次验证!", "index.php?n=myaccount", '05');
     }
     include_once "module/myaccount/SynPlatAPI.php";
     $SynPlatAPI = new SynPlatAPI();
     $userCode = trim($_POST['userCode']);
     //身份证号
     $userName = trim($_POST['userName']);
     //用户名
     //$userName = iconv("utf-8","gbk",$userName);//转换编码
     $param = $userName . "," . $userCode;
     $returnXml = $SynPlatAPI->getData($param);
     //echo $userName.'and'.$userCode;
     // echo $returnXml;exit;
     $realname = $SynPlatAPI->getXmlValueByTag($returnXml, 'name');
     $idcode = $SynPlatAPI->getXmlValueByTag($returnXml, 'identitycard');
     $tagValue = $SynPlatAPI->getXmlValueByTag($returnXml, 'compResult');
     if ($tagValue == "一致") {
         //allotserver($uid);
         //更新身份认证状态