--- user.module.orig	2005-11-09 12:19:48.000000000 -0500
+++ user.module	2005-11-09 12:39:08.000000000 -0500
@@ -507,8 +507,12 @@
           $output .= form_submit(t('Log in'));
           $output .= "</div>\n";
 
-          $output  = form($output, 'post', url('user/login', drupal_get_destination()));
+          if (variable_get('user_ssl_login',0))  {
+            $output .= l(t('Secure Login Form'), 'user/login', array('id' => 'user_ssl_login'), 'secure_login', NULL, FALSE, FALSE, TRUE);
+          }
 
+          $output =  form($output, 'post', url('user/login', drupal_get_destination(), NULL, FALSE, isset($_GET[secure_login])));
+          
           if (variable_get('user_register', 1)) {
             $items[] = l(t('Create new account'), 'user/register', array('title' => t('Create a new user account.')));
           }
@@ -842,7 +846,11 @@
   $output .= form_password(t('Password'), 'pass', $pass, 30, 64, t('Enter the password that accompanies your username.'));
   $output .= form_submit(t('Log in'));
 
-  return form($output, 'post', url('user/login', drupal_get_destination()));
+  if (variable_get('user_ssl_login', 0) && !isset($_GET[secure_login])) {
+    $output .= l(t('Secure Login Form'), 'user/login', array('id' => 'user_ssl_login'), 'secure_login', NULL, FALSE, FALSE, TRUE);
+  }
+
+  return form($output, 'post', url('user/login', drupal_get_destination(), NULL, FALSE,isset($_GET[secure_login])));
 }
 
 function user_authenticate($name, $pass) {
@@ -1280,6 +1288,10 @@
   $group .= form_textarea(t('User registration guidelines'), 'user_registration_help', variable_get('user_registration_help', ''), 70, 4, t('This text is displayed at the top of the user registration form.  It\'s useful for helping or instructing your users.'));
   $output = form_group(t('User registration settings'), $group);
 
+  //Allow SSL login
+  $group = form_radios(t('SSL login'),'user_ssl_login', variable_get('user_ssl_login',0),array(t('Disabled'),t('Enabled')));
+  $output .= form_group(t('Login Options'), $group);
+
   // User e-mail settings.
   $group = form_textfield(t('Subject of welcome e-mail'), 'user_mail_welcome_subject', _user_mail_text('welcome_subject'), 70, 180, t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
   $group .= form_textarea(t('Body of welcome e-mail'), 'user_mail_welcome_body', _user_mail_text('welcome_body'), 70, 10, t('Customize the body of the welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
