2018-11-07 15:40:22 +01:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
|
|
|
|
|
2021-02-07 18:22:20 +01:00
|
|
|
<script>
|
|
|
|
// ============================================================================
|
|
|
|
// Variables for the view
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions for the view
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Events for the view
|
|
|
|
// ============================================================================
|
|
|
|
$(document).ready(function() {
|
|
|
|
// No events for the view yet
|
|
|
|
});
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Initialization for the view
|
|
|
|
// ============================================================================
|
|
|
|
$(document).ready(function() {
|
|
|
|
// No initialization for the view yet
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2021-01-12 21:46:42 +01:00
|
|
|
<div class="d-flex align-items-center mb-4">
|
|
|
|
<h2 class="m-0"><i class="bi bi-people"></i><?php $L->p('Users') ?></h2>
|
|
|
|
<div class="ms-auto">
|
|
|
|
<a id="btnNew" class="btn btn-primary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT . 'add-user' ?>" role="button"><i class="bi bi-plus-circle"></i><?php $L->p('Add a new user') ?></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-10-19 00:45:58 +02:00
|
|
|
|
2021-01-12 21:46:42 +01:00
|
|
|
<?php
|
2015-10-19 00:45:58 +02:00
|
|
|
echo '
|
2018-04-15 22:23:11 +02:00
|
|
|
<table class="table table-striped mt-3">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="border-bottom-0" scope="col">'.$L->g('Username').'</th>
|
2018-11-09 00:59:06 +01:00
|
|
|
<th class="border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Nickname').'</th>
|
2018-04-15 22:23:11 +02:00
|
|
|
<th class="border-bottom-0" scope="col">'.$L->g('Email').'</th>
|
|
|
|
<th class="border-bottom-0" scope="col">'.$L->g('Status').'</th>
|
|
|
|
<th class="border-bottom-0" scope="col">'.$L->g('Role').'</th>
|
2018-04-27 20:36:43 +02:00
|
|
|
<th class="border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Registered').'</th>
|
2018-04-15 22:23:11 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2015-10-19 00:45:58 +02:00
|
|
|
';
|
|
|
|
|
2018-08-03 18:59:23 +02:00
|
|
|
$list = $users->keys();
|
2018-07-25 23:42:00 +02:00
|
|
|
foreach ($list as $username) {
|
|
|
|
try {
|
|
|
|
$user = new User($username);
|
|
|
|
echo '<tr>';
|
2021-05-17 20:04:59 +02:00
|
|
|
echo '<td class="pt-4 pb-4"><a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$username.'">'.$username.'</a></td>';
|
|
|
|
echo '<td class="pt-4 pb-4 d-none d-lg-table-cell">'.$user->nickname().'</td>';
|
|
|
|
echo '<td class="pt-4 pb-4">'.$user->email().'</td>';
|
|
|
|
echo '<td class="pt-4 pb-4">'.($user->enabled()?'<b>'.$L->g('Enabled').'</b>':'<b class="text-danger">'.$L->g('Disabled').'</b>').'</td>';
|
2018-07-25 23:42:00 +02:00
|
|
|
if ($user->role()=='admin') {
|
2021-05-17 20:04:59 +02:00
|
|
|
echo '<td class="pt-4 pb-4">'.$L->g('Administrator').'</td>';
|
2018-07-25 23:42:00 +02:00
|
|
|
} elseif ($user->role()=='editor') {
|
2021-05-17 20:04:59 +02:00
|
|
|
echo '<td class="pt-4 pb-4">'.$L->g('Editor').'</td>';
|
2019-05-18 11:54:39 +02:00
|
|
|
} elseif ($user->role()=='author') {
|
2021-05-17 20:04:59 +02:00
|
|
|
echo '<td class="pt-4 pb-4">'.$L->g('Author').'</td>';
|
2018-07-25 23:42:00 +02:00
|
|
|
} else {
|
2021-05-17 20:04:59 +02:00
|
|
|
echo '<td class="pt-4 pb-4">'.$L->g('Reader').'</td>';
|
2018-07-25 23:42:00 +02:00
|
|
|
}
|
2021-05-17 20:04:59 +02:00
|
|
|
echo '<td class="pt-4 pb-4 d-none d-lg-table-cell">'.Date::format($user->registered(), DB_DATE_FORMAT, ADMIN_PANEL_DATE_FORMAT).'</td>';
|
2018-07-25 23:42:00 +02:00
|
|
|
echo '</tr>';
|
|
|
|
} catch (Exception $e) {
|
|
|
|
// Continue
|
2018-06-25 23:17:43 +02:00
|
|
|
}
|
2015-10-19 00:45:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '
|
2018-04-15 22:23:11 +02:00
|
|
|
</tbody>
|
2015-10-19 00:45:58 +02:00
|
|
|
</table>
|
2018-04-15 22:23:11 +02:00
|
|
|
';
|