mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Remove old way to store user preferences sytem-wide
This commit is contained in:
@@ -1213,7 +1213,10 @@ class users_admin_ui extends e_admin_ui
|
||||
if ($userMethods->needEmailPassword())
|
||||
{
|
||||
// Save separate password encryption for use with email address
|
||||
$user_data['user_prefs'] = serialize(array('email_password' => $userMethods->HashPassword($savePassword, $user_data['user_email'])));
|
||||
$user_prefs = e107::getArrayStorage()->unserialize($user_data['user_prefs']);
|
||||
$user_prefs['email_password'] = $userMethods->HashPassword($savePassword, $user_data['user_email']);
|
||||
$user_data['user_prefs'] = e107::getArrayStorage()->serialize($user_prefs);
|
||||
unset($user_prefs);
|
||||
}
|
||||
|
||||
$userMethods->userClassUpdate($allData['data'], 'userall');
|
||||
|
@@ -403,8 +403,9 @@ class userlogin
|
||||
|
||||
if ($this->lookEmail && varsettrue($pref['passwordEncoding']))
|
||||
{
|
||||
$tmp = unserialize($this->userData['user_prefs']);
|
||||
$requiredPassword = varset($tmp['email_password'],$this->userData['user_password']); // Use email-specific password if set. Otherwise, 'normal' one might work
|
||||
$tmp = e107::getArrayStorage()->unserialize($this->userData['user_prefs']);
|
||||
if(!$tmp && $this->userData['user_prefs']) $tmp = unserialize($this->userData['user_prefs']); // try old storage type
|
||||
$requiredPassword = varset($tmp['email_password'], $this->userData['user_password']); // Use email-specific password if set. Otherwise, 'normal' one might work
|
||||
unset($tmp);
|
||||
}
|
||||
else
|
||||
|
@@ -177,8 +177,9 @@ if (isset($_POST['GetOnWithIt']))
|
||||
$recordCount++;
|
||||
$newData = array();
|
||||
$newPrefs = '';
|
||||
$user_prefs = unserialize($row['user_prefs']);
|
||||
if ($saltConvert)
|
||||
$user_prefs = e107::getArrayStorage()->unserialize($row['user_prefs']);
|
||||
if(!$user_prefs && $row['user_prefs']) $user_prefs = unserialize($row['user_prefs']);
|
||||
if ($saltConvert)
|
||||
{
|
||||
if ($user_info->canConvert($row['user_password']))
|
||||
{
|
||||
@@ -204,7 +205,7 @@ if (isset($_POST['GetOnWithIt']))
|
||||
unset($user_prefs['email_password']);
|
||||
$emailProcess++;
|
||||
}
|
||||
if (count($user_prefs)) $newPrefs = serialize($user_prefs); else $newPrefs = '';
|
||||
if (count($user_prefs)) $newPrefs = e107::getArrayStorage()->serialize($user_prefs); else $newPrefs = '';
|
||||
if($newPrefs != $user_prefs)
|
||||
{
|
||||
$newData['user_prefs'] = $newPrefs;
|
||||
|
@@ -569,7 +569,8 @@ if (isset($_POST['register']) && $pref['user_reg'] == 1)
|
||||
|
||||
if (vartrue($pref['allowEmailLogin']))
|
||||
{ // Need to create separate password for email login
|
||||
$allData['data']['user_prefs'] = serialize(array('email_password' => $userMethods->HashPassword($savePassword, $allData['data']['user_email'])));
|
||||
//$allData['data']['user_prefs'] = serialize(array('email_password' => $userMethods->HashPassword($savePassword, $allData['data']['user_email'])));
|
||||
$allData['data']['user_prefs'] = e107::getArrayStorage()->serialize(array('email_password' => $userMethods->HashPassword($savePassword, $allData['data']['user_email'])));
|
||||
}
|
||||
|
||||
$allData['data']['user_join'] = time();
|
||||
|
@@ -558,9 +558,9 @@ if ($dataToSave)
|
||||
$changedUserData['user_password'] = $sql->escape($userMethods->HashPassword($savePassword, $loginname), false);
|
||||
if (varset($pref['allowEmailLogin'], FALSE))
|
||||
{
|
||||
$user_prefs = unserialize($udata['user_prefs']);
|
||||
$user_prefs = e107::getArrayStorage()->unserialize($udata['user_prefs']);
|
||||
$user_prefs['email_password'] = $userMethods->HashPassword($savePassword, $email);
|
||||
$changedUserData['user_prefs'] = serialize($user_prefs);
|
||||
$changedUserData['user_prefs'] = e107::getArrayStorage()->serialize($user_prefs);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user