Explorar o código

updated loggintobogan

Bachir Soussi Chiadmi %!s(int64=9) %!d(string=hai) anos
pai
achega
c9f8dc21ed

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 105 - 0
sites/all/modules/contrib/users/logintoboggan/CHANGELOG.txt


+ 3 - 3
sites/all/modules/contrib/users/logintoboggan/contrib/logintoboggan_content_access_integration/logintoboggan_content_access_integration.info

@@ -6,9 +6,9 @@ core = "7.x"
 dependencies[] = logintoboggan
 dependencies[] = content_access
 
-; Information added by Drupal.org packaging script on 2014-07-08
-version = "7.x-1.4"
+; Information added by Drupal.org packaging script on 2015-05-01
+version = "7.x-1.5"
 core = "7.x"
 project = "logintoboggan"
-datestamp = "1404818634"
+datestamp = "1430501885"
 

+ 3 - 3
sites/all/modules/contrib/users/logintoboggan/contrib/logintoboggan_rules/logintoboggan_rules.info

@@ -6,9 +6,9 @@ core = "7.x"
 dependencies[] = logintoboggan
 dependencies[] = rules
 
-; Information added by Drupal.org packaging script on 2014-07-08
-version = "7.x-1.4"
+; Information added by Drupal.org packaging script on 2015-05-01
+version = "7.x-1.5"
 core = "7.x"
 project = "logintoboggan"
-datestamp = "1404818634"
+datestamp = "1430501885"
 

+ 3 - 3
sites/all/modules/contrib/users/logintoboggan/contrib/logintoboggan_variable/logintoboggan_variable.info

@@ -5,9 +5,9 @@ core = "7.x"
 dependencies[] = logintoboggan
 dependencies[] = variable
 
-; Information added by Drupal.org packaging script on 2014-07-08
-version = "7.x-1.4"
+; Information added by Drupal.org packaging script on 2015-05-01
+version = "7.x-1.5"
 core = "7.x"
 project = "logintoboggan"
-datestamp = "1404818634"
+datestamp = "1430501885"
 

+ 3 - 3
sites/all/modules/contrib/users/logintoboggan/logintoboggan.info

@@ -7,9 +7,9 @@ configure = admin/config/system/logintoboggan
 stylesheets[all][] = logintoboggan.css
 
 
-; Information added by Drupal.org packaging script on 2014-07-08
-version = "7.x-1.4"
+; Information added by Drupal.org packaging script on 2015-05-01
+version = "7.x-1.5"
 core = "7.x"
 project = "logintoboggan"
-datestamp = "1404818634"
+datestamp = "1430501885"
 

+ 1 - 1
sites/all/modules/contrib/users/logintoboggan/logintoboggan.install

@@ -34,7 +34,7 @@ function logintoboggan_update_7000(&$sandbox) {
     ),
   );
 
