Code Duplication    Length = 25-25 lines in 2 locations

app/lib/FFCMS/Controllers/Admin/Pages.php 1 location

@@ 491-515 (lines=25) @@
488
     * @param \Base $f3
489
     * @return void
490
     */
491
    public function delete(\Base $f3)
492
    {
493
        $this->redirectLoggedOutUser();
494
        $this->csrf();
495
496
        if (false == $f3->get('isRoot')) {
497
            $this->notify(_('You do not have (root) permission!'), 'error');
498
            return $f3->reroute('@admin_pages_list');
499
        }
500
501
        $uuid = $f3->get('REQUEST.uuid');
502
503
        $mapper = new Mappers\Pages;
504
        $mapper->load(['uuid = ?', $uuid]);
505
506
        if (null == $mapper->id) {
507
            $this->notify(_('The page no longer exists!'), 'error');
508
            return $f3->reroute('@admin_pages_list');
509
        }
510
511
        $mapper->erase();
512
        $this->notify('Page deleted!', 'success');
513
        $this->notify(_('Unable to update page data!'), 'error');
514
        return $f3->reroute('@admin_pages_list');
515
    }
516
517
518
}

app/lib/FFCMS/Controllers/Admin/Reports.php 1 location

@@ 438-462 (lines=25) @@
435
     * @param \Base $f3
436
     * @return void
437
     */
438
    public function delete(\Base $f3)
439
    {
440
        $this->redirectLoggedOutUser();
441
        $this->csrf();
442
443
        if (false == $f3->get('isRoot')) {
444
            $this->notify(_('You do not have (root) permission!'), 'error');
445
            return $f3->reroute('@admin_reports_list');
446
        }
447
448
        $uuid = $f3->get('REQUEST.uuid');
449
450
        $mapper = new Mappers\Reports;
451
        $mapper->load(['uuid = ?', $uuid]);
452
453
        if (null == $mapper->id) {
454
            $this->notify(_('The report no longer exists!'), 'error');
455
            return $f3->reroute('@admin_reports_list');
456
        }
457
458
        $mapper->erase();
459
        $this->notify('Report deleted!', 'success');
460
        $this->notify(_('Unable to update report data!'), 'error');
461
        return $f3->reroute('@admin_reports_list');
462
    }
463
464
465
}