users.html.php 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <h2 class="post-index"><?php echo i18n('Manage_users'); ?></h2>
  3. <br>
  4. <a class="btn btn-primary right" href="<?php echo site_url();?>admin/add/user"><?php echo i18n('Add_user');?></a>
  5. <br><br>
  6. <?php
  7. $users = glob('config/users/*.ini', GLOB_NOSORT);
  8. ksort($users);
  9. ?>
  10. <table class="table post-list">
  11. <thead>
  12. <tr class="head">
  13. <th><?php echo i18n('username');?></th>
  14. <th><?php echo i18n('role');?></th>
  15. <th><?php echo i18n('Operations');?></th>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. <?php foreach ($users as $u): ?>
  20. <?php $username = pathinfo($u, PATHINFO_FILENAME); $role = user('role', $username);?>
  21. <tr>
  22. <td><?php echo $username; ?></td>
  23. <td><?php echo $role; ?></td>
  24. <td><a class="btn btn-primary btn-xs" href="<?php echo site_url() . 'admin/users/' . $username;?>/edit?destination=admin/users"><?php echo i18n('Edit');?></a> <?php if ($role !== 'admin'):?><a class="btn btn-danger btn-xs" href="<?php echo site_url() . 'admin/users/' . $username;?>/delete?destination=admin/users"><?php echo i18n('Delete');?></a><?php endif;?></td>
  25. </tr>
  26. <?php endforeach; ?>
  27. </tbody>
  28. </table>