-  update_fix_d7_block_deltas($sandbox, $renamed_deltas);
+  update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
 }
 
 /**

+ 13 - 10
sites/all/modules/contrib/users/logintoboggan/logintoboggan.module

@@ -447,9 +447,8 @@ function logintoboggan_user_register_submit($form, &$form_state) {
   $pre_auth = logintoboggan_validating_id() != DRUPAL_AUTHENTICATED_RID;
 
   // If we are allowing user selected passwords then skip the auto-generate function
-  // The new user's status should default to the site settings, unless reg_passwd_set == 1
-  // (immediate login, we are going to assign a pre-auth role), and we want to allow
-  // admin approval accounts access to the site.
+  // The new user's status will be 1 (visitors can create own accounts) if reg_pass_set == 1
+  // Immediate login, we are going to assign a pre-auth role, until email validation completed
   if ($reg_pass_set) {
     $pass = $form_state['values']['pass'];
     $status = 1;
@@ -505,7 +504,7 @@ function logintoboggan_user_register_submit($form, &$form_state) {
   //   3. Visitors can create their own accounts.
   $message = t('Further instructions have been sent to your e-mail address.');
   if($reg_pass_set && $pre_auth && variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) == USER_REGISTER_VISITORS) {
-    $message = t('A validation e-mail has been sent to your e-mail address. In order to gain full access to the site, you will need to follow the instructions in that message.');
+    $message = t('A validation e-mail has been sent to your e-mail address. You will need to follow the instructions in that message in order to gain full access to the site.');
   }
 
   if (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) == USER_REGISTER_VISITORS) {
@@ -560,9 +559,15 @@ function logintoboggan_user_login_validate($form, &$form_state) {
  * @ingroup logintoboggan_form
  */
 function logintoboggan_user_register_validate($form, &$form_state) {
+  //Check to see whether our username matches any email address currently in the system.
+  if($mail = db_query("SELECT mail FROM {users} WHERE LOWER(:name) = LOWER(mail)", array(
+  ':name' => $form_state['values']['name'],
+  ))->fetchField()) {
+    form_set_error('name', t('This e-mail has already been taken by another user.'));
+  }
   //Check to see whether our e-mail address matches the confirm address if enabled.
   if (variable_get('logintoboggan_confirm_email_at_registration', 0) && isset($form_state['values']['conf_mail'])) {
-    if ($form_state['values']['mail'] != $form_state['values']['conf_mail']) {
+    if (trim($form_state['values']['mail']) != trim($form_state['values']['conf_mail'])) {
       form_set_error('conf_mail', t('Your e-mail address and confirmed e-mail address must match.'));
     }
   }
@@ -756,8 +761,6 @@ function logintoboggan_unified_login_page($active_form = 'login') {
     return menu_execute_active_handler(NULL, FALSE);
   }
   else {
-    // Title just clutters the interface...
-    drupal_set_title('');
     $output = logintoboggan_get_authentication_form($active_form);
     return $output;
   }
@@ -1051,11 +1054,11 @@ function logintoboggan_process_login($account, &$edit, $redirect = array()){
 
 function logintoboggan_eml_validate_url($account, $url_options){
   $timestamp = REQUEST_TIME;
-  return url("user/validate/$account->uid/$timestamp/". logintoboggan_eml_rehash($account->pass, $timestamp, $account->mail), $url_options);
+  return url("user/validate/$account->uid/$timestamp/". logintoboggan_eml_rehash($account->pass, $timestamp, $account->mail, $account->uid), $url_options);
 }
 
-function logintoboggan_eml_rehash($password, $timestamp, $mail) {
-  return user_pass_rehash($password, $timestamp, $mail);
+function logintoboggan_eml_rehash($password, $timestamp, $mail, $uid) {
+  return user_pass_rehash($password, $timestamp, $mail, $uid);
 }
 
 /**

+ 17 - 2
sites/all/modules/contrib/users/logintoboggan/logintoboggan.unifiedlogin.js

@@ -10,6 +10,14 @@ Drupal.behaviors.unifiedLogin = {
       $('.toboggan-unified #login-link').removeClass('lt-active');
       $('.toboggan-unified #register-form').show();
       $('.toboggan-unified #login-form').hide();
+      $.ajax({
+        url: "/user/register",
+        success: function(data) {
+          var title = data.match("<title>(.*?)</title>")[1];
+          $('html head').find('title').text(title);
+          $('h1.title').text(title.substring(0,title.indexOf('|')));
+        },
+      });
       return false;
     });
     $('.toboggan-unified #login-link').click(function() {
@@ -17,6 +25,14 @@ Drupal.behaviors.unifiedLogin = {
       $('.toboggan-unified #register-link').removeClass('lt-active');
       $('.toboggan-unified #login-form').show();
       $('.toboggan-unified #register-form').hide();
+      $.ajax({
+        url: "/user/login",
+        success: function(data) {
+          var title = data.match("<title>(.*?)</title>")[1];
+          $('html head').find('title').text(title);
+          $('h1.title').text(title.substring(0,title.indexOf('|')));
+        },
+      });
       return false;
     });
 
@@ -32,5 +48,4 @@ Drupal.behaviors.unifiedLogin = {
   }
 };
 
-})(jQuery);
-
+})(jQuery);

+ 1 - 1
sites/all/modules/contrib/users/logintoboggan/logintoboggan.validation.inc

@@ -22,7 +22,7 @@ function logintoboggan_validate_email($account, $timestamp, $hashed_pass, $actio
   // - the user is still in the pre-auth role or didn't set
   //   their own password.
   // - the hashed password is correct.
-  if (((variable_get('user_email_verification', TRUE) && empty($account->login)) || ($pre_auth && array_key_exists($validating_id, $account->roles))) && $hashed_pass == logintoboggan_eml_rehash($account->pass, $timestamp, $account->mail)) {
+  if (((variable_get('user_email_verification', TRUE) && empty($account->login)) || ($pre_auth && array_key_exists($validating_id, $account->roles))) && $hashed_pass == logintoboggan_eml_rehash($account->pass, $timestamp, $account->mail, $account->uid)) {
     watchdog('user', 'E-mail validation URL used for %name with timestamp @timestamp.', array('%name' => $account->name, '@timestamp' => $timestamp));
 
     _logintoboggan_process_validation($account);

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio