user_save regenerates the session even when current user != edited user.

Heine - August 23, 2007 - 20:12
Project:Drupal
Version:6.x-dev
Component:user system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

After http://drupal.org/node/165358, we still regenerate the session when changing the password of another user. Granted, changing a password for another user doesn't occur that much.

AttachmentSize
sess_regen_current_user.patch925 bytes

#1

Heine - October 9, 2007 - 16:07
Status:active» needs review

#2

drumm - December 3, 2008 - 18:26
Version:5.x-dev» 7.x-dev
Status:needs review» reviewed & tested by the community

Still applies to 5.x and even 6.x, but needs to be committed to HEAD and backported. Attached is the 6.x version. It is a straightforward update and looks good, so marking RTBC.

AttachmentSize
user.module.patch 676 bytes
Testbed results
user.module.patchpassedPassed: 7659 passes, 0 fails, 0 exceptions a href=http://testing.drupal.org/pifr/file/1/user.module_91.patchDetailed results/a

#3

alexanderpas - December 15, 2008 - 02:11
Priority:normal» critical

this bug affects all tests that'll try so do something as the root user admin.
this (example) test gives WSOD due to this bug.

<?php
class UserRootAdminLoginTestCase extends DrupalWebTestCase {
  function
getInfo() {
    return array(
     
'name' => t('Login as root admin'),
     
'description' => t('Tries to login as root admin.'),
     
'group' => t('User')
    );
  }

 
/**
   * Try logging in as root administrator
   */
 
function testRootAdminLogin() {
   
// generate a password for the user
   
$password = user_password();
   
$root_admin = user_save(user_load(1), array('pass' => $password));

   
// Add the raw password so that we can log in as this user.
   
$root_admin->pass_raw = $password;

   
// login as the root administrator
   
$this->drupalLogin($root_admin);
  }
}
?>

#4

Dries - December 16, 2008 - 21:10
Version:7.x-dev» 6.x-dev

Committed to CVS HEAD. Updating version to Drupal 6.

#5

Darren Oh - December 24, 2008 - 03:46

The original patch works for Drupal 6, but I generated one from Drupal 6 because we really need this to make tests work.

AttachmentSize
user.module-169937-5_D6.patch 657 bytes

#6

Gábor Hojtsy - January 6, 2009 - 16:26
Status:reviewed & tested by the community» fixed

Looks good, committed to 6.x, thanks!

#7

System Message - January 20, 2009 - 16:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.