Commit 371ed7bb authored by Olle Haerstedt's avatar Olle Haerstedt

Dev: Restore old 2.06 password hash method

parent 9ae8fc87
......@@ -627,12 +627,7 @@ class InstallerController extends CController {
$this->loadHelper('surveytranslator');
$aData['model'] = $model = new InstallerConfigForm('optional');
// Backup the default, needed only for $sDefaultAdminPassword
//$sDefaultAdminUserName = $model->adminLoginName;
//$sDefaultAdminPassword = $model->adminLoginPwd;
//$sDefaultAdminRealName = $model->adminName;
//$sDefaultSiteName = $model->siteName;
//$sDefaultSiteLanguage = $model->surveylang;
//$sDefaultAdminEmail = $model->adminEmail;
$sDefaultAdminPassword = $model->adminLoginPwd;
if (!is_null(Yii::app()->request->getPost('InstallerConfigForm'))) {
$model->attributes = Yii::app()->request->getPost('InstallerConfigForm');
......
......@@ -301,7 +301,9 @@ class User extends LSActiveRecord
*/
public function setPassword($sPassword, $save = false)
{
$this->password = password_hash($sPassword, PASSWORD_DEFAULT);
// NB: Different method in 2.06 vs 2.73/3.0.
$sPasswordHash = hash('sha256', $sPassword);
$this->password = $sPasswordHash;
if ($save) {
$this->save();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment