Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 030e441

Browse files
author
Michael Grauer
committed
ENH: refs #952. Added fix for pendingusers created pre-upgrade.
1 parent 9937d2f commit 030e441

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

core/controllers/UserController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ public function settingsAction()
680680
throw new Zend_Exception('Changing password is disallowed for this user');
681681
}
682682
$oldPass = $this->_getParam('oldPassword');
683+
if($userDao->getSalt() == '')
684+
{
685+
$passwordHash = $this->User->convertLegacyPasswordHash($userDao, $oldPass);
686+
}
683687
$newPass = $this->_getParam('newPassword');
684688
$instanceSalt = Zend_Registry::get('configGlobal')->password->prefix;
685689
$hashedPasswordOld = hash($userDao->getHashAlg(), $instanceSalt.$userDao->getSalt().$oldPass);

core/database/upgrade/3.2.12.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ private function _movePasswords()
6565
}
6666
// Set the salt and hash alg to the appropriate value to denote a legacy user
6767
$this->db->update('user', array('hash_alg' => 'md5', 'salt' => ''));
68+
// Now the same for pending users
69+
$sql = $this->db->select()
70+
->from(array('pendinguser'), array('password'))
71+
->distinct();
72+
$rows = $this->db->fetchAll($sql);
73+
foreach($rows as $row)
74+
{
75+
$this->db->insert('password', array('hash' => $row['password']));
76+
}
77+
6878
}
6979
}
7080
?>

0 commit comments

Comments
 (0)