HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/portal.wb-webdesign.com/private_html/modules/widgets/Staff.php
<?php

namespace WHMCS\Module\Widget;

use WHMCS\Carbon;
use WHMCS\Module\AbstractWidget;
use WHMCS\User\AdminLog;

/**
 * Staff Widget.
 *
 * @copyright Copyright (c) WHMCS Limited 2005-2021
 * @license https://www.whmcs.com/eula/ WHMCS Eula
 */
class Staff extends AbstractWidget
{
    protected $title = 'Staff Online';
    protected $description = 'An overview of staff.';
    protected $weight = 300;
    protected $cache = true;
    protected $cacheExpiry = 60;

    public function getData()
    {
        return AdminLog::with('admin')->online()->get();
    }

    public function generateOutput($data)
    {
        $staffOutput = '';
        foreach ($data as $session) {
            $sessionAge = Carbon::createFromFormat('Y-m-d H:i:s', $session['lastvisit'])->diffForHumans();
            $staffOutput .= <<<HTML
<div class="staff">
    <img src="https://www.gravatar.com/avatar/{$session['admin']['gravatarHash']}?s=60&d=mp"
        width="60" height="60" alt="Gravatar Icon"/>
    <div class="name">{$session['admin']['firstname']} {$session['admin']['lastname']}</div>
    <div class="note text-muted">{$sessionAge}</div>
</div>
HTML;
        }
        return <<<EOF
    <div class="widget-staff-container clearfix">
        {$staffOutput}
    </div>
EOF;
    }
}