From 4a9cc67d90ac167d745c50f98aa1738f6d1131e9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 15 Sep 2016 11:36:31 +0200 Subject: API: add iconUrl https://github.com/jangernert/FeedReader/issues/59#issuecomment-247182291 https://github.com/FreshRSS/FreshRSS/issues/1252 --- p/api/greader.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index 894c2e960..98ae60475 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -158,7 +158,7 @@ function authorizationToUser() { Minz_Log::warning('Invalid API user ' . $user . ': configuration cannot be found.'); unauthorized(); } - $system_conf = Minz_Configuration::get('system'); + global $system_conf; if ($headerAuthX[1] === sha1($system_conf->salt . $user . $conf->apiPasswordHash)) { return $user; } else { @@ -189,7 +189,7 @@ function clientLogin($email, $pass) { //http://web.archive.org/web/2013060409104 if ($conf->apiPasswordHash != '' && password_verify($pass, $conf->apiPasswordHash)) { header('Content-Type: text/plain; charset=UTF-8'); - $system_conf = Minz_Configuration::get('system'); + global $system_conf; $auth = $email . '/' . sha1($system_conf->salt . $email . $conf->apiPasswordHash); echo 'SID=', $auth, "\n", 'Auth=', $auth, "\n"; @@ -209,7 +209,7 @@ function token($conf) { //https://github.com/ericmann/gReader-Library/blob/master/greader.class.php $user = Minz_Session::param('currentUser', '_'); //logMe('token('. $user . ")"); //TODO: Implement real token that expires - $system_conf = Minz_Configuration::get('system'); + global $system_conf; $token = str_pad(sha1($system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters echo $token, "\n"; exit(); @@ -219,7 +219,7 @@ function checkToken($conf, $token) { //http://code.google.com/p/google-reader-api/wiki/ActionToken $user = Minz_Session::param('currentUser', '_'); //logMe('checkToken(' . $token . ")"); - $system_conf = Minz_Configuration::get('system'); + global $system_conf; if ($token === str_pad(sha1($system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) { return true; } @@ -261,6 +261,8 @@ function subscriptionList() { $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); + global $system_conf; + $salt = $system_conf->salt; $subscriptions = array(); foreach ($res as $line) { @@ -277,7 +279,7 @@ function subscriptionList() { //'firstitemmsec' => 0, 'url' => $line['url'], 'htmlUrl' => $line['website'], - //'iconUrl' => '', + 'iconUrl' => Minz_Url::display('/f.php?' . hash('crc32b', $salt . $line['url']), '', true), ); } -- cgit v1.2.3 From 12fa756bbc10685438c8972dcca046c90ed4f548 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 17 Sep 2016 01:24:04 +0200 Subject: API: start draft of edit subscriptions https://github.com/FreshRSS/FreshRSS/issues/443 https://github.com/FreshRSS/FreshRSS/issues/1252 https://github.com/jangernert/FeedReader/issues/59#issuecomment-247484124 --- p/api/greader.php | 90 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 81 insertions(+), 9 deletions(-) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index 98ae60475..3da1156c2 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -287,6 +287,66 @@ function subscriptionList() { exit(); } +function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '') { + //https://github.com/mihaip/google-reader-api/blob/master/wiki/ApiSubscriptionEdit.wiki + switch ($action) { + case 'subscribe': + case 'unsubscribe': + case 'edit': + default: + badRequest(); + } + $addCatId = 0; + $categoryDAO = null; + if ($add != '' || $remove != '') { + $categoryDAO = new FreshRSS_CategoryDAO(); + } + if ($add != '' && strpos($add, 'user/-/label/') === 0) { //user/-/label/Example + $c_name = basename($add); + $cat = $categoryDAO->searchByName($c_name); + $addCatId = $cat == null ? -1 : $cat->id(); + } else if ($remove != '' && strpos($remove, 'user/-/label/') { + $addCatId = 1; //Default category + } + $feedDAO = FreshRSS_Factory::createFeedDao(); + for ($i = count($streamNames) - 1; $i >= 0; $i--) { + $streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338 + if (strpos($streamName, 'feed/') === 0) { + $streamName = basename($streamName); + $feedId = 0; + if (ctype_digit($streamName)) { + if ($action === 'subscribe') { + continue; + } + $feedId = $streamName; + } else { + $feed = $feedDAO->searchByUrl($streamName); + $feedId = $feed == null ? -1 : $feed->id(); + } + $title = isset($titles[$i]) ? $titles[$i] : ''; + switch ($action) { + case 'subscribe': + if ($feedId <= 0) { + //TODO + } + break; + case 'unsubscribe': + if ($feedId > 0) { + //TODO + } + break; + case 'edit': + if ($feedId > 0) { + //TODO + } + break; + } + } + } + notImplemented(); + exit('OK'); +} + function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count //logMe("unreadCount()"); header('Content-Type: application/json; charset=UTF-8'); @@ -523,8 +583,7 @@ function editTag($e_ids, $a, $r) { break; } - echo 'OK'; - exit(); + exit('OK'); } function markAllAsRead($streamId, $olderThanId) { @@ -542,8 +601,7 @@ function markAllAsRead($streamId, $olderThanId) { $entryDAO->markReadEntries($olderThanId, false, -1); } - echo 'OK'; - exit(); + exit('OK'); } //logMe('----------------------------------------------------------------'); @@ -625,14 +683,28 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo if (isset($pathInfos[5]) && $pathInfos[5] === 'list') { $output = isset($_GET['output']) ? $_GET['output'] : ''; if ($output !== 'json') notImplemented(); - tagList($_GET['output']); + tagList($output); } break; case 'subscription': - if (isset($pathInfos[5]) && $pathInfos[5] === 'list') { - $output = isset($_GET['output']) ? $_GET['output'] : ''; - if ($output !== 'json') notImplemented(); - subscriptionList($_GET['output']); + if (isset($pathInfos[5])) { + switch ($pathInfos[5]) { + case 'list': + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + subscriptionList($_GET['output']); + break; + case 'edit': + if (isset($_POST['s']) && isset($_POST['ac'])) { + $streamNames = multiplePosts('s'); //StreamId to operate on. The parameter may be repeated to edit multiple subscriptions at once + $titles = multiplePosts('t'); //Title to use for the subscription. For the `subscribe` action, if not specified then the feed's current title will be used. Can be used with the `edit` action to rename a subscription + $action = $_POST['ac']; //Action to perform on the given StreamId. Possible values are `subscribe`, `unsubscribe` and `edit` + $add = isset($_POST['a']) ? $_POST['a'] : ''; //StreamId to add the subscription to (generally a user label) + $remove = isset($_POST['r']) ? $_POST['r'] : ''; //StreamId to remove the subscription from (generally a user label) + subscriptionEdit($streamNames, $titles $action, $add, $remove); + } + break; + } } break; case 'unread-count': -- cgit v1.2.3 From 44f22ab8b4c46befab98440f69a05725928bed75 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Sep 2016 17:36:33 +0200 Subject: API move feed to another category https://github.com/jangernert/FeedReader/issues/59 https://github.com/FreshRSS/FreshRSS/issues/443 --- app/Controllers/feedController.php | 14 +------------- app/Models/FeedDAO.php | 13 +++++++++++++ p/api/greader.php | 7 +++++-- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'p/api/greader.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index ffda1450d..c64b67a80 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -511,21 +511,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed_id = Minz_Request::param('f_id'); $cat_id = Minz_Request::param('c_id'); - - if ($cat_id === false) { - // If category was not given get the default one. - $catDAO = new FreshRSS_CategoryDAO(); - $catDAO->checkDefault(); - $def_cat = $catDAO->getDefault(); - $cat_id = $def_cat->id(); - } - $feedDAO = FreshRSS_Factory::createFeedDao(); - $values = array('category' => $cat_id); - $feed = $feedDAO->searchById($feed_id); - if ($feed && ($feed->category() == $cat_id || - $feedDAO->updateFeed($feed_id, $values))) { + if ($feedDAO->moveFeed($feed_id, $cat_id)) { // TODO: return something useful } else { Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' . diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 475d39286..2fd2c6194 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -136,6 +136,19 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { } } + public function moveFeed($feed_id, $cat_id) { + if ($cat_id <= 0) { + // If category was not given get the default one. + $catDAO = new FreshRSS_CategoryDAO(); + $catDAO->checkDefault(); + $def_cat = $catDAO->getDefault(); + $cat_id = $def_cat->id(); + } + $feed = $this->searchById($feed_id); + return $feed && ($feed->category() == $cat_id || + $this->updateFeed($feed_id, array('category' => $cat_id))); + } + public function deleteFeed($id) { $sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?'; $stm = $this->bd->prepare($sql); diff --git a/p/api/greader.php b/p/api/greader.php index 3da1156c2..426f3fe44 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -337,14 +337,17 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' break; case 'edit': if ($feedId > 0) { - //TODO + if ($feedDAO->moveFeed($feed_id, $cat_id)) { + exit('OK'); + } else { + badRequest(); + } } break; } } } notImplemented(); - exit('OK'); } function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count -- cgit v1.2.3 From f1f8ea2da3a9334d20d54c083735855c90a21d9e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Sep 2016 18:10:53 +0200 Subject: API fix change feed category --- p/api/greader.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index 426f3fe44..7094fb381 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -288,12 +288,15 @@ function subscriptionList() { } function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '') { + //logMe("subscriptionEdit()"); //https://github.com/mihaip/google-reader-api/blob/master/wiki/ApiSubscriptionEdit.wiki switch ($action) { case 'subscribe': case 'unsubscribe': case 'edit': + break; default: + logMe("Bad action: $action"); badRequest(); } $addCatId = 0; @@ -305,7 +308,7 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' $c_name = basename($add); $cat = $categoryDAO->searchByName($c_name); $addCatId = $cat == null ? -1 : $cat->id(); - } else if ($remove != '' && strpos($remove, 'user/-/label/') { + } else if ($remove != '' && strpos($remove, 'user/-/label/')) { $addCatId = 1; //Default category } $feedDAO = FreshRSS_Factory::createFeedDao(); @@ -328,21 +331,22 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' case 'subscribe': if ($feedId <= 0) { //TODO + } else { + badRequest(); } break; case 'unsubscribe': if ($feedId > 0) { //TODO + } else { + badRequest(); } break; case 'edit': - if ($feedId > 0) { - if ($feedDAO->moveFeed($feed_id, $cat_id)) { - exit('OK'); - } else { - badRequest(); - } + if ($feedId > 0 && $feedDAO->moveFeed($feedId, $addCatId)) { + exit('OK'); } + badRequest(); break; } } @@ -704,7 +708,7 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo $action = $_POST['ac']; //Action to perform on the given StreamId. Possible values are `subscribe`, `unsubscribe` and `edit` $add = isset($_POST['a']) ? $_POST['a'] : ''; //StreamId to add the subscription to (generally a user label) $remove = isset($_POST['r']) ? $_POST['r'] : ''; //StreamId to remove the subscription from (generally a user label) - subscriptionEdit($streamNames, $titles $action, $add, $remove); + subscriptionEdit($streamNames, $titles, $action, $add, $remove); } break; } -- cgit v1.2.3 From d6b4186040011aad16a173a1ceaa5a5084025470 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Sep 2016 19:26:40 +0200 Subject: API implement delete feed + refactor move feed --- app/Controllers/feedController.php | 45 ++++++++++++++++++++++++++++--------- app/Models/FeedDAO.php | 13 ----------- p/api/greader.php | 46 +++++++++++++++++--------------------- 3 files changed, 54 insertions(+), 50 deletions(-) (limited to 'p/api/greader.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index c64b67a80..0ff27e0da 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -492,6 +492,23 @@ class FreshRSS_feed_Controller extends Minz_ActionController { return $updated_feeds; } + public static function moveFeed($feed_id, $cat_id) { + if ($feed_id <= 0) { + return false; + } + if ($cat_id <= 0) { + // If category was not given get the default one. + $catDAO = new FreshRSS_CategoryDAO(); + $catDAO->checkDefault(); + $def_cat = $catDAO->getDefault(); + $cat_id = $def_cat->id(); + } + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feed = $feedDAO->searchById($feed_id); + return $feed && ($feed->category() == $cat_id || + $feedDAO->updateFeed($feed_id, array('category' => $cat_id))); + } + /** * This action changes the category of a feed. * @@ -511,9 +528,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed_id = Minz_Request::param('f_id'); $cat_id = Minz_Request::param('c_id'); - $feedDAO = FreshRSS_Factory::createFeedDao(); - if ($feedDAO->moveFeed($feed_id, $cat_id)) { + if (self::moveFeed($feed_id, $cat_id)) { // TODO: return something useful } else { Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' . @@ -522,6 +538,21 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } + public static function deleteFeed($feed_id) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + if ($feedDAO->deleteFeed($feed_id)) { + // TODO: Delete old favicon + + // Remove related queries + FreshRSS_Context::$user_conf->queries = remove_query_by_get( + 'f_' . $feed_id, FreshRSS_Context::$user_conf->queries); + FreshRSS_Context::$user_conf->save(); + + return true; + } + return false; + } + /** * This action deletes a feed. * @@ -540,21 +571,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { if (!$redirect_url) { $redirect_url = array('c' => 'subscription', 'a' => 'index'); } - if (!Minz_Request::isPost()) { Minz_Request::forward($redirect_url, true); } $id = Minz_Request::param('id'); - $feedDAO = FreshRSS_Factory::createFeedDao(); - if ($feedDAO->deleteFeed($id)) { - // TODO: Delete old favicon - - // Remove related queries - FreshRSS_Context::$user_conf->queries = remove_query_by_get( - 'f_' . $id, FreshRSS_Context::$user_conf->queries); - FreshRSS_Context::$user_conf->save(); + if (self::deleteFeed($id)) { Minz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url); } else { Minz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url); diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 2fd2c6194..475d39286 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -136,19 +136,6 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { } } - public function moveFeed($feed_id, $cat_id) { - if ($cat_id <= 0) { - // If category was not given get the default one. - $catDAO = new FreshRSS_CategoryDAO(); - $catDAO->checkDefault(); - $def_cat = $catDAO->getDefault(); - $cat_id = $def_cat->id(); - } - $feed = $this->searchById($feed_id); - return $feed && ($feed->category() == $cat_id || - $this->updateFeed($feed_id, array('category' => $cat_id))); - } - public function deleteFeed($id) { $sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?'; $stm = $this->bd->prepare($sql); diff --git a/p/api/greader.php b/p/api/greader.php index 7094fb381..9b07e0729 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -153,13 +153,12 @@ function authorizationToUser() { if (count($headerAuthX) === 2) { $user = $headerAuthX[0]; if (ctype_alnum($user)) { - $conf = get_user_configuration($user); - if (is_null($conf)) { + FreshRSS_Context::$user_conf = get_user_configuration($user); + if (FreshRSS_Context::$user_conf == null) { Minz_Log::warning('Invalid API user ' . $user . ': configuration cannot be found.'); unauthorized(); } - global $system_conf; - if ($headerAuthX[1] === sha1($system_conf->salt . $user . $conf->apiPasswordHash)) { + if ($headerAuthX[1] === sha1(FreshRSS_Context::$system_conf->salt . $user . FreshRSS_Context::$user_conf->apiPasswordHash)) { return $user; } else { logMe('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1]); @@ -181,16 +180,15 @@ function clientLogin($email, $pass) { //http://web.archive.org/web/2013060409104 include_once(LIB_PATH . '/password_compat.php'); } - $conf = get_user_configuration($email); - if (is_null($conf)) { + FreshRSS_Context::$user_conf = get_user_configuration($email); + if (FreshRSS_Context::$user_conf == null) { Minz_Log::warning('Invalid API user ' . $email . ': configuration cannot be found.'); unauthorized(); } - if ($conf->apiPasswordHash != '' && password_verify($pass, $conf->apiPasswordHash)) { + if (FreshRSS_Context::$user_conf->apiPasswordHash != '' && password_verify($pass, FreshRSS_Context::$user_conf->apiPasswordHash)) { header('Content-Type: text/plain; charset=UTF-8'); - global $system_conf; - $auth = $email . '/' . sha1($system_conf->salt . $email . $conf->apiPasswordHash); + $auth = $email . '/' . sha1(FreshRSS_Context::$system_conf->salt . $email . FreshRSS_Context::$user_conf->apiPasswordHash); echo 'SID=', $auth, "\n", 'Auth=', $auth, "\n"; exit(); @@ -209,8 +207,7 @@ function token($conf) { //https://github.com/ericmann/gReader-Library/blob/master/greader.class.php $user = Minz_Session::param('currentUser', '_'); //logMe('token('. $user . ")"); //TODO: Implement real token that expires - global $system_conf; - $token = str_pad(sha1($system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters + $token = str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters echo $token, "\n"; exit(); } @@ -219,8 +216,7 @@ function checkToken($conf, $token) { //http://code.google.com/p/google-reader-api/wiki/ActionToken $user = Minz_Session::param('currentUser', '_'); //logMe('checkToken(' . $token . ")"); - global $system_conf; - if ($token === str_pad(sha1($system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) { + if ($token === str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) { return true; } unauthorized(); @@ -261,8 +257,7 @@ function subscriptionList() { $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); - global $system_conf; - $salt = $system_conf->salt; + $salt = FreshRSS_Context::$system_conf->salt; $subscriptions = array(); foreach ($res as $line) { @@ -296,7 +291,6 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' case 'edit': break; default: - logMe("Bad action: $action"); badRequest(); } $addCatId = 0; @@ -336,14 +330,14 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' } break; case 'unsubscribe': - if ($feedId > 0) { - //TODO + if ($feedId > 0 && FreshRSS_feed_Controller::deleteFeed($feedId)) { + exit('OK'); } else { badRequest(); } break; case 'edit': - if ($feedId > 0 && $feedDAO->moveFeed($feedId, $addCatId)) { + if ($feedId > 0 && FreshRSS_feed_Controller::moveFeed($feedId, $addCatId)) { exit('OK'); } badRequest(); @@ -620,17 +614,17 @@ $pathInfos = explode('/', $pathInfo); Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php'); -$system_conf = Minz_Configuration::get('system'); -if (!$system_conf->api_enabled) { +FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); +if (!FreshRSS_Context::$system_conf->api_enabled) { serviceUnavailable(); } Minz_Session::init('FreshRSS'); $user = authorizationToUser(); -$conf = null; +FreshRSS_Context::$user_conf = null; if ($user !== '') { - $conf = get_user_configuration($user); + FreshRSS_Context::$user_conf = get_user_configuration($user); } //logMe('User => ' . $user); @@ -722,7 +716,7 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo break; case 'edit-tag': //http://blog.martindoms.com/2010/01/20/using-the-google-reader-api-part-3/ $token = isset($_POST['T']) ? trim($_POST['T']) : ''; - checkToken($conf, $token); + checkToken(FreshRSS_Context::$user_conf, $token); $a = isset($_POST['a']) ? $_POST['a'] : ''; //Add: user/-/state/com.google/read user/-/state/com.google/starred $r = isset($_POST['r']) ? $_POST['r'] : ''; //Remove: user/-/state/com.google/read user/-/state/com.google/starred $e_ids = multiplePosts('i'); //item IDs @@ -730,7 +724,7 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo break; case 'mark-all-as-read': $token = isset($_POST['T']) ? trim($_POST['T']) : ''; - checkToken($conf, $token); + checkToken(FreshRSS_Context::$user_conf, $token); $streamId = $_POST['s']; //StreamId $ts = isset($_POST['ts']) ? $_POST['ts'] : '0'; //Older than timestamp in nanoseconds if (!ctype_digit($ts)) { @@ -739,7 +733,7 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo markAllAsRead($streamId, $ts); break; case 'token': - token($conf); + token(FreshRSS_Context::$user_conf); break; } } elseif ($pathInfos[1] === 'check' && $pathInfos[2] === 'compatibility') { -- cgit v1.2.3 From 6a812b0d31df275d9b8b211a90628400ee097644 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Sep 2016 19:54:46 +0200 Subject: API rename feed --- app/Controllers/feedController.php | 12 +++++++++--- p/api/greader.php | 19 ++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'p/api/greader.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 0ff27e0da..0364424f5 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -492,6 +492,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController { return $updated_feeds; } + public static function renameFeed($feed_id, $feed_name) { + if ($feed_id <= 0 || $feed_name == '') { + return false; + } + $feedDAO = FreshRSS_Factory::createFeedDao(); + return $feedDAO->updateFeed($feed_id, array('name' => $feed_name)); + } + public static function moveFeed($feed_id, $cat_id) { if ($feed_id <= 0) { return false; @@ -504,9 +512,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $cat_id = $def_cat->id(); } $feedDAO = FreshRSS_Factory::createFeedDao(); - $feed = $feedDAO->searchById($feed_id); - return $feed && ($feed->category() == $cat_id || - $feedDAO->updateFeed($feed_id, array('category' => $cat_id))); + return $feedDAO->updateFeed($feed_id, array('category' => $cat_id)); } /** diff --git a/p/api/greader.php b/p/api/greader.php index 9b07e0729..131eb65c5 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -325,27 +325,32 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' case 'subscribe': if ($feedId <= 0) { //TODO + notImplemented(); } else { badRequest(); } break; case 'unsubscribe': - if ($feedId > 0 && FreshRSS_feed_Controller::deleteFeed($feedId)) { - exit('OK'); - } else { + if (!($feedId > 0 && FreshRSS_feed_Controller::deleteFeed($feedId))) { badRequest(); } break; case 'edit': - if ($feedId > 0 && FreshRSS_feed_Controller::moveFeed($feedId, $addCatId)) { - exit('OK'); + if ($feedId > 0) { + if ($addCatId > 0) { + FreshRSS_feed_Controller::moveFeed($feedId, $addCatId); + } + if ($title != '') { + FreshRSS_feed_Controller::renameFeed($feedId, $title); + } + } else { + badRequest(); } - badRequest(); break; } } } - notImplemented(); + exit('OK'); } function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count -- cgit v1.2.3 From 71b98a0ffc41ea869e8c49c2889cda5b3e113030 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 25 Sep 2016 00:14:36 +0200 Subject: API add feed --- app/Controllers/feedController.php | 10 +++++----- p/api/greader.php | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'p/api/greader.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index c6adc64cb..faf670e6e 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -26,7 +26,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } - public static function addFeed($url, $cat_id = 0, $new_cat_name = '', $http_auth = '') { + public static function addFeed($url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { @set_time_limit(300); $catDAO = new FreshRSS_CategoryDAO(); @@ -40,9 +40,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } if ($cat == null) { $catDAO->checkDefault(); - $def_cat = $catDAO->getDefault(); - $cat = $def_cat->id(); + $cat = $catDAO->getDefault(); } + $cat_id = $cat->id(); $feed = new FreshRSS_Feed($url); //Throws FreshRSS_BadUrl_Exception $feed->_httpAuth($http_auth); @@ -63,7 +63,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $values = array( 'url' => $feed->url(), 'category' => $feed->category(), - 'name' => $feed->name(), + 'name' => $title != '' ? $title : $feed->name(), 'website' => $feed->website(), 'description' => $feed->description(), 'lastUpdate' => time(), @@ -149,7 +149,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } try { - $feed = self::addFeed($url, $cat, $new_cat_name, $http_auth); + $feed = self::addFeed($url, '', $cat, $new_cat_name, $http_auth); } catch (FreshRSS_BadUrl_Exception $e) { // Given url was not a valid url! Minz_Log::warning($e->getMessage()); diff --git a/p/api/greader.php b/p/api/greader.php index 131eb65c5..dc8dd92bc 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -298,18 +298,22 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' if ($add != '' || $remove != '') { $categoryDAO = new FreshRSS_CategoryDAO(); } + $c_name = ''; if ($add != '' && strpos($add, 'user/-/label/') === 0) { //user/-/label/Example - $c_name = basename($add); + $c_name = substr($add, 13); $cat = $categoryDAO->searchByName($c_name); $addCatId = $cat == null ? -1 : $cat->id(); } else if ($remove != '' && strpos($remove, 'user/-/label/')) { $addCatId = 1; //Default category } + if ($addCatId <= 0 && $c_name = '') { + $addCatId = 1; //Default category + } $feedDAO = FreshRSS_Factory::createFeedDao(); for ($i = count($streamNames) - 1; $i >= 0; $i--) { $streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338 if (strpos($streamName, 'feed/') === 0) { - $streamName = basename($streamName); + $streamName = substr($streamName, 5); $feedId = 0; if (ctype_digit($streamName)) { if ($action === 'subscribe') { @@ -324,11 +328,15 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' switch ($action) { case 'subscribe': if ($feedId <= 0) { - //TODO - notImplemented(); - } else { - badRequest(); + $http_auth = ''; //TODO + try { + $feed = FreshRSS_feed_Controller::addFeed($streamName, $title, $addCatId, $c_name, $http_auth); + continue; + } catch (Exception $e) { + logMe("subscriptionEdit error subscribe: " . $e->getMessage()); + } } + badRequest(); break; case 'unsubscribe': if (!($feedId > 0 && FreshRSS_feed_Controller::deleteFeed($feedId))) { -- cgit v1.2.3 From 36e6c10f21aa682a737aa3754750f8ee8820598e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 25 Sep 2016 01:05:00 +0200 Subject: API rename category --- p/api/greader.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index dc8dd92bc..96c2b2ee3 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -600,6 +600,22 @@ function editTag($e_ids, $a, $r) { exit('OK'); } +function renameTag($s, $dest) { + //logMe("renameTag()"); + if ($s != '' && strpos($s, 'user/-/label/') === 0 && + $dest != '' && strpos($dest, 'user/-/label/') === 0) { + $s = substr($s, 13); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($s); + if ($cat != null) { + $dest = substr($dest, 13); + $categoryDAO->updateCategory($cat->id(), array('name' => $dest)); + exit('OK'); + } + } + badRequest(); +} + function markAllAsRead($streamId, $olderThanId) { //logMe("markAllAsRead($streamId, $olderThanId)"); $entryDAO = FreshRSS_Factory::createEntryDao(); @@ -735,6 +751,13 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo $e_ids = multiplePosts('i'); //item IDs editTag($e_ids, $a, $r); break; + case 'rename-tag': //https://github.com/theoldreader/api + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken(FreshRSS_Context::$user_conf, $token); + $s = isset($_POST['s']) ? $_POST['s'] : ''; //user/-/label/Folder + $dest = isset($_POST['dest']) ? $_POST['dest'] : ''; //user/-/label/NewFolder + renameTag($s, $dest); + break; case 'mark-all-as-read': $token = isset($_POST['T']) ? trim($_POST['T']) : ''; checkToken(FreshRSS_Context::$user_conf, $token); -- cgit v1.2.3 From 86a470b1483a8a0cb77ed00da53813f1777a1895 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 25 Sep 2016 01:11:52 +0200 Subject: API delete category --- p/api/greader.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'p/api/greader.php') diff --git a/p/api/greader.php b/p/api/greader.php index 96c2b2ee3..e77ef3726 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -616,6 +616,21 @@ function renameTag($s, $dest) { badRequest(); } +function disableTag($s, $dest) { + //logMe("renameTag()"); + if ($s != '' && strpos($s, 'user/-/label/') === 0) { + $s = substr($s, 13); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($s); + if ($cat != null) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feedDAO->changeCategory($cat->id(), 0); + exit('OK'); + } + } + badRequest(); +} + function markAllAsRead($streamId, $olderThanId) { //logMe("markAllAsRead($streamId, $olderThanId)"); $entryDAO = FreshRSS_Factory::createEntryDao(); @@ -758,6 +773,12 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo $dest = isset($_POST['dest']) ? $_POST['dest'] : ''; //user/-/label/NewFolder renameTag($s, $dest); break; + case 'disable-tag': //https://github.com/theoldreader/api + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken(FreshRSS_Context::$user_conf, $token); + $s = isset($_POST['s']) ? $_POST['s'] : ''; //user/-/label/Folder + disableTag($s); + break; case 'mark-all-as-read': $token = isset($_POST['T']) ? trim($_POST['T']) : ''; checkToken(FreshRSS_Context::$user_conf, $token); -- cgit v1.2.3 From e1528845d8827716c11322f15a5f9ce1523fd2d7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 25 Sep 2016 15:45:06 +0200 Subject: API subscription/quickadd https://github.com/FreshRSS/FreshRSS/issues/1254 --- CHANGELOG.md | 2 +- p/api/greader.php | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'p/api/greader.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c8dbec9b..a1fe033bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 2016-XX-XX FreshRSS 1.6.0-dev * API - * Support for editing feeds and categories from client applications [#1261](https://github.com/FreshRSS/FreshRSS/pull/1261) + * Support for editing feeds and categories from client applications [#1254](https://github.com/FreshRSS/FreshRSS/issues/1254) * Features * Better control of number of entries per page or RSS feed [#1249](https://github.com/FreshRSS/FreshRSS/issues/1249) * Since X hours: `https://freshrss.example/i/?a=rss&hours=3` diff --git a/p/api/greader.php b/p/api/greader.php index e77ef3726..e2d7dc039 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -361,6 +361,23 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' exit('OK'); } +function quickadd($url) { + //logMe("quickadd($url)"); + try { + $feed = FreshRSS_feed_Controller::addFeed($url); + exit(json_encode(array( + 'numResults' => 1, + 'streamId' => $feed->id(), + ))); + } catch (Exception $e) { + logMe("subscriptionEdit error subscribe: " . $e->getMessage()); + die(json_encode(array( + 'numResults' => 0, + 'error' => $e->getMessage(), + ))); + } +} + function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count //logMe("unreadCount()"); header('Content-Type: application/json; charset=UTF-8'); @@ -531,7 +548,7 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude $id = basename($streamId); } elseif (strpos($streamId, 'user/-/label/') === 0) { $type = 'c'; - $c_name = basename($streamId); + $c_name = substr($streamId, 13); $categoryDAO = new FreshRSS_CategoryDAO(); $cat = $categoryDAO->searchByName($c_name); $id = $cat == null ? -1 : $cat->id(); @@ -638,7 +655,7 @@ function markAllAsRead($streamId, $olderThanId) { $f_id = basename($streamId); $entryDAO->markReadFeed($f_id, $olderThanId); } elseif (strpos($streamId, 'user/-/label/') === 0) { - $c_name = basename($streamId); + $c_name = substr($streamId, 13); $categoryDAO = new FreshRSS_CategoryDAO(); $cat = $categoryDAO->searchByName($c_name); $entryDAO->markReadCat($cat === null ? -1 : $cat->id(), $olderThanId); @@ -749,6 +766,11 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo subscriptionEdit($streamNames, $titles, $action, $add, $remove); } break; + case 'quickadd': //https://github.com/theoldreader/api + if (isset($_GET['quickadd'])) { + quickadd($_GET['quickadd']); + } + break; } } break; -- cgit v1.2.3 From 9291748c4745ff8f4be2beaa2998869fd26e907e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 26 Sep 2016 10:44:44 +0200 Subject: API implement user-info and fix edits https://github.com/FreshRSS/FreshRSS/issues/1254 https://github.com/jangernert/FeedReader/issues/59#issuecomment-249491580 --- app/Controllers/feedController.php | 20 +++++++++++----- app/Models/CategoryDAO.php | 3 +++ data/users/_/config.default.php | 1 + p/api/greader.php | 47 ++++++++++++++++++++++++++++++-------- 4 files changed, 55 insertions(+), 16 deletions(-) (limited to 'p/api/greader.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index faf670e6e..ca7a818c6 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -473,17 +473,25 @@ class FreshRSS_feed_Controller extends Minz_ActionController { return $feedDAO->updateFeed($feed_id, array('name' => $feed_name)); } - public static function moveFeed($feed_id, $cat_id) { + public static function moveFeed($feed_id, $cat_id, $new_cat_name = '') { if ($feed_id <= 0) { return false; } - if ($cat_id <= 0) { - // If category was not given get the default one. - $catDAO = new FreshRSS_CategoryDAO(); + + $catDAO = new FreshRSS_CategoryDAO(); + if ($cat_id > 0) { + $cat = $catDAO->searchById($cat_id); + $cat_id = $cat == null ? 0 : $cat->id(); + } + if ($cat_id <= 1 && $new_cat_name != '') { + $cat_id = $catDAO->addCategory(array('name' => $new_cat_name)); + } + if ($cat_id <= 1) { $catDAO->checkDefault(); - $def_cat = $catDAO->getDefault(); - $cat_id = $def_cat->id(); + $cat = $catDAO->getDefault(); + $cat_id = $cat->id(); } + $feedDAO = FreshRSS_Factory::createFeedDao(); return $feedDAO->updateFeed($feed_id, array('category' => $cat_id)); } diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index fc431553e..c103163a1 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -50,6 +50,9 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable } public function deleteCategory($id) { + if ($id <= 1) { + return false; + } $sql = 'DELETE FROM `' . $this->prefix . 'category` WHERE id=?'; $stm = $this->bd->prepare($sql); diff --git a/data/users/_/config.default.php b/data/users/_/config.default.php index 2c56d5f45..6e1d497bc 100644 --- a/data/users/_/config.default.php +++ b/data/users/_/config.default.php @@ -5,6 +5,7 @@ return array ( 'old_entries' => 3, 'keep_history_default' => 0, 'ttl_default' => 3600, + 'mail_login' => '', 'token' => '', 'passwordHash' => '', 'apiPasswordHash' => '', diff --git a/p/api/greader.php b/p/api/greader.php index e2d7dc039..8b1e0ffb1 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -222,6 +222,17 @@ function checkToken($conf, $token) { unauthorized(); } +function userInfo() { //https://github.com/theoldreader/api#user-info + //logMe("userInfo()"); + $user = Minz_Session::param('currentUser', '_'); + exit(json_encode(array( + 'userId' => $user, + 'userName' => $user, + 'userProfileId' => $user, + 'userEmail' => FreshRSS_Context::$user_conf->mail_login, + ))); +} + function tagList() { //logMe("tagList()"); header('Content-Type: application/json; charset=UTF-8'); @@ -299,14 +310,24 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' $categoryDAO = new FreshRSS_CategoryDAO(); } $c_name = ''; - if ($add != '' && strpos($add, 'user/-/label/') === 0) { //user/-/label/Example - $c_name = substr($add, 13); + if ($add != '' && strpos($add, 'user/') === 0) { //user/-/label/Example ; user/username/label/Example + if (strpos($add, 'user/-/label/') === 0) { + $c_name = substr($add, 13); + } else { + $user = Minz_Session::param('currentUser', '_'); + $prefix = 'user/' . $user . '/label/'; + if (strpos($add, $prefix) === 0) { + $c_name = substr($add, strlen($prefix)); + } else { + $c_name = ''; + } + } $cat = $categoryDAO->searchByName($c_name); $addCatId = $cat == null ? -1 : $cat->id(); } else if ($remove != '' && strpos($remove, 'user/-/label/')) { $addCatId = 1; //Default category } - if ($addCatId <= 0 && $c_name = '') { + if ($addCatId <= 0 && $c_name == '') { $addCatId = 1; //Default category } $feedDAO = FreshRSS_Factory::createFeedDao(); @@ -345,9 +366,7 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' break; case 'edit': if ($feedId > 0) { - if ($addCatId > 0) { - FreshRSS_feed_Controller::moveFeed($feedId, $addCatId); - } + FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name); if ($title != '') { FreshRSS_feed_Controller::renameFeed($feedId, $title); } @@ -633,8 +652,8 @@ function renameTag($s, $dest) { badRequest(); } -function disableTag($s, $dest) { - //logMe("renameTag()"); +function disableTag($s) { + //logMe("disableTag($s)"); if ($s != '' && strpos($s, 'user/-/label/') === 0) { $s = substr($s, 13); $categoryDAO = new FreshRSS_CategoryDAO(); @@ -642,6 +661,9 @@ function disableTag($s, $dest) { if ($cat != null) { $feedDAO = FreshRSS_Factory::createFeedDao(); $feedDAO->changeCategory($cat->id(), 0); + if ($cat->id() > 1) { + $categoryDAO->deleteCategory($cat->id()); + } exit('OK'); } } @@ -798,8 +820,10 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo case 'disable-tag': //https://github.com/theoldreader/api $token = isset($_POST['T']) ? trim($_POST['T']) : ''; checkToken(FreshRSS_Context::$user_conf, $token); - $s = isset($_POST['s']) ? $_POST['s'] : ''; //user/-/label/Folder - disableTag($s); + $s_s = multiplePosts('s'); + foreach ($s_s as $s) { + disableTag($s); //user/-/label/Folder + } break; case 'mark-all-as-read': $token = isset($_POST['T']) ? trim($_POST['T']) : ''; @@ -814,6 +838,9 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo case 'token': token(FreshRSS_Context::$user_conf); break; + case 'user-info': + userInfo(); + break; } } elseif ($pathInfos[1] === 'check' && $pathInfos[2] === 'compatibility') { checkCompatibility(); -- cgit v1.2.3 From d5ca360ca967d327a184429a2e37aed196add7a0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 26 Sep 2016 15:20:02 +0200 Subject: API fix feed rename https://github.com/FreshRSS/FreshRSS/issues/1254 https://github.com/jangernert/FeedReader/issues/59#issuecomment-249558202 --- app/Controllers/feedController.php | 2 +- p/api/greader.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'p/api/greader.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index ca7a818c6..c2a22aeb3 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -474,7 +474,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } public static function moveFeed($feed_id, $cat_id, $new_cat_name = '') { - if ($feed_id <= 0) { + if ($feed_id <= 0 || ($cat_id <= 0 && $new_cat_name == '')) { return false; } diff --git a/p/api/greader.php b/p/api/greader.php index 8b1e0ffb1..4965ffd3b 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -323,13 +323,10 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' } } $cat = $categoryDAO->searchByName($c_name); - $addCatId = $cat == null ? -1 : $cat->id(); + $addCatId = $cat == null ? 0 : $cat->id(); } else if ($remove != '' && strpos($remove, 'user/-/label/')) { $addCatId = 1; //Default category } - if ($addCatId <= 0 && $c_name == '') { - $addCatId = 1; //Default category - } $feedDAO = FreshRSS_Factory::createFeedDao(); for ($i = count($streamNames) - 1; $i >= 0; $i--) { $streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338 @@ -366,7 +363,9 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' break; case 'edit': if ($feedId > 0) { - FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name); + if ($addCatId > 0 || $c_name != '') { + FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name); + } if ($title != '') { FreshRSS_feed_Controller::renameFeed($feedId, $title); } -- cgit v1.2.3