I know this sounds kind of stupid for this module, but I want to be able to hide the Remember Me checkbox. I like its ability to automatically log the user off after the browser is closed, but I don't want a remember me checkbox there that from their perspective has no purpose (I set the remember me time to 30 seconds). Any ideas?

Comments

warriors2832org’s picture

Title: Hide Remenber Me checkbox? » Hide Remember Me checkbox?
warriors2832org’s picture

Really? Nobody? Is there any way to do it in CSS, PHP, HTML, ...?

doq’s picture

Add sth like

/**
 * Implementation of hook_form_alter().
 */
function YOUR_CUSTOM_MODULE_form_alter(&$form, $form_state, $form_id) {
  $user_login_forms = array('user_login', 'user_login_block');

  if (in_array($form_id, $user_login_forms)) {
    $form['remember_me']['#access'] = FALSE;
  }
}

to your custom module. This won't render the "Remember me" checkbox and default value should be used when processing the form.

warriors2832org’s picture

Where is this added, and what does sth mean?

doq’s picture

Create a new Drupal module and add provided code into it.
This part of code will extend remember_me module functionality by what you've requested.
Or maybe you want this to be added into remember_me module core but of course this should be configurable.

warriors2832org’s picture

Is there a way I could add this directly to the current Remember Me module? I am not to good with creating my own modules yet.

nickl’s picture

Assigned: Unassigned » nickl

The form alter suggestion will work, you could also hide it with css. I think this is a fair request and will be considered.

nickl’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
Status: Active » Fixed

Added a setting on admin/settings/remember_me to configure the checkbox visibility.
If the field is not visible then the default state configured won't be changeable by users.

nickl’s picture

Version: 6.x-2.x-dev » 6.x-2.2

Available in new release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.