[GH-ISSUE #1254] How to see whom user has logged in now #807

Closed
opened 2026-03-02 16:01:33 +03:00 by kerem · 1 comment
Owner

Originally created by @getsettalk on GitHub (Nov 21, 2024).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1254

Hey @prasathmani this is a great project to manage files and folder .

but in this have some problem is that not showing whom user has logged in currently mean admin, user , guest

you can see in image also popup menu is goes hide :

image

so please add new updates with fixes.

Originally created by @getsettalk on GitHub (Nov 21, 2024). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1254 Hey @prasathmani this is a great project to manage files and folder . but in this have some problem is that not showing whom user has logged in currently mean admin, user , guest you can see in image also popup menu is goes hide : ![image](https://github.com/user-attachments/assets/b758885c-6a69-467c-9b26-d44e8ec52563) so please add new updates with fixes.
kerem closed this issue 2026-03-02 16:01:33 +03:00
Author
Owner

@getsettalk commented on GitHub (Nov 21, 2024):

Yes i got solution:

here is code to use:

// Add this function to your existing code to get the current logged-in user
function getCurrentLoggedInUser()
{
    if (isset($_SESSION[FM_SESSION_ID]['logged'])) {
        return $_SESSION[FM_SESSION_ID]['logged'];
    }
    return null;
}

add those above and below code to see whom user has logged in

   <?php
                    if (FM_USE_AUTH):
                        $current_user = getCurrentLoggedInUser();
                    ?>
                        <li class="nav-item avatar dropdown">
                            <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-5" data-bs-toggle="dropdown" aria-expanded="false">
                                <i class="fa fa-user-circle"></i> <?php echo htmlspecialchars($current_user); ?>
                            </a>
                            <div class="dropdown-menu text-small shadow" aria-labelledby="navbarDropdownMenuLink-5" data-bs-theme="<?php echo FM_THEME; ?>">
                                <?php if (!FM_READONLY): ?>
                                    <a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a>
                                <?php endif ?>
                                <a title="<?php echo lng('Help') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;help=2"><i class="fa fa-exclamation-circle" aria-hidden="true"></i> <?php echo lng('Help') ?></a>
                                <a title="<?php echo lng('Logout') ?>" class="dropdown-item nav-link" href="?logout=1"><i class="fa fa-sign-out" aria-hidden="true"></i> <?php echo lng('Logout') ?></a>
                            </div>
                        </li>

View screenshot:

image

<!-- gh-comment-id:2490204825 --> @getsettalk commented on GitHub (Nov 21, 2024): Yes i got solution: here is code to use: ``` // Add this function to your existing code to get the current logged-in user function getCurrentLoggedInUser() { if (isset($_SESSION[FM_SESSION_ID]['logged'])) { return $_SESSION[FM_SESSION_ID]['logged']; } return null; } ``` add those above and below code to see whom user has logged in ``` <?php if (FM_USE_AUTH): $current_user = getCurrentLoggedInUser(); ?> <li class="nav-item avatar dropdown"> <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-5" data-bs-toggle="dropdown" aria-expanded="false"> <i class="fa fa-user-circle"></i> <?php echo htmlspecialchars($current_user); ?> </a> <div class="dropdown-menu text-small shadow" aria-labelledby="navbarDropdownMenuLink-5" data-bs-theme="<?php echo FM_THEME; ?>"> <?php if (!FM_READONLY): ?> <a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a> <?php endif ?> <a title="<?php echo lng('Help') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;help=2"><i class="fa fa-exclamation-circle" aria-hidden="true"></i> <?php echo lng('Help') ?></a> <a title="<?php echo lng('Logout') ?>" class="dropdown-item nav-link" href="?logout=1"><i class="fa fa-sign-out" aria-hidden="true"></i> <?php echo lng('Logout') ?></a> </div> </li> ``` View screenshot: ![image](https://github.com/user-attachments/assets/20f820b0-2b1b-4e2e-b31c-ca252f5796e5)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#807
No description provided.