Commit Graph

201 Commits

Author SHA1 Message Date
Andrew Dolgov a8cc43a0ff move logout_user() to UserHelper 2021-02-14 15:31:03 +03:00
Philip Klempin ace19c0790 Add defaults to api.php variables 2021-02-12 10:59:30 +01:00
Andrew Dolgov 09e9f34bb4 add UserHelper::find_user_by_login() and rewrite some user checks to invoke it instead of going through PDO 2021-02-11 10:22:27 +03:00
Andrew Dolgov 7af8744c85 authentication: make logins case-insensitive (force lowercase) 2021-02-11 09:57:57 +03:00
Andrew Dolgov 2f8efab275 api: one more php8 warning 2021-02-09 12:04:59 +03:00
Andrew Dolgov 6a25bc53ef api: pass hook object payload by reference 2021-02-09 08:57:23 +03:00
Andrew Dolgov 3655e7aaf1 api: fix some php8 warnings (4) 2021-02-09 08:50:51 +03:00
Andrew Dolgov aba028a375 api: fix some php8 warnings (3) 2021-02-09 08:47:41 +03:00
Andrew Dolgov 0871a51cb4 api: fix some php8 warnings (2) 2021-02-09 08:16:04 +03:00
Andrew Dolgov 63a90d26f3 api: fix some php8 warnings 2021-02-09 08:15:07 +03:00
Andrew Dolgov 7874f6ac58 remove PHPMD.UnusedFormalParameter 2021-02-08 19:42:10 +03:00
Andrew Dolgov fa2ebcd0a2 api: rewrite a few more hooks 2021-02-08 17:03:34 +03:00
Andrew Dolgov 41fc03287e fix even more warnings reported by phpstan 2021-02-06 17:56:47 +03:00
Andrew Dolgov 403dca154c initial WIP for php8; bump php version requirement to 7.0 2021-02-05 23:41:32 +03:00
Andrew Dolgov a8302fb253 use X-Real-IP headers if possible while authenticating 2021-01-05 10:17:24 +03:00
Andrew Dolgov e40b79ab33 get_article_image: return basic kind to which flavor image belongs 2020-12-07 12:09:06 +03:00
Andrew Dolgov 935f163919 api: catchupfeed: allow passing 'mode' (optional), bump api version 2020-10-03 10:23:21 +03:00
Andrew Dolgov 6811d0bde2 use self:: in some places to invoke static methods from the same class 2020-09-22 14:54:15 +03:00
Andrew Dolgov 74568df4ff remove a lot of stuff from global context (functions.php), add a few helper classes instead 2020-09-22 09:04:33 +03:00
Andrew Dolgov dfa65e9374 move order_by to SQL override logic into a separate function 2020-08-13 11:52:32 +03:00
Andrew Dolgov 48be005774 instead of taking batch timestamp and score (?) into account, make oldest first sorting work consistently with newest first - i.e. rely on feed-provided timestamp 2020-08-11 13:29:09 +03:00
Paco Esteban c4ee0e25a1 more int/string type mismatches on getCategories 2020-08-01 16:30:10 +02:00
Paco Esteban 3da618e0ea make sure all ints are casted (to int) on getCategories 2020-07-31 16:15:16 +02:00
Andrew Dolgov 6080cca9ca scrap counter cache system; rework counters to sum() booleans instead 2020-01-24 14:25:31 +03:00
Andrew Dolgov b1c5ebdace API/getVersion: don't try to use removed VERSION constant 2020-01-05 09:42:57 +03:00
Andrew Dolgov 68b0380118 add placeholder authentication via app passwords if service is passed
forbid logins via regular passwords for services
remove AUTH_DISABLE_OTP
2019-11-01 13:03:06 +03:00
Andrew Dolgov e46ed1ff97 API/getHeadlines: fix order of returned feeds to be consistent with main UI 2019-08-15 19:06:38 +03:00
Andrew Dolgov d4df57e1a4 Article::get_article_image() - also return stream URI if possible 2019-08-14 17:04:14 +03:00
Andrew Dolgov 68e2b05f65 * move get_article_image to Article; implement better og:image detection (similar to android app)
* pass article image to API clients in headlines row object
2019-08-14 16:55:38 +03:00
Andrew Dolgov 133c2b482b move rewrite_cached_urls to DiskCache::rewriteUrls() 2019-08-13 12:46:57 +03:00
Andrew Dolgov 2ab49fec9a API: getHeadlines: return feed_id for Archived entries as 0 instead of null to be consistent with requested feed_id 2018-08-29 15:13:07 +03:00
Andrew Dolgov a291a0c00f API: oops, forgot that headlines could be requested for a tag 2018-08-29 12:55:03 +03:00
Andrew Dolgov 70e180e887 API: getHeadlines: check for feed_id correctly 2018-08-29 12:53:33 +03:00
Andrew Dolgov 2aef804f4b split transparent rewriting of locally cached media URLs to execute after both sanitize() and HOOK_RENDER_ARTICLE to allow plugins work on original source URLs consistently 2018-08-20 12:12:32 +03:00
Andrew Dolgov e6532439d6 force strip_tags() on all user input unless explicitly allowed 2017-12-03 23:35:38 +03:00
Andrew Dolgov fa3bcfa379 queryfeedheadlines: there's no need to quote order_by/override_order
else: feedicon cache busting etc
2017-12-03 22:49:57 +03:00
Andrew Dolgov 4dc3f7e779 api: do not use sql_bool_to_bool() 2017-12-03 11:06:49 +03:00
JustAMacUser 1a05210933 Fixed PDO query to prepared statement in API::updateArticles. 2017-12-02 14:08:55 -05:00
Andrew Dolgov 9652fa6b66 API: small fix 2017-12-01 22:49:12 +03:00
Andrew Dolgov 3467e1fd7c api: switch to PDO 2017-12-01 22:46:22 +03:00
Andrew Dolgov 91f49ba17d api, setArticleLabel: allow JSON booleans 2017-10-15 16:47:44 +03:00
Gilles Grandou 81d96c0dee makes 'order by title' to sort by title and by ascending date
* this allows to chronologically browse all articles with the
  same title.
