hi,

i created a small patch to have an option to alter #action value from login block form to use https in url.

please review.

regards

Comments

pebosi’s picture

StatusFileSize
new2.01 KB
pebosi’s picture

StatusFileSize
new2.03 KB

updated patch to use "securepages_baseurl()"

pebosi’s picture

Status: Active » Needs review
josepvalls’s picture

Doesn't work for me, the #action is always the old relative action.
I even tried my own module and same happened. What am I doing wrong? Something in the configuration? Is there something overwritting my action? I had login toboggan but it's disabled now.

function tests_form_alter(&$form, $form_state, $form_id) {
drupal_set_message('alter','info');
   if($form_id == 'user_login_block' || $form_id == 'user_login') {
    $form['#action'] = 'https://www.mydomain.com/mydirectory' . $form['#action'];
    drupal_set_message('alter login','info');
   }
}

I can see my messages when the form show up.

sillygwailo’s picture

Status: Needs review » Needs work
grendzy’s picture

Status: Needs work » Closed (works as designed)

IMHO, the best solution is to use http://drupal.org/project/securepages_prevent_hijack , which ensures passwords are sent over SSL. Securing the login form by itself has almost no value, because you're still vulnerable to session hijacking.

See also http://crackingdrupal.com/blog/greggles/drupal-and-ssl-multiple-recipes-...