From b5d7b58339f3ca6ceca3ec1883cab73a3dc07cdb Mon Sep 17 00:00:00 2001 From: Wesley-Chen-CN <53719705+Wesley-Chen-CN@users.noreply.github.com> Date: Fri, 22 Mar 2024 22:32:22 +0800 Subject: [PATCH] Update userinfo.php (#998) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复将admin添加到不排名后,管理员不能查看自己的个人信息。 --- trunk/web/userinfo.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trunk/web/userinfo.php b/trunk/web/userinfo.php index 1a1f7ce901a..b6dd290100d 100644 --- a/trunk/web/userinfo.php +++ b/trunk/web/userinfo.php @@ -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){