Opened 9 years ago

Last modified 3 years ago

#5010 new enhancement

Force users to join/pre-join groups?

Reported by: anonymous Owned by:
Priority: low Component: AnnouncerPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11


Is there a way to force users to automatically join or pre-add them into a group?

I'm trying to set up a local trac but having to log in and out of each account to subscribe to the appropriate groups is annoying.

Attachments (0)

Change History (8)

comment:1 Changed 9 years ago by anonymous

Type: defecttask

comment:2 Changed 9 years ago by anonymous

There is currently no functionality for this. You could write a python script, or make an admin panel to list users and add them to groups. None of the following code is tested. The python for insertion would be:

insert into session_attribute (sid, authenticated, name, value) values('$user', 1, 'announcer_joinable_group_@$group', 1);

If the row already exists, then it needs to be updated instead:

update session_attribute set value = 1 where name = 'announcer_joinable_group_@$group' and sid = '$user';

It can be done with the session in trac(much easier):

from trac.env import Environment
from trac.web.session import DetachedSession

env = Environment('$path2env')
for user in ('user1', 'user2', 'user3'):
  sess = DetachedSession(env, user)
  sess['announcer_joinable_group_@$group'] = 1

If you do this within a plugin, you won't need to create the env. I will accept an admin panel for this functionality.

comment:3 Changed 9 years ago by anonymous

I wish there was edit :( The first two examples are obviously sql and not python.

comment:4 Changed 9 years ago by anonymous

Thanks. The SQL works.

I wish I could add an admin panel but I'm seriously not up to the task (although I'll probably try, fail and hide in shame).

comment:5 Changed 8 years ago by Ryan J Ollos

This is similar to an enhancement request I posted in #5572, assuming you want to specify defaults that would apply to all users at the time their accounts are created.

comment:6 Changed 8 years ago by Ryan J Ollos

Type: taskenhancement

comment:7 Changed 7 years ago by Robert Corsaro

Priority: normallow
Severity: normalminor

comment:8 Changed 3 years ago by Ryan J Ollos

Owner: Robert Corsaro deleted

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.