Code Duplication    Length = 22-22 lines in 2 locations

Apps/Controller/Admin/Main.php 1 location

@@ 69-90 (lines=22) @@
66
     * @throws \Ffcms\Core\Exception\SyntaxException
67
     * @throws \Ffcms\Core\Exception\NativeException
68
     */
69
    public function actionSettings()
70
    {
71
        // init settings model and process post send
72
        $model = new FormSettings();
73
        if ($model->send()) {
74
            if ($model->validate()) {
75
                if ($model->makeSave()) {
76
                    // show message about successful save and take system some time ;)
77
                    return App::$View->render('settings_save');
78
                } else {
79
                    App::$Session->getFlashBag()->add('error', __('Configuration file is not writable! Check /Private/Config/ dir and files'));
80
                }
81
            } else {
82
                App::$Session->getFlashBag()->add('error', __('Validation of form data is failed!'));
83
            }
84
        }
85
86
        // render output view
87
        return App::$View->render('settings', [
88
            'model' => $model->filter()
89
        ]);
90
    }
91
92
    /**
93
     * Manage files via elFinder

Apps/Controller/Admin/User.php 1 location

@@ 203-224 (lines=22) @@
200
     * @throws \Ffcms\Core\Exception\SyntaxException
201
     * @throws \Ffcms\Core\Exception\NativeException
202
     */
203
    public function actionInvite()
204
    {
205
        // init model
206
        $model = new FormInviteSend();
207
208
        if ($model->send()) {
209
            if ($model->validate()) {
210
                if ($model->make()) {
211
                    App::$Session->getFlashBag()->add('success', __('Invite was successful send!'));
212
                } else {
213
                    App::$Session->getFlashBag()->add('error', __('Mail server connection is failed!'));
214
                }
215
            } else {
216
                App::$Session->getFlashBag()->add('error', __('Form validation is failed'));
217
            }
218
        }
219
220
        // render view
221
        return App::$View->render('invite', [
222
            'model' => $model->filter()
223
        ]);
224
    }
225
}