管理后台-用户组-玩家列表敏感信息加密显示

master
zhengchanglong 5 years ago
parent 3f2433fa4a
commit c32c1780e6

@ -585,3 +585,16 @@ function getAllGame()
$list = M("game", 'tab_')->field('relation_game_name as game_name')->group('relation_game_name')->select();
return $list;
}
/**
* 中间加密 替换字符串的子串
*/
function encryptStr($str) {
$length = strlen($str);
$stars_str = "";
for ($x=0; $x<=$length-6; $x++) {
$stars_str = $stars_str."*";
}
return substr_replace($str, $stars_str, 3, $length-6);
}

@ -487,6 +487,7 @@ class MemberController extends ThinkController
if (IS_POST) {
$member = new MemberApi();
$data = $_REQUEST;
unset($data['']);
if (empty($data['password'])) {
unset($data['password']);
}
@ -494,9 +495,9 @@ class MemberController extends ThinkController
$this->error('请填写正确的名字');
}
if (!empty($data['idcard']) && !preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $data['idcard'])) {
/*if (!empty($data['idcard']) && !preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $data['idcard'])) {
$this->error('请输入正确的身份证号码');
}
}*/
$res = $member->updateInfo($data);
if ($res !== false) {
@ -712,6 +713,30 @@ class MemberController extends ThinkController
}
}
public function changepidcard()
{
if (preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $_POST['idcard'])) {
//重复判断
$where['idcard'] = $_POST['idcard'];
/*$user = M('User', 'tab_')->where($where)->field('id,account')->find();
if ($user) {
$this->ajaxReturn(array("status" => 0, "msg" => "该身份证号码已被" . $user['account'] . "(" . $user['id'] . ")绑定"));
}*/
$map['id'] = $_POST['id'];
$pro = M("User", "tab_")
->where($map)
->setField('idcard', $_POST['idcard']);
if ($pro !== false) {
$this->ajaxReturn(array("status" => 1, "msg" => "身份证号码修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "身份证号码修改失败"));
}
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "请输入正确的身份证号码"));
}
}
public function denglu($p = 1)
{
$map['user_id'] = $_REQUEST['id'];

@ -113,11 +113,8 @@
<tr>
<td class="l">身份证号</td>
<td class="r">
<if condition="$data['idcard'] eq null">
<input type="text" class="txt" name="idcard" value="">
<else/>
<input type="text" class="txt" name="idcard" value="{$data['idcard']}">
</if>
<input type="text" class="txt" value="{$data['idcard']|encryptStr}" readonly>
<span id="idcard" class="table_click"><span class="table_click_text inner-click-text">点击修改</span></span>
</td>
</tr>
<tr>
@ -133,7 +130,7 @@
<tr>
<td class="l noticeinfo">手机号码</td>
<td class="r pr">
<input type="text" class="txt " name="phone" value="{$data['phone']}" placeholder="暂无手机号码"
<input type="text" class="txt " value="{$data['phone']|encryptStr}" placeholder="暂无手机号码"
readonly>
<span id="phone" class="table_click"><span class="table_click_text inner-click-text">点击修改</span></span>
<span class="notice-text">玩家绑定的手机号,可通过点击修改,更换玩家的绑定手机(慎重使用)<span>
@ -238,7 +235,6 @@
</form>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
@ -247,7 +243,6 @@
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
@ -359,6 +354,42 @@
content: [url + 'admin.php?s=/Member/bind_balance/id/' + id + '', 'no']
});
});
$("#idcard").click(function () {
layer.prompt({
formType: 3,
title: "请输入身份证号码",
value: ''
}, function (idcard) {
var jsid = $('#selfid').val();
var regIdNo = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(!regIdNo.test(idcard)){
layer.msg("身份证号填写有误");
return false;
}
$.ajax({
url: '{:U("changepidcard")}',
type: 'post',
dataType: 'json',
data: {idcard:idcard,id:jsid},
success: function (data) {
if (data.status > 0) {
layer.msg(data.msg)
setTimeout(function(){
self.location.reload(true);
},1500);
} else {
layer.msg(data.msg)
}
},
error: function () {
alert("服务器故障!");
}
});
});
});
$("#phone").click(function () {
layer.prompt({
formType: 3,

@ -284,7 +284,7 @@
<span class="login_old">{$data['login_time']|date='Y-m-d H:i:s',###}</span>
</if>
</td>
<td >{$data.device_number}</td>
<td >{$data.device_number|encryptStr}</td>
<if condition="get_info_status($data['lock_status'],4) eq 锁定">
<td style="color:red;">已{:get_info_status($data['lock_status'],4)}</td>

Loading…
Cancel
Save