Code Duplication    Length = 22-22 lines in 2 locations

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
}

Apps/Controller/Admin/Main.php 1 location

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