user_register 和密码字段的 drupal_execute 问题

发布于 2024-10-08 15:37:49 字数 602 浏览 0 评论 0原文

我目前正在使用 Drupal 函数 drupal_execute 来注册用户,但是密码值似乎只记录保存在数据库中的第一个字符。

$form_state = array();
$form_state['values'] = array(
    'name'          => strtolower(preg_replace("'\W'", "", $person->firstName) . $person->entityId),
    'mail'          => $person->emailPrimary,
    'pass'          => user_password(),
    'status'        => 1,
    'roles'         => $roles,
    'notify'        => 1,
);
drupal_execute('user_register', $form_state, NULL);

打印出 form_state 数组表明密码设置正确,长度为 10 个字符。

任何人都可以阐明为什么只有传递值的第一个字符被保存到数据库中?

谢谢。 G

I am currently using the Drupal function drupal_execute to register users, however the password value seems to only record the first chracter when it saves in the DB.

$form_state = array();
$form_state['values'] = array(
    'name'          => strtolower(preg_replace("'\W'", "", $person->firstName) . $person->entityId),
    'mail'          => $person->emailPrimary,
    'pass'          => user_password(),
    'status'        => 1,
    'roles'         => $roles,
    'notify'        => 1,
);
drupal_execute('user_register', $form_state, NULL);

Printing out the form_state array reveals that the password is being set correctly, being 10 characters long.

Can anyone shed light as why only the first character of the pass value is saved to the db?

Thanks.
G

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

八巷 2024-10-15 15:37:49

请检查数据库字段的密码

Please check databse field for password

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文