I'v forum topic that containing adult content, I don't want to peaple under 18 can access it, how to do that?

FYI I already activated profile module and added date field.

Please help..

Comments

cog.rusty’s picture

The Drupal part is easy. Just install and use the forum access module (http://drupal.org/project/forum_access) to make some forums viewable only by some user role (you could call it "adult").

What remains is to figure out who is under 18 so that you won't assign them that user role.

erwinova’s picture

Thank you, you are right. I'v tried what your are suggestion, create new roles I call "adult user", activated forum access module, to know the member birthday I use birthdays module, but I assign them menualy ...how to do automaticly?

cog.rusty’s picture

The only thing I can think at the moment is the Auto Assign Role module (http://drupal.org/project/autoassignrole). It could be possible to hack it to work only if that age condition is true.

Or maybe something similar using the Actions module.

erwinova’s picture

Ok..I'll check it, but I don't know the code (php) at all

Drew Patrick’s picture

I have a similar problem (mine needs to also restrict over 18s from accessing forums for under 18s). I'm going to try doing the following:

1. Assign the following roles: major (for over 18) and minor (for under 18);

2. Use the forum access module to restrict access to forums based on the role assigned to a user;

that part should be fairly straight forward

3. Use the rules module to assign the following workflow when a user logs on: check age (I'm also using the birthday module, but you could do it with the date of birth from the user profile) - if over 18 then assign major (and remove minor), if under 18 then assign minor (and remove major).

The only "difficult" part is the php code that returns the age value for consideration (only cause I don't have much exposure to php). I'll need to get some help with the php code from guys using the rules module, and will post the code here once it's done.

Drew Patrick’s picture

I've posted the php code at the following link. Hope it help.

http://groups.drupal.org/node/23564