From 244026874aba991e7feb37f74a61b192f1bda5ac Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 17 Apr 2013 19:24:21 +0200 Subject: Fix issue #61 : amélioration import OPML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 7a34430ea..c67609d57 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -190,6 +190,7 @@ class feedController extends ActionController { $nb_month_old = $this->view->conf->oldEntries (); $date_min = time () - (60 * 60 * 24 * 30 * $nb_month_old); + $error = false; $i = 0; foreach ($feeds as $feed) { try { @@ -207,17 +208,31 @@ class feedController extends ActionController { ); if (!$feedDAO->searchByUrl ($values['url'])) { - $feedDAO->addFeed ($values); + if (!$feedDAO->addFeed ($values)) { + $error = true; + } } } catch (FeedException $e) { + $error = true; Log::record ($e->getMessage (), Log::ERROR); } } + if ($error) { + $res = 'Les flux ont été importés mais des erreurs sont survenus'; + } else { + $res = 'Les flux ont été importés'; + } + $notif = array ( + 'type' => 'good', + 'content' => $res + ); + Session::_param ('notification', $notif); + Request::forward (array ( - 'c' => 'feed', - 'a' => 'actualize' - )); + 'c' => 'configure', + 'a' => 'importExport' + ), true); } } -- cgit v1.2.3