修复修改密码会把昵称一起改掉的BUG
This commit is contained in:
@@ -27,7 +27,7 @@ if (isset($OJ_LANG)) {
|
|||||||
$passwd = $_POST['passwd'];
|
$passwd = $_POST['passwd'];
|
||||||
$nick = $_POST['nick'];
|
$nick = $_POST['nick'];
|
||||||
|
|
||||||
if ($nick != "") {
|
if (isset($nick) && $nick != "") {
|
||||||
$sql = "update `users` set `nick`=? where `user_id`=? and user_id not in( select user_id from privilege where rightstr='administrator')";
|
$sql = "update `users` set `nick`=? where `user_id`=? and user_id not in( select user_id from privilege where rightstr='administrator')";
|
||||||
pdo_query($sql, $nick, $user_id);
|
pdo_query($sql, $nick, $user_id);
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ if (isset($OJ_LANG)) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($passwd != "") {
|
if (isset($passwd) && $passwd != "") {
|
||||||
$passwd = pwGen($passwd);
|
$passwd = pwGen($passwd);
|
||||||
$sql = "update `users` set `password`=? where `user_id`=? and user_id not in( select user_id from privilege where rightstr='administrator')";
|
$sql = "update `users` set `password`=? where `user_id`=? and user_id not in( select user_id from privilege where rightstr='administrator')";
|
||||||
|
|
||||||
@@ -59,8 +59,8 @@ if (isset($OJ_LANG)) {
|
|||||||
value="<?php echo htmlentities($_POST['user_id'], ENT_QUOTES, 'UTF-8'); ?>" type="text" required>
|
value="<?php echo htmlentities($_POST['user_id'], ENT_QUOTES, 'UTF-8'); ?>" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<div class="col-sm-3"><input name="user_id" class="form-control" placeholder="<?php echo $MSG_USER_ID . "*" ?>"
|
<div class="col-sm-3"><input name="user_id" class="form-control"
|
||||||
type="text" required></div>
|
placeholder="<?php echo $MSG_USER_ID . "*" ?>" type="text" required></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user