Add fixed userlist templates

feature/node-rewrite
Sven Slootweg 12 years ago
parent 5ceb711b64
commit 6389096941

@ -28,6 +28,7 @@ title-login; Login to your VPS panel
title-reinstall; Reinstall your VPS
title-password; Set new root password
title-console; Out-of-band console
title-admin-userlist; User overview
button-login; Login
button-reinstall; Reinstall
@ -104,3 +105,11 @@ console-title-hostname; Hostname
console-title-port; Port
console-title-username; Username
console-title-password; Password
admin-title-username; Username
admin-title-email; Email address
admin-title-accesslevel; Access level
admin-level-enduser; End user
admin-level-reseller; Reseller
admin-level-nodeadmin; Node administrator
admin-level-masteradmin; Master administrator

@ -0,0 +1,31 @@
<?php
/*
* CVM is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
$result = mysql_query_cached("SELECT * FROM users");
$sUserList = array();
foreach($result->data as $row)
{
$sUserEntry = new User($row);
$sUserList[] = array(
'id' => $sUserEntry->sId,
'username' => $sUserEntry->sUsername,
'email' => $sUserEntry->sEmailAddress,
'accesslevel' => $sUserEntry->sAccessLevel
);
}
$sPageContents = Templater::InlineRender("admin.users", $locale->strings, array(
'users' => $sUserList
));

@ -0,0 +1,26 @@
<h2><%!title-admin-userlist></h2>
<table class="userlist">
<tr>
<th><%!admin-title-username></th>
<th><%!admin-title-email></th>
<th><%!admin-title-accesslevel></th>
</tr>
<%foreach user in users>
<tr class="clickable" data-url="/admin/user/<%?user[id]>/">
<td><%?user[username]></td>
<td><%?user[email]></td>
<td>
<%if user[accesslevel] == 1>
<%!admin-level-enduser>
<%/if><%if user[accesslevel] == 10>
<%!admin-level-reseller>
<%/if><%if user[accesslevel] == 20>
<%!admin-level-nodeadmin>
<%/if><%if user[accesslevel] == 30>
<%!admin-level-masteradmin>
<%/if>
</td>
</tr>
<%/foreach>
</table>
Loading…
Cancel
Save