Commit Graph

144 Commits

Author SHA1 Message Date
0132ccd2a2 Change the way to define algorithm for hashing url 2019-05-24 15:17:46 +02:00
4a5516376b Add Wallabag\CoreBundle\Helper\UrlHasher
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-05-24 15:17:46 +02:00
d5744bf0df Delegate findByUrlAndUserId to findByHashedUrlAndUserId
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-05-24 15:17:46 +02:00
a2b5d67560 Merge pull request #3960 from wallabag/api-entries-2817
api/entries: add parameter detail to exclude or include content in response
2019-05-21 11:18:19 +02:00
2c290747cb api/entries: add parameter detail to exclude or include content in response
detail=metadata will nullify the content field of entries in order to
make smaller responses.

detail=full keeps the former behavior, it sends the content of entries.
It's the default, for backward compatibility.

Fixes #2817

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-05-18 18:11:08 +02:00
9f0957b831 Merge remote-tracking branch 'origin/master' into 2.4 2019-05-15 14:38:07 +02:00
f45496336f Add ability to match many domains for credentials
Instead of fetching one domain, we use the same method as in site config (to retrieve the matching file) and handle api.example.org, example.org, .org (yes the last one isn’t useful).
If one of these match, we got it and use it.
2019-04-23 22:39:31 +02:00
c579ce2306 Some cleanup
Also, do not run the hashed_url migration into a Doctrine migration
2019-04-01 14:34:20 +02:00
9c2b2aae70 Keep url in exists endpoint
- Add migration
- Use md5 instead of sha512 (we don't need security here, just a hash)
- Update tests
2019-04-01 13:24:40 +02:00
0182cdaec4 CS 2019-02-11 11:57:52 +01:00
091bafeb4c Handle no random result found 2019-01-19 22:30:50 +01:00
50f35f0db2 Move icon into the top menu bar
Change the way to select a random entry:
- select all ids from the given user (with filters)
- choose randomly one in php
- find that entry
2019-01-19 22:24:10 +01:00
9a57653aec Redirect to the current view instead of homepage 2019-01-19 21:10:16 +01:00
062fad434a Better random function 2019-01-19 21:09:33 +01:00
f85d220c19 Fix tests 2019-01-19 21:09:33 +01:00
09ef25c3c3 Added random feature 2019-01-19 21:09:32 +01:00
3afc87426d CS 2019-01-15 09:49:22 +01:00
5419a8368e Merge remote-tracking branch 'origin/master' into 2.4 2019-01-15 09:41:18 +01:00
78e3fafa3f Avoid error when a bad order parameter is given
Only allowed parameter are asc & desc
2019-01-14 17:01:21 +01:00
2a0e0a47d8 TagRestController: rewrite delete actions to only retrieve tags related to the user
Fixes #3815

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:49 +01:00
6708bf238d TagRepository: refactor query builder for queries by userId
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:44 +01:00
9007fe0062 Sort archive page by archived at 2018-09-21 11:18:29 +02:00
7c0d682687 Code Style 2018-09-21 10:33:33 +02:00
0e70e81227 Entry: add sort parameter archived 2018-09-21 10:33:33 +02:00
17476f4d8d Add missing parameters
Parameters weren’t passed to the sub function.
2018-09-07 13:56:14 +02:00
b8115ff46b php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
0636697289 EntryRepository: refactor getBuilderForUntaggedByUser
Improve SQL performance by replacing size(e.tags) with a left join and a
null condition

Move the QueryBuilder logic into getRawBuilderForUntaggedByUser

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
b7c5fda512 EntryRepository: refactor getBuilderByUser
We refactor getBuilderByUser to separate QueryBuilder getter and the
orderBy(). The previous code of getBuilderByUser() has been moved to
getSortedQueryBuilderByUser(). getBuildByUser() now returns a
QueryBuilder without the call to orderBy().

A new method named sortQueryBuilder() returns a given QueryBuilder with
an orderBy() call using given sort parameters.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
fafdf17117 Fix #3361 check type for tags in entry repository
Check is $tags is a string before explode
2017-10-12 07:38:27 +02:00
9c4a7388da Remove unused function
Introduce after the rebase I guess
2017-09-06 22:58:35 +02:00
33264c2d02 Fix tests 2017-09-06 22:49:16 +02:00
7c04b7396a Multiple tag search was broken from API
First, the setParameter() were done on the same parameter which in fact
just duplicated the condition in the SQL query (like `where t.label =
'test' and t.label = 'test'`.

Changed the parameter doesn't help because the query was then wrong.

Changing the way to match associated tags for an entry and it worked.
2017-09-06 22:49:15 +02:00
a991c46eed Set a starred_at field when an entry is starred.
This date is used to sort starred entries.

Can not use Entry::timestamps method otherwise starred_at will be updated each time entry is updated.
Add an updateStar method into Entry class
A migration script has been added in order to set starred_at field.
2017-08-25 21:19:47 +02:00
dbf1188c5b rename getAllEntriesIdAndUrl into findAllEntriesIdAndUrlByUserId 2017-08-22 10:42:54 +02:00
215409a8b2 rename getAllEntriesId into findAllEntriesIdByUserId 2017-08-22 10:41:28 +02:00
511f1ce1e8 Add reload entry command 2017-08-21 10:45:48 +02:00
935e9fffb4 Reduce number of queries on tag list 2017-08-06 23:02:32 +02:00
52b84c11a5 Fix some namespaces and phpdoc 2017-07-29 22:51:50 +02:00
38520658ad Fix tests 2017-07-03 07:30:54 +02:00
f808b01692 Add a real configuration for CS-Fixer 2017-07-01 09:52:38 +02:00
80784b782b Merge pull request #2683 from wallabag/credentials-in-db
Store credentials in DB
2017-06-20 16:40:48 +02:00
bead8b42da Fix reviews
Encrypt username too
Redirect to list after saving credentials
Fix typos

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-06-20 16:03:39 +02:00
906424c1b6 Crypt site credential password 2017-06-20 16:03:35 +02:00
5a9bc00726 Retrieve username/password from database
Inject the current user & the repo to retrieve username/password from the database
2017-06-20 16:03:13 +02:00
fc6d92c63d Update route & user verification 2017-06-20 16:03:13 +02:00
f92fcb53ca Add CRUD for site credentials 2017-06-20 16:03:08 +02:00
1112e54772 Add public filter/field in the API
Listing entries can now be filtered by “public”.
Creating or patching an entry can now set is to public or remove the public.
Entry response now include “is_public” boolean field
2017-06-10 15:31:57 +02:00
89f108b45a Fixed @j0k3r review 2017-05-05 14:54:03 +02:00
d09fe4d233 Added test for deduplication 2017-05-05 14:33:36 +02:00