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