Commit Graph

37 Commits

Author SHA1 Message Date
Osama Sayegh
3baf6233aa
FIX: Remove anonymous users from users directory (#28892)
Anonymous users are "shadow" users created when an existing real user desires to post anonymously. This feature is off by default, but it can be enabled via the `allow_anonymous_posting` site setting. Those shadow users shouldn't be included in the users directory (`/u`).
2024-09-13 15:12:57 +03:00
Osama Sayegh
5eea7244c7
FIX: Add users to user directory on account activation (#28505)
Follow-up to e3ae57ea7a

The previous commit added an `after_create` callback that triggers a refresh for the user directory whenever a `User` record is created. Theoretically, this approach should work, however, there's a gotcha in practice, because during a real user registration, when the `User` record is created in the database, it's not marked as active until the user verifies their email address and the user directory excludes inactive users, so the initial directory refresh triggered by the `after_create` callback becomes pointless.

To make a new user appear in the user directory immediately after sign up, we need to trigger a refresh via an `after_save` callback when they verify their email address and become active.
2024-08-26 18:01:24 +03:00
David Taylor
5a003715d3
DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
Mark VanLandingham
7fc3d7bdde
DEV: Plugin API to add directory columns (#13440) 2021-06-22 13:00:04 -05:00
Mark VanLandingham
95b51669ad
DEV: Revert 3 commits for plugin API to add directory columns (#13423) 2021-06-17 12:37:37 -05:00
Mark VanLandingham
6fd13f38a2
DEV: reset plugin added directory columns in testing (#13420) 2021-06-17 11:50:47 -05:00
Mark VanLandingham
0c42a29dc4
DEV: Plugin API to allow creation of directory columns with item query (#13402)
The first thing we needed here was an enum rather than a boolean to determine how a directory_column was created. Now we have `automatic`, `user_field` and `plugin` directory columns.

This plugin API is assuming that the plugin has added a migration to a column to the `directory_items` table.

This was created to be initially used by discourse-solved. PR with API usage - https://github.com/discourse/discourse-solved/pull/137/
2021-06-17 09:06:18 -05:00
Robin Ward
db35baba26 FEATURE: Display "Last Updated At" on user directory 2020-03-30 14:34:48 -04:00
Neil Lalonde
7331e0865a FIX: user directory should not include unapproved users
When the "must approve users" setting is enabled, new users who were
waiting to be approved could show up in the user directory.
2019-09-11 15:18:17 -04:00
Maja Komel
012da86a07 FIX user directory time period count (#6586) 2018-11-12 15:30:05 +01:00
Sam
5f64fd0a21 DEV: remove exec_sql and replace with mini_sql
Introduce new patterns for direct sql that are safe and fast.

MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API

- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder

See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
Sam
1abc276451 FIX: properly omit inactive and silenced users from directory 2017-12-19 12:53:59 +11:00
Sam
7e841a0495 FIX: stop counting PMs, deleted topics and whispers in directory and user stats 2017-11-20 16:44:09 +11:00
Robin Ward
971e302ff2 FEATURE: Support an end date for user silencing 2017-11-14 13:20:19 -05:00
Robin Ward
1f14350220 Rename "Blocked" to "Silenced" 2017-11-10 14:10:27 -05:00
Neil Lalonde
ec3d800492 add option to force DirectoryItem.refresh_period! to run even if user directory is disabled 2017-11-10 12:30:22 -05:00
Neil Lalonde
ca1609c821 FIX: user directory didn't update stats of users with no recent activity 2017-08-09 15:57:42 -04:00
Guo Xiang Tan
5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Arpit Jalan
e03c1e4cdf annotate models 2016-10-31 15:02:11 +05:30
Sam
236d8193bd annotate models 2016-03-28 15:21:45 +11:00
Sam
fe684fdfb8 FIX: incorrect stat for topics_entered in user directory 2016-03-10 07:44:16 +11:00
Sam Saffron
c15c483931 PERF: stop rebuilding full directory item table on refresh 2016-03-02 18:23:29 +11:00
Sam
d0ee32f3ce FIX: correct counts on user summary 2016-01-24 16:39:01 +11:00
Guo Xiang Tan
b6eb8f7793 FIX: Wrong period for quarterly reports. 2015-12-07 21:04:34 +08:00
Sam
c1ecd6f4ce update annotations 2015-09-18 10:41:10 +10:00
Robin Ward
2d4729782e FIX: Support quarterly on user directory 2015-08-17 13:58:40 -04:00
Robin Ward
bb93a345eb UX: Use smaller messages for moderator actions. 2015-07-27 10:09:21 -04:00
Robin Ward
a7e6148d40 FIX: Some low activity users were being restricted from the directory. 2015-05-11 11:24:34 -04:00
Robin Ward
6ae58d41a7 PERF: Only refresh the Daily stats hourly, do the others daily. 2015-04-20 12:11:36 -04:00
Tan Le
9fbc763902 Replace Hash#keys.each with Hash#each_key for some perf boost 2015-04-18 21:53:53 +10:00
Robin Ward
2cc5858163 Add site setting to disable User Directory, include restricted info 2015-03-26 11:26:19 -04:00
Robin Ward
1e3e4135a3 Add Posts Read + Visits to User Directory 2015-03-24 15:31:54 -04:00
Robin Ward
3c0fee1786 Fixes broken spec 2015-03-20 13:24:03 -04:00
Robin Ward
605fe4b11d Don't count moderator actions in the user directory stats 2015-03-20 12:14:14 -04:00
Robin Ward
9f22be2865 Restrict User Directory results more based on privacy 2015-03-20 11:42:39 -04:00
Robin Ward
7ef306cd3b A bunch of tweaks to the Users directory
- Move user directory from `/directory` to `/users/`
- Defaults to 'weekly' time period
- Don't include deleted topics/posts in the results
- Move heart icon to header instead of on each row
- "Users" instead of "Users found"
2015-03-19 12:29:38 -04:00
Robin Ward
3d2d224312 FEATURE: User Directory, with sorting and time period filter 2015-03-18 15:20:34 -04:00