Closed (fixed)
Project:
Drupal core
Version:
5.1
Component:
forms system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2007 at 06:22 UTC
Updated:
19 Sep 2009 at 13:23 UTC
Hi, if I call this code (extracted directly from help):
$values['name'] = 'robo-user';
$values['mail'] = 'robouser@example.com';
$values['pass'] = 'password';
drupal_execute('user_register', $values);
the user is created, but the real password is only the first character fo the original password. So the user has to log-in with username 'robo-user', password 'p'. It has to be some problem with forms I think, because I catched the password value in the user_register_submit() function in the user module, and the password is already trimmed there.
Can someone help please? I need to be able to create users automatically...
B.
Comments
Comment #1
SpatnyNick commentedHi, noone can help me?... Does someone of you use drupal_execute to create a user?
Comment #2
bs commenteddid you set user email verification to no? otherwise drupal will create new password and also you need to pass $form['notify'] = true to send an email to the user.
Comment #3
SpatnyNick commentedHi, thanks for the reply. Yes I disabled the mail verification... the password is everytime the firts letter of the password send to the form...
Comment #4
SpatnyNick commentedFinally I have found the problem I think. The calling function for user creation should look for example like this one:
So, you have to use:
not only the:
as it is presented in the api:
http://api.drupal.org/api/5/function/drupal_execute
it just doesn't work correctly.
I hope it will help someone.
Have a nice day!
Comment #5
willmoy commented