HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/phpmyfaq/admin/stat.browser.php
<?php

/**
 * Sessionbrowser.
 *
 *
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @package phpMyFAQ
 * @author Thorsten Rinne <thorsten@phpmyfaq.de>
 * @copyright 2003-2022 phpMyFAQ Team
 * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link https://www.phpmyfaq.de
 * @since 2003-02-24
 */

use phpMyFAQ\Date;
use phpMyFAQ\Filter;
use phpMyFAQ\Session;

if (!defined('IS_VALID_PHPMYFAQ')) {
    http_response_code(400);
    exit();
}

if ($user->perm->hasPermission($user->getUserId(), 'viewlog')) {
    $perpage = 50;
    $day = Filter::filterInput(INPUT_POST, 'day', FILTER_VALIDATE_INT);
    $firstHour = mktime(0, 0, 0, date('m', $day), date('d', $day), date('Y', $day));
    $lastHour = mktime(23, 59, 59, date('m', $day), date('d', $day), date('Y', $day));

    $session = new Session($faqConfig);
    $sessiondata = $session->getSessionsByDate($firstHour, $lastHour);
    $date = new Date($faqConfig);
    ?>
        <header class="row">
            <div class="col-lg-12">
                <h2 class="page-header">
                    <i aria-hidden="true" class="fa fa-tasks"></i> <?= $PMF_LANG['ad_sess_session'] . ' ' . date('Y-m-d', $day) ?>
                </h2>
            </div>
        </header>

        <div class="row">
            <div class="col-lg-12">
                <table class="table table-striped">
                <thead>
                    <tr>
                        <th><?= $PMF_LANG['ad_sess_ip'] ?></th>
                        <th><?= $PMF_LANG['ad_sess_s_date'] ?></th>
                        <th><?= $PMF_LANG['ad_sess_session'] ?></th>
                    </tr>
                </thead>
                <tbody>
    <?php foreach ($sessiondata as $sid => $data) { ?>
                    <tr>
                        <td><?= $data['ip'] ?></td>
                        <td><?= $date->format(date('Y-m-d H:i', $data['time'])) ?></td>
                        <td><a href="?action=viewsession&amp;id=<?= $sid ?>"><?= $sid ?></a></td>
                    </tr>
    <?php } ?>
                </tbody>
                </table>
            </div>
        </div>
    <?php
} else {
    echo $PMF_LANG['err_NotAuth'];
}