summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-20 15:00:34 +0100
committerSimon Rettberg2023-11-20 15:00:34 +0100
commit9da6f0513a1862a0c8550944c0dce6a57fc44a8a (patch)
treea16383475ac08e17d9341173cc48ce582e1a2842
parent[vmstore] Fix invalid array access (diff)
downloadslx-admin-9da6f0513a1862a0c8550944c0dce6a57fc44a8a.tar.gz
slx-admin-9da6f0513a1862a0c8550944c0dce6a57fc44a8a.tar.xz
slx-admin-9da6f0513a1862a0c8550944c0dce6a57fc44a8a.zip
[session] Show username in session table, link to editor
-rw-r--r--modules-available/session/page.inc.php8
-rw-r--r--modules-available/session/templates/change-password.html12
2 files changed, 16 insertions, 4 deletions
diff --git a/modules-available/session/page.inc.php b/modules-available/session/page.inc.php
index 9ced405a..5f5e5d28 100644
--- a/modules-available/session/page.inc.php
+++ b/modules-available/session/page.inc.php
@@ -65,7 +65,10 @@ class Page_Session extends Page
protected function doRender()
{
if (User::isLoggedIn()) {
- $res = Database::simpleQuery("SELECT userid, dateline, lastip, fixedip FROM session ORDER BY dateline DESC");
+ $res = Database::simpleQuery("SELECT u.login, s.userid, s.dateline, s.lastip, s.fixedip
+ FROM session s
+ INNER JOIN user u USING (userid)
+ ORDER BY dateline DESC");
$sessions = [];
$perm = User::hasPermission('.adduser.user.*');
foreach ($res as $row) {
@@ -74,7 +77,8 @@ class Page_Session extends Page
$sessions[] = $row;
}
}
- Render::addTemplate('change-password', ['sessions' => $sessions]);
+ Render::addTemplate('change-password', ['sessions' => $sessions,
+ 'link' => User::hasPermission('.adduser.user.edit')]);
} else {
Render::addTemplate('page-login');
}
diff --git a/modules-available/session/templates/change-password.html b/modules-available/session/templates/change-password.html
index fa61fd77..9f19c695 100644
--- a/modules-available/session/templates/change-password.html
+++ b/modules-available/session/templates/change-password.html
@@ -18,7 +18,7 @@
<table class="table">
<thead>
<tr>
- <th>{{lang_uid}}</th>
+ <th>{{lang_user}}</th>
<th>{{lang_expires}}</th>
<th>{{lang_lastAddress}}</th>
<th class="slx-smallcol">{{lang_fixedIpSession}}</th>
@@ -27,7 +27,15 @@
<tbody>
{{#sessions}}
<tr>
- <td>{{userid}}</td>
+ <td>
+ {{#link}}
+ <a href="?do=adduser&amp;show=edituser&amp;userid={{userid}}">
+ {{/link}}
+ {{login}}
+ {{#link}}
+ </a>
+ {{/link}}
+ </td>
<td>{{dateline_s}}</td>
<td>{{lastip}}</td>
<td class="text-nowrap">