@@ 36-57 (lines=22) @@ | ||
33 | /** |
|
34 | * Manage settings in web |
|
35 | */ |
|
36 | public function actionSettings() |
|
37 | { |
|
38 | $model = new FormSettings(); |
|
39 | ||
40 | if ($model->send()) { |
|
41 | if ($model->validate()) { |
|
42 | if ($model->makeSave()) { |
|
43 | // show message about successful save and take system some time ;) |
|
44 | $this->response = App::$View->render('settings_save'); |
|
45 | return; |
|
46 | } else { |
|
47 | App::$Session->getFlashBag()->add('error', __('Configuration file is not writable! Check /Private/Config/ dir and files')); |
|
48 | } |
|
49 | } else { |
|
50 | App::$Session->getFlashBag()->add('error', __('Validation of form data is failed!')); |
|
51 | } |
|
52 | } |
|
53 | ||
54 | $this->response = App::$View->render('settings', [ |
|
55 | 'model' => $model // no $model->export() there |
|
56 | ]); |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * Manage files via elFinder |
@@ 170-191 (lines=22) @@ | ||
167 | /** |
|
168 | * Send invite to users |
|
169 | */ |
|
170 | public function actionInvite() |
|
171 | { |
|
172 | // init model |
|
173 | $model = new FormInviteSend(); |
|
174 | ||
175 | if ($model->send()) { |
|
176 | if ($model->validate()) { |
|
177 | if ($model->make()) { |
|
178 | App::$Session->getFlashBag()->add('success', __('Invite was successful send!')); |
|
179 | } else { |
|
180 | App::$Session->getFlashBag()->add('error', __('Mail server connection is failed!')); |
|
181 | } |
|
182 | } else { |
|
183 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
|
184 | } |
|
185 | } |
|
186 | ||
187 | // render view |
|
188 | $this->response = App::$View->render('invite', [ |
|
189 | 'model' => $model |
|
190 | ]); |
|
191 | } |
|
192 | } |