Multiple "Newly registered users" groups with different permissions and post counts

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
Post Reply
dingus33
Registered User
Posts: 68
Joined: Fri Sep 29, 2017 11:11 am

Multiple "Newly registered users" groups with different permissions and post counts

Post by dingus33 » Fri Jul 12, 2019 7:06 pm

i'm trying to find a solution to the following for new users:
  • "training wheels" (applicable for 0 < post count < 3): assign a set of restrictive permissions (including NEVER Can post without approval) to newly registered users, and remove those permissions after a few posts. i'm currently using the "Newly registered users" usergroup with the new_member_post_limit setting. this works great.
  • introduction (applicable for post count = 0): force new users' first post only to be in an intro/welcome forum.
to accomplish this, i don't see any way around two separate restrictive usergroups. one for the training wheels, one for the intro post.

to force the first post to be in an intro forum, i first thought to use the Auto Groups extension. unfortunately, this extension is not suitable for automatically removing users from a group after they make their first post.

next, i thought to use the "Newly registered users" to control introduction posts (setting new_member_post_limit = 1) and Auto Groups extension to manage the restrictive new user / "training wheels" group (removing users after they make 3 posts i.e. autogroups_max_value = 2). basically switching them around to get around Auto Groups' limitation.

unfortunately, i think Auto Groups uses a 24h cron job to update usergroups, so new users will not be promptly restricted (or promptly graduated to normal user status after making a few posts).

so how can i reproduce the "Newly registered users" functionality for a second usergroup? something that assigns users to the group upon registration and then promptly removes them after they make the specified number of posts?

any chance of Auto Groups eventually adding the requested functionality? or is my only option to make a new extension myself?

to get them into the second group upon registration, would i hook to core.ucp_register_register_after, or is there a better event?

and then how do i promptly remove them? i thought about doing a cron job, but checking every few minutes seems wasteful. in phpBB, it seems it's done here:

https://github.com/phpbb/phpbb/blob/61b ... .php#L1646
/phpbb/session.php:

Code: Select all

if ($this->data['user_id'] != ANONYMOUS && isset($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])
{
	$this->leave_newly_registered();
}
it's in the session updater. when is that actually triggered though? whenever the user visits a page on the forum?

any guidance would be greatly appreciated. thank you.

if this topic is better suited to another forum, please move it.

User avatar
canonknipser
Registered User
Posts: 1995
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Multiple "Newly registered users" groups with different permissions and post counts

Post by canonknipser » Fri Jul 12, 2019 7:16 pm

You can use the auto groups extension to add users which reach a post count of 1 into a new group which opens them other fora, but still leave them in the newly registered group.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

dingus33
Registered User
Posts: 68
Joined: Fri Sep 29, 2017 11:11 am

Re: Multiple "Newly registered users" groups with different permissions and post counts

Post by dingus33 » Fri Jul 12, 2019 7:47 pm

canonknipser wrote:
Fri Jul 12, 2019 7:16 pm
You can use the auto groups extension to add users which reach a post count of 1 into a new group which opens them other fora, but still leave them in the newly registered group.
thank you for your suggestion. it's a good one because it gets around the issue of Auto Groups not being able to remove users with a post count of one (it can add them!).

the only other issue is the 24h thing. the lazy solution is just to edit that cron job in Auto Groups so it runs more frequently. what's the shortest amount of time that wouldn't result in excessive server load? guessing 5 minutes might not be so bad? wasteful yes, but probably ok?

User avatar
canonknipser
Registered User
Posts: 1995
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Multiple "Newly registered users" groups with different permissions and post counts

Post by canonknipser » Sat Jul 13, 2019 10:25 am

It depends on how busy our board is: every rule needs to be checked against every user - which means 5 rules and 1000 users will result in 5.000 operations.

Try with one hour and set a announcement in that intro forum telling your members to be patient - and eventually make your mods to group leaders of the training group so they can add members after they made a application to open a "back door" to enter the group
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

Post Reply

Return to “Extension Requests”