Code Duplication    Length = 39-39 lines in 2 locations

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

@@ 80-118 (lines=39) @@
77
     * @param \Base $f3
78
     * @return void
79
     */
80
    public function edit(\Base $f3)
81
    {
82
        $this->redirectLoggedOutUser();
83
        $this->csrf();
84
85
        if (false == $f3->get('isRoot')) {
86
            $this->notify(_('You do not have (root) permission!'), 'error');
87
            return $f3->reroute('@admin');
88
        }
89
90
        $uuid = $f3->get('REQUEST.uuid');
91
92
        $mapper = new Mappers\Reports;
93
        $mapper->load(['uuid = ?', $uuid]);
94
95
        if (null == $mapper->id) {
96
            $this->notify(_('The entry no longer exists!'), 'error');
97
            return $f3->reroute('@admin_reports_lists');
98
        }
99
100
        $f3->set('breadcrumbs', [
101
            _('Admin') => 'admin',
102
            _('Users') => $this->url('@admin_reports_search', [
103
                'search' => $mapper->users_uuid,
104
                'search_fields' => 'uuid',
105
                'type' => 'exact',
106
                ]),
107
            _('Reports') => $this->url('@admin_reports_search', [
108
                'search' => $mapper->users_uuid,
109
                'search_fields' => 'users_uuid',
110
                'order' => 'key',
111
                'type' => 'exact',
112
                ]),
113
            _('Edit') => '',
114
        ]);
115
116
        $f3->set('form', $mapper->cast());
117
        echo \View::instance()->render($this->template_path . 'edit.phtml');
118
    }
119
120
121
    /**

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

@@ 82-120 (lines=39) @@
79
     * @param \Base $f3
80
     * @return void
81
     */
82
    public function edit(\Base $f3)
83
    {
84
        $this->redirectLoggedOutUser();
85
        $this->csrf();
86
87
        if (false == $f3->get('isRoot')) {
88
            $this->notify(_('You do not have (root) permission!'), 'error');
89
            return $f3->reroute('@admin');
90
        }
91
92
        $uuid = $f3->get('REQUEST.uuid');
93
        $usersModel = Models\Users::instance();
94
        $mapper = $usersModel->getDataMapper();
95
        $mapper->load(['uuid = ?', $uuid]);
96
97
        if (null == $mapper->id) {
98
            $this->notify(_('The entry no longer exists!'), 'error');
99
            return $f3->reroute('@admin_users_lists');
100
        }
101
102
        $f3->set('breadcrumbs', [
103
            _('Admin') => 'admin',
104
            _('Users') => $this->url('@admin_users_search', [
105
                'search' => $mapper->users_uuid,
106
                'search_fields' => 'uuid',
107
                'type' => 'exact',
108
                ]),
109
            _('Data') => $this->url('@admin_usersdata_search', [
110
                'search' => $mapper->users_uuid,
111
                'search_fields' => 'users_uuid',
112
                'order' => 'key',
113
                'type' => 'exact',
114
                ]),
115
            _('Edit') => '',
116
        ]);
117
118
        $f3->set('form', $mapper->cast());
119
        echo \View::instance()->render($this->template_path . 'edit.phtml');
120
    }
121
122
123
    /**