: 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
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.
More posts by @Samaraweera270
2 Comments
Sorted by latest first Latest Oldest Best
@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
);
}
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.