run:R W Run
1.7 KB
2026-04-08 19:26:11
R W Run
8.34 KB
2026-04-08 19:26:11
R W Run
3.54 KB
2026-04-08 19:26:10
R W Run
1.8 KB
2026-04-08 19:26:10
R W Run
3.59 KB
2026-04-08 19:26:09
R W Run
3.19 KB
2026-04-08 19:26:10
R W Run
4.85 KB
2026-04-08 19:26:12
R W Run
2.47 KB
2026-04-08 19:26:12
R W Run
11.26 KB
2026-04-08 19:26:10
R W Run
1.34 KB
2026-04-08 19:26:10
R W Run
3.54 KB
2026-04-08 19:26:09
R W Run
4.61 KB
2026-04-08 19:26:10
R W Run
37 By
2026-04-08 19:26:09
R W Run
error_log
📄Activity.php
1<?php
2
3namespace WHMCS\Module\Widget;
4
5use WHMCS\Carbon;
6use WHMCS\Log\Activity as ActivityLog;
7use WHMCS\Module\AbstractWidget;
8
9/**
10 * Activity Widget.
11 *
12 * @copyright Copyright (c) WHMCS Limited 2005-2021
13 * @license https://www.whmcs.com/eula/ WHMCS Eula
14 */
15class Activity extends AbstractWidget
16{
17 protected $title = 'Activity';
18 protected $description = 'Recent system activity.';
19 protected $weight = 120;
20 protected $cache = true;
21 protected $requiredPermission = 'View Activity Log';
22
23 public function getData()
24 {
25 return localAPI('GetActivityLog', array('limitstart' => 0, 'limitnum' => 10));
26 }
27
28 public function generateOutput($data)
29 {
30 $log = new ActivityLog();
31
32 $output = '';
33 foreach ($data['activity']['entry'] as $entry) {
34
35 $date = Carbon::createFromFormat('Y-m-d H:i:s', $entry['date']);
36
37 $description = $entry['description'];
38 if ($entry['userId']) {
39 $userLabel = ' - User ID: ' . $entry['userId'];
40 if (!strpos($description, $userLabel)) {
41 $description .= $userLabel;
42 }
43 }
44
45 $output .= '
46 <div class="feed-element">
47 <div>
48 <small class="pull-right text-navy">' . $date->diffForHumans() . '</small>
49 <strong>' . $entry['username'] . '</strong>
50 <div>' . $log->autoLink($description) . '</div>
51 <small class="text-muted">' . $entry['ipaddress'] . '</small>
52 </div>
53 </div>';
54 }
55
56 return <<<EOF
57<div class="widget-content-padded">
58 {$output}
59</div>
60EOF;
61 }
62}
63