In order to comply with COPPA, I would like to ask users for their birthdate when they register for an account, and not display a year for their birthdate that is less than 13 years.

I could simply edit the years displayed on January 1 of each year, but I am a firm believer in automation. In a perfect world, I would like to add a select box which is php generated. Is it possible?

Comments

cmsproducer’s picture

You can access the profile field in your template by calling it as $profile_group_age (depending on what you called that field and underw hich group of profile fields you have it), and then create PHP logic to switch the display template on the fly if the age is less than 13 to use a node.tpl.php or page.tpl.php template that does not display the age.

Let me know if you need more insight/details on how to implement this.

-----
iDonny - Web Content Management System Design, Development. & CRM

leemchildress’s picture

As a community portal, COPPA doesn't want children under the age of 13 to even register for the site. Accordingly, during the registration process, I really need to restrict the birth years so that only (($current_year - 13) to ($current_year - 100) show in the drop down box. Guess I really want a way to do a dynamic drop down box in the registration process.

However, I appreciate the insight you offered iDonny, and will keep that in the back of my head as a fall-back.

I may have to hack Drupal to do this one.

sepeck’s picture

There is a built in mechanism to leverage the api.
I direct your attention to the Login Toggan module as one posible starting point of building a module that does not invelve hacking core and the Legal module.

The Legal module is not updated for 4.7 currently, but if you look in the issue's queue you will find someone has worked on a patch to bring it up to date. I would suggest you look at how the Legal T&C acceptance part works and add your code for the birthdate as a requirement/condition or something.

Better maintainability through non-core hacked modules. :)

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

cmsproducer’s picture

I think that I missed your point previously. I thought that you just wanted to hide the age information as opposed to refusing to register under-age users ...
-----
iDonny - Web Content Management System Design, Development. & CRM