File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 8888// --forums
8989// delete accounts that
9090// - have no hosts
91- // - have message-board posts
92- // - don't belong to a team (to avoid deleting BOINC-wide team owners)
93- // Use this for spammers who create accounts and post spam
91+ // - have message-board posts containing links or URLs
92+ // - don't belong to a team (avoid deleting BOINC-wide team owners)
93+ // Use this for spammers who create accounts and post spam.
94+ // Don't use this for non-computing projects (like BOINC message boards).
95+ // In fact, don't use this in general:
96+ // it will delete users who join to participate in forums.
9497//
9598// --profiles_strict
9699// delete accounts that have a profile and no message-board posts.
@@ -177,8 +180,17 @@ function has_link($x) {
177180 return false ;
178181}
179182
183+ // delete users with
184+ // - no hosts
185+ // - no team
186+ // - posts contain links and/or URLs
187+ //
180188function delete_forums () {
181189 global $ min_days , $ max_days ;
190+
191+ // if they've posted, they'll have forum prefs.
192+ // This is faster than enumerating all users
193+ //
182194 $ prefs = BoincForumPrefs::enum ("posts>0 " );
183195 $ n = 0 ;
184196 foreach ($ prefs as $ p ) {
@@ -198,6 +210,9 @@ function delete_forums() {
198210 }
199211 $ h = BoincHost::count ("userid= $ p ->userid " );
200212 if ($ h ) continue ;
213+
214+ $ n = BoincPost::count ("user= $ user ->id and (content like '%<a %' or content like '%[url%' or content like '%http://%' or content like '%https://%') " );
215+ if (!$ n ) continue ;
201216 do_delete_user ($ user );
202217 $ n ++;
203218 }
You can’t perform that action at this time.
0 commit comments