Forum OpenACS Development: Re: Re: Create a new user

Collapse
3: Re: Re: Create a new user (response to 2)
Posted by Iuri Sampaio on
well, i just ran on the shell the followed tcl script:

******
set password [ad_generate_random_string]

db_transaction {
array set user_new_info [auth::create_user -username 'test-2006-06-26' -email 'mailto:iuri.sampaio@hotmail.com'; -first_names 'test-2006-06-26' -last_name 'test-2006-06-26' -password $password]
}
set user_id $user_new_info(user_id)
*********

it returns the user-id. So the script is runing fine, but when i run this chunk in a tcl page such as
inser-new-user.tcl
http://www.myybiz.net:8090/insert-new-user

i got the error message:
any idea??

Server Error
/ home / yabtdev / yabtdev / packages / dotlrn / www / dotlrn-master-kelp
There was a server error processing your request. We apologize.

Take me back where I was (before the error)
can't read "user_new_info(user_id)": no such element in array
while executing
"set user_id $user_new_info(user_id)"
("uplevel" body line 6)
invoked from within
"uplevel #$level $new_data"
("1" arm line 597)
invoked from within
"switch $errno {
0 {
# TCL_OK
}
1 {
# TCL_E..."
(procedure "ad_form" line 611)
invoked from within
"ad_form -name add_new_user_form -show_required_p 1 -form {
user_id:key
{
user_name:text(text)
{label "Username"}
{help..."
("uplevel" body line 9)
invoked from within
"uplevel {
ad_page_contract {
This is the form to insert contact information
@author Iuri Sampaio
} {
id:optional
}

ad_form -name add_new_..."
(procedure "code::tcl::/home/yabtdev/yabtdev/www/insert-new-user" line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {

if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare "
(procedure "template::adp_parse" line 30)
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 5)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info..."