Skip to content

Commit

Permalink
Update userinfo.php (#998)
Browse files Browse the repository at this point in the history
修复将admin添加到不排名后,管理员不能查看自己的个人信息。
  • Loading branch information
Wesley-Chen-CN authored Mar 22, 2024
1 parent 81de37a commit b5d7b58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion trunk/web/userinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
}

$view_title=$user ."@".$OJ_NAME;
$sql="SELECT `school`,`email`,`nick` FROM `users` WHERE `user_id`=? and user_id not in ($OJ_RANK_HIDDEN) ";
if(isset($_SESSION[$OJ_NAME.'_'.'administrator']))
$sql="SELECT `school`,`email`,`nick` FROM `users` WHERE `user_id`=? ";
else
$sql="SELECT `school`,`email`,`nick` FROM `users` WHERE `user_id`=? and user_id not in ($OJ_RANK_HIDDEN) ";
$result=pdo_query($sql,$user);
$row_cnt=count($result);
if ($row_cnt==0){
Expand Down

0 comments on commit b5d7b58

Please sign in to comment.