Hi All,

Is there any way to add "I agree terms and conditions." check box at each login ?
Anybody worked for this system ?

Thanks,
Monalisa

Comments

jn2’s picture

Status: Active » Closed (fixed)

You need a contrib module. I know of two:
http://drupal.org/project/terms_of_use
http://drupal.org/project/legal

This is the Drupal core issue queue. (Not really the right place for your question.) A better place to look for help would be the support forums, or just search drupal.org for a module that does what you need.

monalisab’s picture

Thanks for the reply.

I had tried with these modules. But its creating check-box for user registration form. Not for login form/login block... :(

jn2’s picture

You could post your question in the issue queue for one of those modules, or post it here:
http://drupal.org/forum/22

monalisab’s picture

Thanks.
My requirement is solved. I have done it by creating a new module.

zdean’s picture

could you share your module...I've been looking for this solution too.

umeshpatil’s picture

Issue summary: View changes

I know the issue is way older, so you guys have already figured out the solution. But for those who need it follow below for the Drupal 7 version,

Please install Legal module and then create your custom module and put below code in it

/**
 * Implements hook_form_FORM_ID_alter().
 * 
 */
 
function MY_MODULE_form_user_login_alter(&$form, &$form_state, $form_id) {
  global $user;
  global $language;
  
  $conditions = legal_get_conditions($language->language);

  // Do nothing if there's no Terms and Conditions text set.
  if (empty($conditions['conditions'])) {
    return;
  }

  $form = array_merge($form, legal_display_fields($conditions));

  // Disable checkbox if:
  //  - user is already registered (administer users);
  //  - users with 'administer users' can access registration on admin/user/user/create.
  if (!empty($user->uid)) {
    $form['legal']['legal_accept']['#attributes'] = array('disabled' => 'disabled');
    $form['legal']['legal_accept']['#required']   = FALSE;

    if (is_array($conditions['extras'])) {
      foreach ($conditions['extras'] as $key => $label) {
        if (!empty($label)) {
          $form['legal'][$key]['#attributes'] = array('disabled' => 'disabled');
          $form['legal'][$key]['#required']   = FALSE;
        }
      }
    }
  }

  return theme('legal_display', array('form' => $form));
}

check out the login page and now whatever checkboxes you will add using Legal module's UI you could able to see them here in login form as well.

Enjoy :)

nayanalok’s picture

Install 'Legal' module and follow below steps

  • Enable legal module
  • Go to admin/config/people/legal/configuration
  • Check 'Ask to accept T&Cs on every login' checkbox and save

That is it...