mirror of
https://github.com/ZeroDream-CN/SakuraPanel.git
synced 2026-05-13 17:05:34 +08:00
Feature: Display user's token on profile page
在用户信息页面显示用户的 Token,方便配置客户端
This commit is contained in:
committed by
GitHub
Unverified
parent
96e960a417
commit
350641a13a
+11
-6
@@ -11,12 +11,13 @@ if(!$rs) {
|
|||||||
exit("<script>location='?page=login';</script>");
|
exit("<script>location='?page=login';</script>");
|
||||||
}
|
}
|
||||||
|
|
||||||
$um = new SakuraPanel\UserManager();
|
$um = new SakuraPanel\UserManager();
|
||||||
$ls = $um->getLimit($_SESSION['user']);
|
$ls = $um->getLimit($_SESSION['user']);
|
||||||
$inbound = round($ls['inbound'] / 1024 * 8);
|
$inbound = round($ls['inbound'] / 1024 * 8);
|
||||||
$outbound = round($ls['outbound'] / 1024 * 8);
|
$outbound = round($ls['outbound'] / 1024 * 8);
|
||||||
$speed_limit = "{$inbound}Mbps 上行 / {$outbound}Mbps 下行";
|
$speed_limit = "{$inbound}Mbps 上行 / {$outbound}Mbps 下行";
|
||||||
$signinfo = Database::querySingleLine("sign", Array("username" => $_SESSION['user']));
|
$signinfo = Database::querySingleLine("sign", Array("username" => $_SESSION['user']));
|
||||||
|
$token = Database::querySingleLine("tokens", Array("username" => $_SESSION['user']))["token"] ?? "Unknown";
|
||||||
?>
|
?>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.fix-text p {
|
.fix-text p {
|
||||||
@@ -84,6 +85,10 @@ $signinfo = Database::querySingleLine("sign", Array("username" => $_SESSION['use
|
|||||||
<td style="width: 30%;"><b>用户组别</b></td>
|
<td style="width: 30%;"><b>用户组别</b></td>
|
||||||
<td><?php echo htmlspecialchars($rs['group']); ?></td>
|
<td><?php echo htmlspecialchars($rs['group']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 30%;"><b>访问密钥</b></td>
|
||||||
|
<td><?php echo htmlspecialchars($token); ?></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -156,4 +161,4 @@ $signinfo = Database::querySingleLine("sign", Array("username" => $_SESSION['use
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user