Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Drupal module to require checkbox at login For Drupal 6.x is there a module that makes it a requirement that the user check a check box before logging in? The site needs to require every

@Samaraweera270

Posted in: #Drupal6

For Drupal 6.x is there a module that makes it a requirement that the user check a check box before logging in?

The site needs to require every user to accept the Terms and Conditions at each login, not just at registration.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

@marcvangend thank you for the info and links, here is the code I found/edited/came up with:

function toscheckbox_form_user_login_alter(&$form, &$form_state) {
// Add a checkbox to login form about agreeing to terms of service.
$form['terms_of_service'] = array(
'#type' => 'checkbox',
'#title' => "I agree with the website's terms of service.",
'#required' => TRUE
);
}

function toscheckbox_form_user_login_block_alter(&$form, &$form_state) {
// Add a checkbox to login form about agreeing to terms of service.
$form['terms_of_service'] = array(
'#type' => 'checkbox',
'#title' => "I agree with the website's terms of service.",
'#required' => TRUE
);
}

10% popularity Vote Up Vote Down


 

@Twilah146

There are two modules, drupal.org/project/legal and drupal.org/project/terms_of_use, that require you to accept on registration (I guess you found those already).

What you need (accept on every login) is not a feature of those modules, as far as I know. However I think that is should not be too hard to write a custom module, re-using some of the code of one of those modules, that adds this checkbox to every login form.

If you have not written modules before, check out the module developer's guide on drupal.org. You will have to use hook_form_alter to add a checkbox to the login form.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme