Code Duplication    Length = 22-22 lines in 2 locations

Apps/Controller/Admin/Main.php 1 location

@@ 82-103 (lines=22) @@
79
     * @throws \Ffcms\Core\Exception\SyntaxException
80
     * @throws \Ffcms\Core\Exception\NativeException
81
     */
82
    public function actionSettings()
83
    {
84
        // init settings model and process post send
85
        $model = new FormSettings(true);
86
        if ($model->send()) {
87
            if ($model->validate()) {
88
                if ($model->makeSave()) {
89
                    // show message about successful save and take system some time ;)
90
                    return $this->view->render('settings_save');
91
                } else {
92
                    App::$Session->getFlashBag()->add('error', __('Configuration file is not writable! Check /Private/Config/ dir and files'));
93
                }
94
            } else {
95
                App::$Session->getFlashBag()->add('error', __('Validation of form data is failed!'));
96
            }
97
        }
98
99
        // render output view
100
        return $this->view->render('settings', [
101
            'model' => $model
102
        ]);
103
    }
104
105
    /**
106
     * Manage files via elFinder

Apps/Controller/Admin/User.php 1 location

@@ 213-234 (lines=22) @@
210
     * @throws \Ffcms\Core\Exception\SyntaxException
211
     * @throws \Ffcms\Core\Exception\NativeException
212
     */
213
    public function actionInvite()
214
    {
215
        // init model
216
        $model = new FormInviteSend();
217
218
        if ($model->send()) {
219
            if ($model->validate()) {
220
                if ($model->make()) {
221
                    App::$Session->getFlashBag()->add('success', __('Invite was successful send!'));
222
                } else {
223
                    App::$Session->getFlashBag()->add('error', __('Mail server connection is failed!'));
224
                }
225
            } else {
226
                App::$Session->getFlashBag()->add('error', __('Form validation is failed'));
227
            }
228
        }
229
230
        // render view
231
        return $this->view->render('invite', [
232
            'model' => $model
233
        ]);
234
    }
235
}