user_register 和密码字段的 drupal_execute 问题
我目前正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请检查数据库字段的密码
Please check databse field for password