2017-10-09 22:50:03 +02:00
Andrew Dolgov c053b97697 pref/feeds: start user category ordering from 1
api, getFeeds: send subcategory order_id
2017-06-26 16:29:57 +03:00
Andrew Dolgov 5b6ea1ef91 remove pubsubhubbub: dead 2017-05-16 10:41:20 +03:00
Andrew Dolgov e6c886bf66 wrap rssfuncs into rssutils class 2017-05-05 18:10:07 +03:00
Andrew Dolgov 65af3b2cbb move counter stuff to a separate class 2017-05-05 11:54:31 +03:00
Andrew Dolgov 7c9b5a3fe4 move label stuff to Labels class
fix some unresolved functions
2017-05-04 15:57:40 +03:00
Andrew Dolgov 4a0da0e5bf move get_article_labels to Article 2017-05-04 15:26:21 +03:00
Andrew Dolgov 2ed0d6c433 move counter cache to a separate class
fix references to get_article_tags
2017-05-04 15:22:57 +03:00
Andrew Dolgov aeb1abedb2 move a bunch of functions into Feeds/Article namespaces
+       static function catchupArticlesById($ids, $cmode, $owner_uid = false) {
+       static function getLastArticleId() {
+       static function queryFeedHeadlines($params) {
+       static function getParentCategories($cat, $owner_uid) {
+       static function getChildCategories($cat, $owner_uid) {

move the rest of functions2.php back to functions.php as it is of more manageable size, remove the former
2017-05-04 15:13:02 +03:00
Andrew Dolgov a230bf88a9 move to Article:
+       static function purge_orphans($do_output = false) {

move to Feeds

+       static function getGlobalUnread($user_id = false) {
+       static function getCategoryTitle($cat_id) {
+       static function getLabelUnread($label_id, $owner_uid = false) {
2017-05-04 15:00:21 +03:00
Andrew Dolgov 86a8351ca2 move the following to Feeds:
+       static function catchup_feed($feed, $cat_view, $owner_uid = false, $mode = 'all', $search = false) {
+       static function getFeedArticles($feed, $is_cat = false, $unread_only = false,
+       static function subscribe_to_feed($url, $cat_id = 0,
+       static function getFeedIcon($id) {
+       static function getFeedTitle($id, $cat = false) {
+       static function getCategoryUnread($cat, $owner_uid = false) {
+       static function getCategoryChildrenUnread($cat, $owner_uid = false) {
2017-05-04 14:50:56 +03:00
Andrew Dolgov 7e5f8d9fb3 move the following to Article:
+       static function format_article_enclosures($id, $always_display_enclosures,
+       static function format_article($id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false) {
+       static function get_article_tags($id, $owner_uid = 0, $tag_cache = false) {
+       static function format_tags_string($tags) {
+       static function format_article_labels($labels) {
+       static function format_article_note($id, $note, $allow_edit = true) {
+       static function get_article_enclosures($id) {
2017-05-04 14:38:45 +03:00
Andrew Dolgov 3517d363d3 add api test for labels, api: fix setArticleLabel assign not handled correctly 2017-04-27 09:04:23 +03:00
Andrew Dolgov 891df34637 add some basic API unit tests 2017-04-27 00:24:17 +03:00
Andrew Dolgov ea79a0e033 remove some redundant php closing tags 2017-04-26 20:24:18 +03:00
Andrew Dolgov 7b55001eee fix various issues reported by static analysis
update gitlab-ci config
2017-04-26 15:29:22 +03:00
Andrew Dolgov cb3f877303 reference pubsubhubbub classes using their namespace 2017-01-23 08:20:46 +03:00
John Brayton f1b3b3f330 Add feed_id to subscribeToFeed response when the code is 1 or 0.
Set the API_LEVEL to 14.
2016-08-27 10:29:25 -04:00
Andrew Dolgov 1818614949 api: fix article guid not being passed to render article hook 2016-07-20 15:38:42 +03:00
Andrew Dolgov 29c92d7b08 prevent frontend updating of feeds on view if open_basedir is set to prevent plugins potentially not working correctly (i.e. if backend system has open_basedir disabled) 2016-01-23 12:13:03 +03:00
JustAMacUser 73c77ab0a5 Add optional (default: true), boolean "sanitize" parameter to API::getArticle() method. 2015-11-23 14:57:03 -05:00
Andrew Dolgov 19e47ad60b queryFeedHeadlines: don't check first_id when sorting by oldest first 2015-11-21 22:20:00 +03:00
Andrew Dolgov 94b8ce6cec queryfeedheadlines: remove disable_offsets hack 2015-09-15 12:33:58 +03:00
Andrew Dolgov 0bd172cd6a experimental: if using adaptive/unread mode w/ auto catchup don't calculate offsets because we're only interested in top $limit headlines anyway 2015-08-05 10:13:30 +03:00
Andrew Dolgov 48fefe2f6b fixes for first_id stuff 2015-07-12 18:08:02 +03:00
Andrew Dolgov ec57104d6e apparently it's a bad idea to do is_resource() on a mysqli result 2015-07-12 14:23:32 +03:00
Andrew Dolgov 96ac72bc12 api: getHeadlines: cast feed_it to int if needed 2015-07-12 13:18:03 +03:00
Andrew Dolgov b0ce3d33c3 api: initialize headlines header 2015-07-12 12:37:19 +03:00
Andrew Dolgov 491f69c7e3 bump api level 2015-07-12 12:27:18 +03:00
Andrew Dolgov 5c784e701c api: add top id stuff, optionally return header w/ status information in getHeadlines (currently only top_id_changed) 2015-07-12 12:26:09 +03:00
Andrew Dolgov 3444020100 report top id changed in headlines buffer 2015-07-12 12:01:34 +03:00
Andrew Dolgov f5a0fb8b64 queryFeedHeadlines: move to array-based arguments, optionally check if first element changed when paginating 2015-07-12 01:29:36 +03:00
Andrew Dolgov 9090b874ab simplify search, remove search_mode as useless
remove dialog to select by tags, simplify browsing by tag query
2015-07-07 15:59:32 +03:00
Andrew Dolgov 3194a70a03 api: getHeadlines: add configurable excerpt_length (bump api version) 2014-11-29 20:16:09 +03:00
Andrew Dolgov 9997b38e3e api: allow requesting headlines as if client supports iframe sandboxing 2014-11-25 13:45:21 +03:00
Andrew Dolgov f71a669b7d api: handle uncached labels the way main headlines function does it 2014-10-27 22:07:20 +03:00
Andrew Dolgov 4baa1afa43 add force_update to api getHeadlines; bump api version to 9 2014-10-16 09:53:54 +04:00
Dave Zaikos a2108ee96d Added syslog reporting for failed API login attempts. 2014-01-24 19:19:10 -05:00
Andrew Dolgov 1d3cbe31c3 api: fix getFeeds returning some ids in string format 2014-01-24 15:33:16 +04:00
Andrew Dolgov 429ff9afb0 api: add article language to getArticle/getHeadlines 2013-12-04 01:30:54 +04:00
Andrew Dolgov bf5bcb8e27 queryFeedHeadlines: remove obsolete content_preview 2013-11-29 13:54:30 +04:00
Andrew Dolgov 25237aea43 api: fix getLabels never returning existing checked labels correctly 2013-11-27 21:54:27 +04:00
Andrew Dolgov 21bb3c064a api: add note support for getHeadlines/getArticle (bump api version) 2013-11-23 20:22:02 +04:00
Andrew Dolgov 273c33e512 api: allow sorting headlines by title 2013-11-09 16:42:41 +04:00
Andrew Dolgov 788cf0a1b1 api: fix setArticleLabel expecting wrong format for label_id 2013-10-12 09:55:35 +04:00
Matt Haley 64595782ff API should return excerpt when asked 2013-08-04 10:41:29 -07:00
Andrew Dolgov d208abc933 api: pass article id to sanitize 2013-08-02 14:41:01 +04:00
Andrew Dolgov 891d033c97 api: getLabels: return converted label ids 2013-07-28 23:37:19 +04:00
Andrew Dolgov c052e25a8b remove unused cached_content 2013-07-10 16:55:55 +04:00
Andrew Dolgov 4f2a2ca945 api: fix typo 2013-07-10 16:44:36 +04:00
justauser 3b96b0ed7c Merge branch 'master' into hookhead
Conflicts:
	include/functions.php

changes for conflicts with master
2013-07-07 13:57:06 -04:00
Andrew Dolgov e9687f67e0 date_reverse view mode: take scoring into account 2013-07-06 12:03:01 +04:00
justauser 6763143835 Changed the implementation of HOOK_QUERY_HEADLINES to deal with issue Fox raised 2013-06-28 10:46:45 -04:00
justauser 891e36f57e Changes to add a new hook: HOOK_QUERY_HEADLINES. An example is provided. 2013-06-27 11:18:23 -04:00
Andrew Dolgov 6f81395d73 api, getArticle: check for article_id being present 2013-05-15 22:29:31 +04:00
Andrew Dolgov bd3c672320 api, add sanitize to getHeadlines (defaults to true) 2013-05-15 18:07:35 +04:00
Rasmus Lerdorf 6f7798b643 Fixing bugs found by static analysis 2013-05-07 00:35:10 -07:00
Andrew Dolgov 38a8c22b9e getHeadlines: return feed title for non-virtual feeds 2013-04-27 12:29:42 +04:00
Andrew Dolgov 2c8eed5395 api: add feed_title to getArticle 2013-04-27 12:25:40 +04:00