bludit/bl-kernel/admin/views/users.php

56 lines
1.9 KiB
PHP
Raw Permalink Normal View History

<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
2015-10-19 00:45:58 +02:00
<?php
2015-05-05 03:00:01 +02:00
2019-05-18 11:54:39 +02:00
echo Bootstrap::pageTitle(array('title'=>$L->g('Users'), 'icon'=>'users'));
2015-05-05 03:00:01 +02:00
echo Bootstrap::link(array(
'title'=>$L->g('add-a-new-user'),
'href'=>HTML_PATH_ADMIN_ROOT.'new-user',
'icon'=>'plus'
));
2015-10-19 00:45:58 +02:00
echo '
<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>
<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>
<th class="border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Registered').'</th>
</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>';
2019-03-07 16:13:47 +01:00
echo '<td><img class="profilePicture mr-1" alt="" src="'.(Sanitize::pathFile(PATH_UPLOADS_PROFILES.$user->username().'.png')?DOMAIN_UPLOADS_PROFILES.$user->username().'.png':HTML_PATH_CORE_IMG.'default.svg').'" /><a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$username.'">'.$username.'</a></td>';
2018-11-09 00:59:06 +01:00
echo '<td class="d-none d-lg-table-cell">'.$user->nickname().'</td>';
2018-07-25 23:42:00 +02:00
echo '<td>'.$user->email().'</td>';
echo '<td>'.($user->enabled()?'<b>'.$L->g('Enabled').'</b>':$L->g('Disabled')).'</td>';
if ($user->role()=='admin') {
echo '<td>'.$L->g('Administrator').'</td>';
} elseif ($user->role()=='editor') {
echo '<td>'.$L->g('Editor').'</td>';
2019-05-18 11:54:39 +02:00
} elseif ($user->role()=='author') {
echo '<td>'.$L->g('Author').'</td>';
2018-07-25 23:42:00 +02:00
} else {
echo '<td>'.$L->g('Reader').'</td>';
}
echo '<td class="d-none d-lg-table-cell">'.Date::format($user->registered(), DB_DATE_FORMAT, ADMIN_PANEL_DATE_FORMAT).'</td>';
echo '</tr>';
} catch (Exception $e) {
// Continue
2018-06-25 23:17:43 +02:00
}
2015-10-19 00:45:58 +02:00
}
echo '
</tbody>
2015-10-19 00:45:58 +02:00
</table>
';