Commit Graph

90 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
51236df4ed fix: check if user has read priv before flagging 2020-01-22 12:14:50 -05:00
Julian Lam
8e5a2276af feat: check flag values on save (assignee and state) (#8122)
* feat: add assignee checking when updating flag

Prior to this, it was possible to update the assignee to any value (or
any user. This commit adds checking to allow only admins, global
moderators, or in the case of flagged posts, moderators.

Also some prep work was added for value checking `state`.

* feat: value checking `state` on flag update

The state should be one of the constants defined earlier in the file.
2020-01-20 10:19:23 -05:00
Baris Usakli
2150701f32 fix: missing await 2019-09-28 15:08:51 -04:00
Baris Usakli
ac6eb31c69 refactor: async/await flags.js 2019-09-28 14:37:50 -04:00
Barış Soner Uşaklı
0ced71be39 refactor: async/await flags 2019-09-26 22:51:11 -04:00
Baris Usakli
a651d154ce fix: #7921, dont create wrong entries in db for flag
upgrade script to remove wrong entries
2019-09-24 12:22:40 -04:00
Barış Soner Uşaklı
e32a55460f refactor: remove logs 2019-09-24 00:36:42 -04:00
Barış Soner Uşaklı
9ee1a882ec refactor: async/await flags 2019-09-24 00:30:59 -04:00
Julian Lam
0921230976 fix(style): updated code to follow new eslint recommendations
Squashed commit of the following:

commit f9ce878b26
Author: Julian Lam <julian@nodebb.org>
Date:   Tue Aug 13 14:30:46 2019 -0400

    fix(style): updated code to follow new eslint recommendations

commit 80dd370e41
Author: Julian Lam <julian@nodebb.org>
Date:   Tue Aug 13 14:14:58 2019 -0400

    fix(deps): update dependency sitemap to v4

    Squashed commit of the following:

    commit f4dd9cabb2
    Author: Julian Lam <julian@nodebb.org>
    Date:   Tue Aug 13 11:33:05 2019 -0400

        fix: resolved breaking changes from sitemap v4 upgrade

    commit 9043415ee1
    Merge: e3352b272 72590b346
    Author: Julian Lam <julian@nodebb.org>
    Date:   Tue Aug 13 11:09:55 2019 -0400

        Merge branch 'master' into renovate/sitemap-4.x

    commit e3352b272e
    Author: Renovate Bot <bot@renovateapp.com>
    Date:   Mon Aug 12 07:59:05 2019 +0000

        fix(deps): update dependency sitemap to v4

commit 8e3c0cdcae
Author: Renovate Bot <bot@renovateapp.com>
Date:   Fri Aug 9 00:49:51 2019 +0000

    fix(deps): update dependency commander to v3

commit 2104449d38
Author: Renovate Bot <bot@renovateapp.com>
Date:   Tue Aug 13 15:00:27 2019 +0000

    fix(deps): update dependency mongodb to v3.3.0

commit d2937f446a
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Tue Aug 13 10:36:48 2019 -0400

    feat: async/await admin/controllers

commit 1b97e8b199
Author: Misty (Bot) <deploy@nodebb.org>
Date:   Tue Aug 13 09:28:39 2019 +0000

    Latest translations and fallbacks

commit 69a48957a2
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Mon Aug 12 21:56:09 2019 -0400

    feat: async/await

commit b9b2a7e593
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Mon Aug 12 20:58:29 2019 -0400

    feat: async/await refactor

    controllers/accounts

commit a8d43a1759
Author: Baris Usakli <barisusakli@gmail.com>
Date:   Mon Aug 12 14:49:40 2019 -0400

    feat: async/await controllers/accounts

commit 2f25aae57b
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 23:09:50 2019 -0400

    fix: #7831, fix pagination

    convert to async/await

commit c9e83f2374
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 00:14:35 2019 -0400

    fix: remove empty line

commit 30be91b26c
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 00:13:41 2019 -0400

    fix: remove useless catchs and empty line

commit 2e4a71c0b6
Author: Renovate Bot <bot@renovateapp.com>
Date:   Sat Aug 10 06:51:50 2019 +0000

    chore(deps): update dependency eslint-config-airbnb-base to v14
2019-08-13 15:12:27 -04:00
Barış Soner Uşaklı
0d047f4eb9 feat: #7743, webserver 2019-07-22 18:16:18 -04:00
Barış Soner Uşaklı
7b95ebbb6a fix: #7748, if reputation system is disabled, dont check min reputation 2019-07-11 09:54:46 -04:00
Julian Lam
91f0bce628 fix: #7624, default open state on stateless flags 2019-05-21 12:23:19 -04:00
Barış Soner Uşaklı
81aa3a0b8a fix: don't crash in flags.validate if user blocked target 2018-12-09 15:25:43 -05:00
Julian Lam
d027207f88 fix: flags detail page crash if reporter blocks author
Fixed an issue where the flags detail page would crash if the
reporting user flagged a post and then proceeded to block the
post author.

Retrieval of a flag's target data should be irrespective of
block status.

fixes #6925
2018-11-08 13:43:45 -05:00
Barış Soner Uşaklı
f3a679e268 remove parseInts 2018-10-25 17:02:59 -04:00
Barış Soner Uşaklı
9c022afae1 Parse int (#6853)
* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
2018-10-21 16:47:51 -04:00
Barış Soner Uşaklı
dff86b1ac9 closes #6740
* flag notifications will go to the flag details page instead of the post or user that was flag
* if you assign a flag to yourself you won't get a notification about it
@benlubar
2018-09-18 17:28:24 -04:00
Julian Lam
2ce6a85756 properly closes #6698 2018-08-13 14:17:51 -04:00
Julian Lam
ed9dc113b0 sanitizing notes in flags details page, fixes #6698 2018-08-10 15:01:49 -04:00
Barış Soner Uşaklı
b7f5995aab closes #6550 2018-06-03 14:54:25 -04:00
Julian Lam
7ba2ac9f69 Merge remote-tracking branch 'origin/master' into develop 2018-04-11 16:30:03 -04:00
Barış Soner Uşaklı
bb13c4948d closes #6448 2018-04-11 13:18:52 -04:00
Barış Soner Uşaklı
0070f5c1b2 Merge remote-tracking branch 'refs/remotes/origin/master' into develop 2018-04-05 12:34:38 -04:00
Julian Lam
e8d4fe3209 Revert "closes #6380"
Turns out the issue was a malformed flag object, and not anything
code-wise

This reverts commit 956c5a2a32.
2018-03-22 09:58:09 -04:00
Julian Lam
956c5a2a32 closes #6380 2018-03-22 09:14:37 -04:00
Baris Usakli
29b7c67946 use utils.toISOString 2018-03-15 12:43:11 -04:00
Baris Usakli
a48144e632 dont crash if description is numeric 2018-03-15 12:40:43 -04:00
Julian Lam
a126f07471 closes #6043 2018-03-09 12:57:52 -05:00
Barış Soner Uşaklı
2983fc3e5e get group names first 2018-02-07 20:02:07 -05:00
Barış Soner Uşaklı
bb9528b82e closes #6314 2018-02-07 18:29:56 -05:00
Barış Soner Uşaklı
7f67528280 change parallel to series in flag creation 2018-01-18 12:48:42 -05:00
Barış Soner Uşaklı
72140e5338 closes #5991, closes #5884 2018-01-12 17:29:47 -05:00
Baris Usakli
a19537dc25 closes #6137 2017-11-29 14:04:45 -05:00
Barış Soner Uşaklı
dd176dd5f2 Notification delivery (#6072)
* ability for users to choose how they receive notifications

add type field to more notifications, the type field is used to
determine what to do based on user
setting(none,notification,email,notificationemail)

* change var name to types

* cleanup

* add event types for privileged users

* remove unused language keys

* fix uids check

* changed if statements

* upgrade script to preserver old settings
2017-11-15 21:35:10 -05:00
Barış Soner Uşaklı
67bc58f04c wait for state to be updated 2017-11-12 08:45:08 -05:00
Peter Jaszkowiak
e609e497b3 Provide more error information to logs
Provides full stack instead of just message
2017-11-01 18:59:48 -06:00
Peter Jaszkowiak
46fafb20b9 Remove string.js dependency 2017-10-13 21:02:41 -06:00
Julian Lam
b44cfacda1 resolve XSS vulnerability in flags pages 2017-10-13 11:54:16 -04:00
Peter Jaszkowiak
da9da8190f Bump dependencies
Bumping eslint & configs meant making some linting fixes

For future reference, the `xmlhttprequest-ssl` library must be of equal versioning to the one in `engine.io-client`, otherwise it won't be deduped which causes the socket.io tests to fail
2017-10-02 09:24:27 -04:00
Julian Lam
932b3f06a5 closes #5797 2017-07-04 10:09:41 -04:00
Julian Lam
f4fb9ee04b adding filter hooks for flag list and retrieval 2017-06-16 10:58:21 -04:00
Peter Jaszkowiak
3c2d4fe649 Switch from underscore to lodash 2017-05-27 14:51:45 -06:00
Barış Soner Uşaklı
8e31ec7199 closes #5705 2017-05-26 23:30:23 -04:00
Barış Soner Uşaklı
3d1b1a9423 closes #5706 2017-05-26 23:21:46 -04:00
Barış Soner Uşaklı
8920523e06 more tests 2017-05-13 21:45:54 -04:00
Julian Lam
71137dbf43 pass reputation to flag reporter payload as well 2017-05-10 11:21:30 -04:00
Barış Soner Uşaklı
5a9b7b673a closes #5659 2017-05-09 14:16:21 -04:00
Barış Soner Uşaklı
5c005bbbdf use bind 2017-04-05 15:18:27 -04:00
Barış Soner Uşaklı
1b6d96dde7 on post flag increment zset 2017-04-05 14:59:50 -04:00
Julian Lam
f2653cd380 broader error handling for empty notif creation return 2017-03-23 14:35:29 -04:00