@@ -14,8 +14,12 @@ require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if ($dopost == 'add') { | if ($dopost == 'add') { | ||||
CheckCSRF(); | CheckCSRF(); | ||||
if (preg_match("#[^0-9a-zA-Z_@!\.-]#", $pwd) || preg_match("#[^0-9a-zA-Z_@!\.-]#", $userid)) { | |||||
ShowMsg('密码或账号不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | |||||
if (preg_match("#[^0-9a-zA-Z_@!\.-]#", $userid)) { | |||||
ShowMsg('账号不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | |||||
exit(); | |||||
} | |||||
if ($pwd != '' && preg_match("#[^0-9a-zA-Z_@!\.-]#", $pwd)) { | |||||
ShowMsg('密码不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$safecodeok = substr(md5($cfg_cookie_encode.$randcode), 0, 24); | $safecodeok = substr(md5($cfg_cookie_encode.$randcode), 0, 24); | ||||
@@ -16,14 +16,14 @@ $id = preg_replace("#[^0-9]#", '', $id); | |||||
if ($dopost == 'saveedit') { | if ($dopost == 'saveedit') { | ||||
CheckCSRF(); | CheckCSRF(); | ||||
$pwd = trim($pwd); | $pwd = trim($pwd); | ||||
if ($pwd != '' && preg_match("#[^0-9a-zA-Z_@!\.-]#", $pwd)) { | |||||
ShowMsg('密码不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | |||||
exit(); | |||||
} | |||||
if (preg_match("#[^0-9a-zA-Z_@!\.-]#", $userid)) { | if (preg_match("#[^0-9a-zA-Z_@!\.-]#", $userid)) { | ||||
ShowMsg('账号不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | ShowMsg('账号不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | ||||
exit(); | exit(); | ||||
} | } | ||||
if ($pwd != '' && preg_match("#[^0-9a-zA-Z_@!\.-]#", $pwd)) { | |||||
ShowMsg('密码不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | |||||
exit(); | |||||
} | |||||
$safecodeok = substr(md5($cfg_cookie_encode.$randcode), 0, 24); | $safecodeok = substr(md5($cfg_cookie_encode.$randcode), 0, 24); | ||||
if ($safecodeok != $safecode) { | if ($safecodeok != $safecode) { | ||||
ShowMsg("请填写正确的验证安全码", "sys_admin_user_edit.php?id={$id}&dopost=edit"); | ShowMsg("请填写正确的验证安全码", "sys_admin_user_edit.php?id={$id}&dopost=edit"); | ||||
@@ -84,12 +84,12 @@ | |||||
</div> | </div> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
<label for="adminuser" class="form-label">管理员账号</label> | <label for="adminuser" class="form-label">管理员账号</label> | ||||
<input type="text" name="adminuser" id="adminuser" class="form-control" placeholder="admin"> | |||||
<input type="text" name="adminuser" id="adminuser" class="form-control" placeholder="admin" onkeyup="this.value=this.value.replace(/[^0-9a-zA-Z_@!\.-]/g,'');"> | |||||
<div class="form-text">请使用数字0-9小写a-z大写A-Z符号_@!.-</div> | <div class="form-text">请使用数字0-9小写a-z大写A-Z符号_@!.-</div> | ||||
</div> | </div> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
<label for="adminpwd" class="form-label">管理员密码</label> | <label for="adminpwd" class="form-label">管理员密码</label> | ||||
<input type="text" name="adminpwd" id="adminpwd" class="form-control" placeholder="admin"> | |||||
<input type="text" name="adminpwd" id="adminpwd" class="form-control" placeholder="admin" onkeyup="this.value=this.value.replace(/[^0-9a-zA-Z_@!\.-]/g,'');"> | |||||
<div class="form-text">请使用数字0-9小写a-z大写A-Z符号_@!.-</div> | <div class="form-text">请使用数字0-9小写a-z大写A-Z符号_@!.-</div> | ||||
</div> | </div> | ||||
<div class="text-right"><button type="submit" class="btn btn-success">安装</button></div> | <div class="text-right"><button type="submit" class="btn btn-success">安装</button></div> | ||||
@@ -51,8 +51,12 @@ if ($step == 1) { | |||||
ShowMsg('账号不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | ShowMsg('账号不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | ||||
exit(); | exit(); | ||||
} | } | ||||
if ($userpwd != '' && preg_match("#[^0-9a-zA-Z_@!\.-]#", $userpwd)) { | |||||
ShowMsg('密码不合法,请使用数字0-9小写a-z大写A-Z符号_@!.-', '-1'); | |||||
exit(); | |||||
} | |||||
if ($pwdc != $pwd) { | if ($pwdc != $pwd) { | ||||
ShowMsg('您两次输入的密码不一致', '-1'); | |||||
ShowMsg('您两次输入的密码不一致,请重新输入', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$uname = HtmlReplace($uname, 1); | $uname = HtmlReplace($uname, 1); | ||||