本文整理汇总了PHP中PFUser::getLegacyUserPw方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::getLegacyUserPw方法的具体用法?PHP PFUser::getLegacyUserPw怎么用?PHP PFUser::getLegacyUserPw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::getLegacyUserPw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateDb
/**
* Update db entry of 'user' table with values in object
* @param PFUser $user
*/
public function updateDb(PFUser $user)
{
if (!$user->isAnonymous()) {
$old_user = $this->getUserByIdWithoutCache($user->getId());
$userRow = $user->toRow();
if ($user->getPassword() != '') {
$password_handler = PasswordHandlerFactory::getPasswordHandler();
if (!$password_handler->verifyHashPassword($user->getPassword(), $user->getUserPw()) || $password_handler->isPasswordNeedRehash($user->getUserPw())) {
// Update password
$userRow['clear_password'] = $user->getPassword();
}
}
if ($user->getLegacyUserPw() !== '' && !ForgeConfig::get('sys_keep_md5_hashed_password')) {
$userRow['user_pw'] = '';
}
$result = $this->getDao()->updateByRow($userRow);
if ($result) {
if ($user->isSuspended() || $user->isDeleted()) {
$this->getDao()->deleteAllUserSessions($user->getId());
}
$this->_getEventManager()->processEvent(Event::USER_MANAGER_UPDATE_DB, array('old_user' => $old_user, 'new_user' => &$user));
}
return $result;
}
return false;
}
示例2: checkPasswordStorageConformity
private function checkPasswordStorageConformity(PFUser $user)
{
$hashed_password = $user->getUserPw();
$legacy_hashed_password = $user->getLegacyUserPw();
if ($this->isPasswordUpdatingNeeded($hashed_password) || $this->isLegacyPasswordRemovalNeeded($legacy_hashed_password)) {
$this->user_manager->updateDb($user);
}
}