diff options
| author | 2014-10-30 12:43:52 +0100 | |
|---|---|---|
| committer | 2014-10-30 12:43:52 +0100 | |
| commit | 9478d2f0116be69e08071dd02c0f945c5f78d7e0 (patch) | |
| tree | 5535178c1a7184084e0c116545d89d10013c840f /app | |
| parent | d20b5a127fe95f91b55f3ae9391365c67f96c4cc (diff) | |
Add do_post_update support
Diffstat (limited to 'app')
| -rw-r--r-- | app/Controllers/updateController.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 4ebb11f51..4ef5357ea 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -109,6 +109,19 @@ class FreshRSS_update_Controller extends Minz_ActionController { require(UPDATE_FILENAME); + if (Minz_Request::param('post_conf', false)) { + $res = do_post_update(); + + if ($res === true) { + @unlink(UPDATE_FILENAME); + @file_put_contents(DATA_PATH . '/last_update.txt', time()); + Minz_Request::good(_t('update_finished')); + } else { + Minz_Request::bad(_t('update_problem', $res), + array('c' => 'update', 'a' => 'index')); + } + } + if (Minz_Request::isPost()) { save_info_update(); } @@ -117,10 +130,11 @@ class FreshRSS_update_Controller extends Minz_ActionController { $res = apply_update(); if ($res === true) { - @unlink(UPDATE_FILENAME); - @file_put_contents(DATA_PATH . '/last_update.txt', time()); - - Minz_Request::good(_t('update_finished')); + Minz_Request::forward(array( + 'c' => 'update', + 'a' => 'apply', + 'params' => array('post_conf' => true) + ), true); } else { Minz_Request::bad(_t('update_problem', $res), array('c' => 'update', 'a' => 'index')); |
