Topic: User list for logged-in users only
Greetings All,
I'm new to Monstra. I was able to find and edit the index.view.php file located in: root/plugins/box/users/views/frontend/
A simple fix prevents Non-logged in individuals from seeing the list of users -- substitute the below code or adapt as needed.
I would still like to disable the "Users" menu item (if not logged-in), but I'm not sure how to do that yet!
<table> <tr> <td></td> </tr> <?php if (Session::exists('user_role')) { // you must be logged in foreach ($users as $user) { ?> <tr> <td> <a href="<?php echo Site::url(); ?>/users/<?php echo $user['id']; ?>"><?php echo $user['login']; ?></a> </td> </tr> <?php } } else { echo "You must be logged in to view this page!"; } ?> </table>