Failed Conditions
Push — multiproject/domainusage ( 3b4292...7f8fcc )
by Simon
23:38 queued 19:05
created

LogHelper::getLogActions()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 81
Code Lines 64

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 64
dl 0
loc 81
ccs 0
cts 74
cp 0
rs 8.7853
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 *                                                                            *
5
 * All code in this file is released into the public domain by the ACC        *
6
 * Development Team. Please see team.json for a list of contributors.         *
7
 ******************************************************************************/
8
9
namespace Waca\Helpers;
10
11
use Exception;
12
use PDO;
13
use Waca\DataObject;
14
use Waca\DataObjects\Ban;
15
use Waca\DataObjects\Comment;
16
use Waca\DataObjects\Domain;
17
use Waca\DataObjects\EmailTemplate;
18
use Waca\DataObjects\JobQueue;
19
use Waca\DataObjects\Log;
20
use Waca\DataObjects\Request;
21
use Waca\DataObjects\RequestForm;
22
use Waca\DataObjects\RequestQueue;
23
use Waca\DataObjects\User;
24
use Waca\DataObjects\WelcomeTemplate;
25
use Waca\Helpers\SearchHelpers\LogSearchHelper;
26
use Waca\Helpers\SearchHelpers\UserSearchHelper;
27
use Waca\PdoDatabase;
28
use Waca\Security\SecurityManager;
29
use Waca\SiteConfiguration;
30
31
class LogHelper
32
{
33
    /**
34
     * Summary of getRequestLogsWithComments
35
     *
36
     * @param Request         $request
37
     * @param PdoDatabase     $db
38
     * @param SecurityManager $securityManager
39
     *
40
     * @return DataObject[]
41
     */
42
    public static function getRequestLogsWithComments(Request $request, PdoDatabase $db, SecurityManager $securityManager)
43
    {
44
        $logs = LogSearchHelper::get($db, $request->getDomain())->byObjectType('Request')->byObjectId($request->getId())->fetch();
45
46
        $currentUser = User::getCurrent($db);
47
        $showRestrictedComments = $securityManager->allows('RequestData', 'seeRestrictedComments', $currentUser) === SecurityManager::ALLOWED;
48
        $showCheckuserComments = $securityManager->allows('RequestData', 'seeCheckuserComments', $currentUser) === SecurityManager::ALLOWED;
49
50
        $comments = Comment::getForRequest($request->getId(), $db, $showRestrictedComments, $showCheckuserComments, $currentUser->getId());
51
52
        $items = array_merge($logs, $comments);
53
54
        /**
55
         * @param DataObject $item
56
         *
57
         * @return int
58
         */
59
        $sortKey = function(DataObject $item) {
60
            if ($item instanceof Log) {
61
                return $item->getTimestamp()->getTimestamp();
62
            }
63
64
            if ($item instanceof Comment) {
65
                return $item->getTime()->getTimestamp();
66
            }
67
68
            return 0;
69
        };
70
71
        do {
72
            $flag = false;
73
74
            $loopLimit = (count($items) - 1);
75
            for ($i = 0; $i < $loopLimit; $i++) {
76
                // are these two items out of order?
77
                if ($sortKey($items[$i]) > $sortKey($items[$i + 1])) {
78
                    // swap them
79
                    $swap = $items[$i];
80
                    $items[$i] = $items[$i + 1];
81
                    $items[$i + 1] = $swap;
82
83
                    // set a flag to say we've modified the array this time around
84
                    $flag = true;
85
                }
86
            }
87
        }
88
        while ($flag);
89
90
        return $items;
91
    }
92
93
    /**
94
     * Summary of getLogDescription
95
     *
96
     * @param Log $entry
97
     *
98
     * @return string
99
     */
100
    public static function getLogDescription(Log $entry)
101
    {
102
        $text = "Deferred to ";
103
        if (substr($entry->getAction(), 0, strlen($text)) == $text) {
104
            // Deferred to a different queue
105
            // This is exactly what we want to display.
106
            return $entry->getAction();
107
        }
108
109
        $text = "Closed custom-n";
110
        if ($entry->getAction() == $text) {
111
            // Custom-closed
112
            return "closed (custom reason - account not created)";
113
        }
114
115
        $text = "Closed custom-y";
116
        if ($entry->getAction() == $text) {
117
            // Custom-closed
118
            return "closed (custom reason - account created)";
119
        }
120
121
        $text = "Closed 0";
122
        if ($entry->getAction() == $text) {
123
            // Dropped the request - short-circuit the lookup
124
            return "dropped request";
125
        }
126
127
        $text = "Closed ";
128
        if (substr($entry->getAction(), 0, strlen($text)) == $text) {
129
            // Closed with a reason - do a lookup here.
130
            $id = substr($entry->getAction(), strlen($text));
131
            /** @var EmailTemplate $template */
132
            $template = EmailTemplate::getById((int)$id, $entry->getDatabase());
133
134
            if ($template != false) {
0 ignored issues
show
introduced by
The condition $template != false is always true.
Loading history...
135
                return "closed (" . $template->getName() . ")";
136
            }
137
        }
138
139
        // Fall back to the basic stuff
140
        $lookup = array(
141
            'Reserved'            => 'reserved',
142
            'Email Confirmed'     => 'email-confirmed',
143
            'Manually Confirmed'  => 'manually confirmed the request',
144
            'Unreserved'          => 'unreserved',
145
            'Approved'            => 'approved',
146
            'Suspended'           => 'suspended',
147
            'RoleChange'          => 'changed roles',
148
            'Banned'              => 'banned',
149
            'Edited'              => 'edited interface message',
150
            'Declined'            => 'declined',
151
            'EditComment-c'       => 'edited a comment',
152
            'EditComment-r'       => 'edited a comment',
153
            'FlaggedComment'      => 'flagged a comment',
154
            'UnflaggedComment'    => 'unflagged a comment',
155
            'Unbanned'            => 'unbanned',
156
            'Promoted'            => 'promoted to tool admin',
157
            'BreakReserve'        => 'forcibly broke the reservation',
158
            'Prefchange'          => 'changed user preferences',
159
            'Renamed'             => 'renamed',
160
            'Demoted'             => 'demoted from tool admin',
161
            'ReceiveReserved'     => 'received the reservation',
162
            'SendReserved'        => 'sent the reservation',
163
            'EditedEmail'         => 'edited email',
164
            'DeletedTemplate'     => 'deleted template',
165
            'EditedTemplate'      => 'edited template',
166
            'CreatedEmail'        => 'created email',
167
            'CreatedTemplate'     => 'created template',
168
            'SentMail'            => 'sent an email to the requester',
169
            'Registered'          => 'registered a tool account',
170
            'JobIssue'            => 'ran a background job unsuccessfully',
171
            'JobCompleted'        => 'completed a background job',
172
            'JobAcknowledged'     => 'acknowledged a job failure',
173
            'JobRequeued'         => 'requeued a job for re-execution',
174
            'JobCancelled'        => 'cancelled execution of a job',
175
            'EnqueuedJobQueue'    => 'scheduled for creation',
176
            'Hospitalised'        => 'sent to the hospital',
177
            'QueueCreated'        => 'created a request queue',
178
            'QueueEdited'         => 'edited a request queue',
179
            'DomainCreated'       => 'created a domain',
180
            'DomainEdited'        => 'edited a domain',
181
            'RequestFormCreated'  => 'created a request form',
182
            'RequestFormEdited'   => 'edited a request form',
183
        );
184
185
        if (array_key_exists($entry->getAction(), $lookup)) {
186
            return $lookup[$entry->getAction()];
187
        }
188
189
        // OK, I don't know what this is. Fall back to something sane.
190
        return "performed an unknown action ({$entry->getAction()})";
191
    }
192
193
    /**
194
     * @param PdoDatabase $database
195
     *
196
     * @return array
197
     */
198
    public static function getLogActions(PdoDatabase $database)
199
    {
200
        $lookup = array(
201
            "Requests" => [
202
                'Reserved'            => 'reserved',
203
                'Email Confirmed'     => 'email-confirmed',
204
                'Manually Confirmed'  => 'manually confirmed',
205
                'Unreserved'          => 'unreserved',
206
                'EditComment-c'       => 'edited a comment (by comment ID)',
207
                'EditComment-r'       => 'edited a comment (by request)',
208
                'FlaggedComment'      => 'flagged a comment',
209
                'UnflaggedComment'    => 'unflagged a comment',
210
                'BreakReserve'        => 'forcibly broke the reservation',
211
                'ReceiveReserved'     => 'received the reservation',
212
                'SendReserved'        => 'sent the reservation',
213
                'SentMail'            => 'sent an email to the requester',
214
                'Closed 0'            => 'dropped request',
215
                'Closed custom-y'     => 'closed (custom reason - account created)',
216
                'Closed custom-n'     => 'closed (custom reason - account not created)',
217
            ],
218
            'Users' => [
219
                'Approved'            => 'approved',
220
                'Suspended'           => 'suspended',
221
                'RoleChange'          => 'changed roles',
222
                'Declined'            => 'declined',
223
                'Prefchange'          => 'changed user preferences',
224
                'Renamed'             => 'renamed',
225
                'Promoted'            => 'promoted to tool admin',
226
                'Demoted'             => 'demoted from tool admin',
227
                'Registered'          => 'registered a tool account',
228
            ],
229
            "Bans" => [
230
                'Banned'              => 'banned',
231
                'Unbanned'            => 'unbanned',
232
            ],
233
            "Site notice" => [
234
                'Edited'              => 'edited interface message',
235
            ],
236
            "Email close templates" => [
237
                'EditedEmail'         => 'edited email',
238
                'CreatedEmail'        => 'created email',
239
            ],
240
            "Welcome templates" => [
241
                'DeletedTemplate'     => 'deleted template',
242
                'EditedTemplate'      => 'edited template',
243
                'CreatedTemplate'     => 'created template',
244
            ],
245
            "Job queue" => [
246
                'JobIssue'            => 'ran a background job unsuccessfully',
247
                'JobCompleted'        => 'completed a background job',
248
                'JobAcknowledged'     => 'acknowledged a job failure',
249
                'JobRequeued'         => 'requeued a job for re-execution',
250
                'JobCancelled'        => 'cancelled execution of a job',
251
                'EnqueuedJobQueue'    => 'scheduled for creation',
252
                'Hospitalised'        => 'sent to the hospital',
253
            ],
254
            "Request queues" => [
255
                'QueueCreated'        => 'created a request queue',
256
                'QueueEdited'         => 'edited a request queue',
257
            ],
258
            "Domains" => [
259
                'DomainCreated'       => 'created a domain',
260
                'DomainEdited'        => 'edited a domain',
261
            ],
262
            "Request forms" => [
263
                'RequestFormCreated'        => 'created a request form',
264
                'RequestFormEdited'         => 'edited a request form',
265
            ],
266
        );
267
268
        $databaseDrivenLogKeys = $database->query(<<<SQL
269
SELECT CONCAT('Closed ', id) AS k, CONCAT('closed (',name,')') AS v FROM emailtemplate
270
UNION ALL
271
SELECT CONCAT('Deferred to ', logname) AS k, CONCAT('deferred to ', displayname) AS v FROM requestqueue;
272
SQL
273
        );
274
        foreach ($databaseDrivenLogKeys->fetchAll(PDO::FETCH_ASSOC) as $row) {
275
            $lookup["Requests"][$row['k']] = $row['v'];
276
        }
277
278
        return $lookup;
279
    }
280
281
    public static function getObjectTypes()
282
    {
283
        return array(
284
            'Ban'             => 'Ban',
285
            'Comment'         => 'Comment',
286
            'EmailTemplate'   => 'Email template',
287
            'JobQueue'        => 'Job queue item',
288
            'Request'         => 'Request',
289
            'SiteNotice'      => 'Site notice',
290
            'User'            => 'User',
291
            'WelcomeTemplate' => 'Welcome template',
292
            'RequestQueue'    => 'Request queue',
293
            'Domain'          => 'Domain',
294
            'RequestForm'     => 'Request form'
295
        );
296
    }
297
298
    /**
299
     * This returns a HTML
300
     *
301
     * @param string            $objectId
302
     * @param string            $objectType
303
     * @param PdoDatabase       $database
304
     * @param SiteConfiguration $configuration
305
     *
306
     * @return null|string
307
     * @category Security-Critical
308
     */
309
    private static function getObjectDescription(
310
        $objectId,
311
        $objectType,
312
        PdoDatabase $database,
313
        SiteConfiguration $configuration
314
    ) {
315
        if ($objectType == '') {
316
            return null;
317
        }
318
319
        $baseurl = $configuration->getBaseUrl();
320
321
        switch ($objectType) {
322
            case 'Ban':
323
                /** @var Ban $ban */
324
                $ban = Ban::getById($objectId, $database);
0 ignored issues
show
Bug introduced by
$objectId of type string is incompatible with the type integer expected by parameter $id of Waca\DataObject::getById(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

324
                $ban = Ban::getById(/** @scrutinizer ignore-type */ $objectId, $database);
Loading history...
325
326
                if ($ban === false) {
0 ignored issues
show
introduced by
The condition $ban === false is always false.
Loading history...
327
                    return 'Ban #' . $objectId;
328
                }
329
330
                return <<<HTML
331
<a href="{$baseurl}/internal.php/bans/show?id={$objectId}">Ban #{$objectId}</a>
332
HTML;
333
            case 'EmailTemplate':
334
                /** @var EmailTemplate $emailTemplate */
335
                $emailTemplate = EmailTemplate::getById($objectId, $database);
336
337
                if ($emailTemplate === false) {
0 ignored issues
show
introduced by
The condition $emailTemplate === false is always false.
Loading history...
338
                    return 'Email Template #' . $objectId;
339
                }
340
341
                $name = htmlentities($emailTemplate->getName(), ENT_COMPAT, 'UTF-8');
342
343
                return <<<HTML
344
<a href="{$baseurl}/internal.php/emailManagement/view?id={$objectId}">Email Template #{$objectId} ({$name})</a>
345
HTML;
346
            case 'SiteNotice':
347
                return "<a href=\"{$baseurl}/internal.php/siteNotice\">the site notice</a>";
348
            case 'Request':
349
                /** @var Request $request */
350
                $request = Request::getById($objectId, $database);
351
352
                if ($request === false) {
0 ignored issues
show
introduced by
The condition $request === false is always false.
Loading history...
353
                    return 'Request #' . $objectId;
354
                }
355
356
                $name = htmlentities($request->getName(), ENT_COMPAT, 'UTF-8');
357
358
                return <<<HTML
359
<a href="{$baseurl}/internal.php/viewRequest?id={$objectId}">Request #{$objectId} ({$name})</a>
360
HTML;
361
            case 'User':
362
                /** @var User $user */
363
                $user = User::getById($objectId, $database);
0 ignored issues
show
Bug introduced by
$objectId of type string is incompatible with the type integer|null expected by parameter $id of Waca\DataObjects\User::getById(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

363
                $user = User::getById(/** @scrutinizer ignore-type */ $objectId, $database);
Loading history...
364
365
                // Some users were merged out of existence
366
                if ($user === false) {
0 ignored issues
show
introduced by
The condition $user === false is always false.
Loading history...
367
                    return 'User #' . $objectId;
368
                }
369
370
                $username = htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8');
371
372
                return "<a href=\"{$baseurl}/internal.php/statistics/users/detail?user={$objectId}\">{$username}</a>";
373
            case 'WelcomeTemplate':
374
                /** @var WelcomeTemplate $welcomeTemplate */
375
                $welcomeTemplate = WelcomeTemplate::getById($objectId, $database);
376
377
                // some old templates have been completely deleted and lost to the depths of time.
378
                if ($welcomeTemplate === false) {
0 ignored issues
show
introduced by
The condition $welcomeTemplate === false is always false.
Loading history...
379
                    return "Welcome template #{$objectId}";
380
                }
381
                else {
382
                    $userCode = htmlentities($welcomeTemplate->getUserCode(), ENT_COMPAT, 'UTF-8');
383
384
                    return "<a href=\"{$baseurl}/internal.php/welcomeTemplates/view?template={$objectId}\">{$userCode}</a>";
385
                }
386
            case 'JobQueue':
387
                /** @var JobQueue $job */
388
                $job = JobQueue::getById($objectId, $database);
389
390
                $taskDescriptions = JobQueue::getTaskDescriptions();
391
392
                if ($job === false) {
0 ignored issues
show
introduced by
The condition $job === false is always false.
Loading history...
393
                    return 'Job Queue Task #' . $objectId;
394
                }
395
396
                $task = $job->getTask();
397
                if (isset($taskDescriptions[$task])) {
398
                    $description = $taskDescriptions[$task];
399
                }
400
                else {
401
                    $description = 'Unknown task';
402
                }
403
404
                return "<a href=\"{$baseurl}/internal.php/jobQueue/view?id={$objectId}\">Job #{$job->getId()} ({$description})</a>";
405
            case 'RequestQueue':
406
                /** @var RequestQueue $queue */
407
                $queue = RequestQueue::getById($objectId, $database);
408
409
                if ($queue === false) {
0 ignored issues
show
introduced by
The condition $queue === false is always false.
Loading history...
410
                    return "Request Queue #{$objectId}";
411
                }
412
413
                $queueHeader = htmlentities($queue->getHeader(), ENT_COMPAT, 'UTF-8');
414
415
                return "<a href=\"{$baseurl}/internal.php/queueManagement/edit?queue={$objectId}\">{$queueHeader}</a>";
416
            case 'Domain':
417
                /** @var Domain $domain */
418
                $domain = Domain::getById($objectId, $database);
419
420
                if ($domain === false) {
0 ignored issues
show
introduced by
The condition $domain === false is always false.
Loading history...
421
                    return "Domain #{$objectId}";
422
                }
423
424
                $domainName = htmlentities($domain->getShortName(), ENT_COMPAT, 'UTF-8');
425
                return "<a href=\"{$baseurl}/internal.php/domainManagement/edit?domain={$objectId}\">{$domainName}</a>";
426
            case 'RequestForm':
427
                /** @var RequestForm $queue */
428
                $queue = RequestForm::getById($objectId, $database);
429
430
                if ($queue === false) {
0 ignored issues
show
introduced by
The condition $queue === false is always false.
Loading history...
431
                    return "Request Form #{$objectId}";
432
                }
433
434
                $formName = htmlentities($queue->getName(), ENT_COMPAT, 'UTF-8');
435
436
                return "<a href=\"{$baseurl}/internal.php/requestFormManagement/edit?form={$objectId}\">{$formName}</a>";
437
            case 'Comment':
438
                /** @var Comment $comment */
439
                $comment = Comment::getById($objectId, $database);
440
                $requestName = htmlentities(Request::getById($comment->getRequest(), $database)->getName(), ENT_COMPAT, 'UTF-8');
0 ignored issues
show
Bug introduced by
The method getName() does not exist on Waca\DataObject. It seems like you code against a sub-type of Waca\DataObject such as Waca\DataObjects\RequestForm or Waca\DataObjects\Ban or Waca\DataObjects\RequestData or Waca\DataObjects\EmailTemplate or Waca\DataObjects\Request. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

440
                $requestName = htmlentities(Request::getById($comment->getRequest(), $database)->/** @scrutinizer ignore-call */ getName(), ENT_COMPAT, 'UTF-8');
Loading history...
441
442
                return "<a href=\"{$baseurl}/internal.php/editComment?id={$objectId}\">Comment {$objectId}</a> on request <a href=\"{$baseurl}/internal.php/viewRequest?id={$comment->getRequest()}#comment-{$objectId}\">#{$comment->getRequest()} ({$requestName})</a>";
443
            default:
444
                return '[' . $objectType . " " . $objectId . ']';
445
        }
446
    }
447
448
    /**
449
     * @param Log[]             $logs
450
     * @param PdoDatabase       $database
451
     * @param SiteConfiguration $configuration
452
     *
453
     * @return array
454
     * @throws Exception
455
     */
456
    public static function prepareLogsForTemplate($logs, PdoDatabase $database, SiteConfiguration $configuration)
457
    {
458
        $userIds = array();
459
460
        foreach ($logs as $logEntry) {
461
            if (!$logEntry instanceof Log) {
462
                // if this happens, we've done something wrong with passing back the log data.
463
                throw new Exception('Log entry is not an instance of a Log, this should never happen.');
464
            }
465
466
            $user = $logEntry->getUser();
467
            if ($user === -1) {
468
                continue;
469
            }
470
471
            if (!array_search($user, $userIds)) {
472
                $userIds[] = $user;
473
            }
474
        }
475
476
        $users = UserSearchHelper::get($database)->inIds($userIds)->fetchMap('username');
477
        $users[-1] = User::getCommunity()->getUsername();
478
479
        $logData = array();
480
481
        foreach ($logs as $logEntry) {
482
            $objectDescription = self::getObjectDescription($logEntry->getObjectId(), $logEntry->getObjectType(),
483
                $database, $configuration);
484
485
            // initialise to sane default
486
            $comment = null;
487
488
            switch ($logEntry->getAction()) {
489
                case 'Renamed':
490
                    $renameData = unserialize($logEntry->getComment());
0 ignored issues
show
Bug introduced by
It seems like $logEntry->getComment() can also be of type null; however, parameter $data of unserialize() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

490
                    $renameData = unserialize(/** @scrutinizer ignore-type */ $logEntry->getComment());
Loading history...
491
                    $oldName = htmlentities($renameData['old'], ENT_COMPAT, 'UTF-8');
492
                    $newName = htmlentities($renameData['new'], ENT_COMPAT, 'UTF-8');
493
                    $comment = 'Renamed \'' . $oldName . '\' to \'' . $newName . '\'.';
494
                    break;
495
                case 'RoleChange':
496
                    $roleChangeData = unserialize($logEntry->getComment());
497
498
                    $removed = array();
499
                    foreach ($roleChangeData['removed'] as $r) {
500
                        $removed[] = htmlentities($r, ENT_COMPAT, 'UTF-8');
501
                    }
502
503
                    $added = array();
504
                    foreach ($roleChangeData['added'] as $r) {
505
                        $added[] = htmlentities($r, ENT_COMPAT, 'UTF-8');
506
                    }
507
508
                    $reason = htmlentities($roleChangeData['reason'], ENT_COMPAT, 'UTF-8');
509
510
                    $roleDelta = 'Removed [' . implode(', ', $removed) . '], Added [' . implode(', ', $added) . ']';
511
                    $comment = $roleDelta . ' with comment: ' . $reason;
512
                    break;
513
                case 'JobIssue':
514
                    $jobIssueData = unserialize($logEntry->getComment());
515
                    $errorMessage = $jobIssueData['error'];
516
                    $status = $jobIssueData['status'];
517
518
                    $comment = 'Job ' . htmlentities($status, ENT_COMPAT, 'UTF-8') . ': ';
519
                    $comment .= htmlentities($errorMessage, ENT_COMPAT, 'UTF-8');
520
                    break;
521
                case 'JobIssueRequest':
522
                case 'JobCompletedRequest':
523
                    $jobData = unserialize($logEntry->getComment());
524
525
                    /** @var JobQueue $job */
526
                    $job = JobQueue::getById($jobData['job'], $database);
527
                    $descs = JobQueue::getTaskDescriptions();
528
                    $comment = htmlentities($descs[$job->getTask()], ENT_COMPAT, 'UTF-8');
529
                    break;
530
531
                case 'JobCompleted':
532
                    break;
533
                default:
534
                    $comment = $logEntry->getComment();
535
                    break;
536
            }
537
538
            $logData[] = array(
539
                'timestamp'         => $logEntry->getTimestamp(),
540
                'userid'            => $logEntry->getUser(),
541
                'username'          => $users[$logEntry->getUser()],
542
                'description'       => self::getLogDescription($logEntry),
543
                'objectdescription' => $objectDescription,
544
                'comment'           => $comment,
545
            );
546
        }
547
548
        return array($users, $logData);
549
    }
550
}
551