【发布时间】:2011-09-06 12:43:13
【问题描述】:
除了用户之外,我真的不需要将任何数据导入到我的 D7 构建中。我已经(通过 SQL)导入了我的用户数据,但是 D7 密码加密方法现在不同了。
无论如何我都不是专家,而且我从未使用过 Drush,但我遇到了这个 user_update_7000 代码 sn-p found user.install (http://api.drupal.org/api/drupal/modules--user--user.install/function/user_update_7000/7)
<?php
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
$old_hash = md5('password');
$hash_count_log2 = 11;
$new_hash = user_hash_password($old_hash, $hash_count_log2);
if ($new_hash) {
// Indicate an updated password.
$new_hash = 'U' . $new_hash;
}
?>
我可以在哪里运行此脚本来更新数据库中的密码字段?
谢谢,
史蒂夫
【问题讨论】:
标签: drupal import passwords md5