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

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