[ic] auto-create failure (revisited)
Mike Heins
mike at perusion.com
Fri Aug 4 10:56:43 EDT 2006
Quoting Steve Graham (icdev at mrlock.com):
> Hello,
>
> Just had an International user try to place an order which used the
> autocreate userid and password, but it failed since the password was
> blank, ie no zip code.
>
> I was playing with the log_transaction program
>
> [seti mv_autocreate]
> mv_username=[data session username]
> mv_password=[value zip]
> [/seti]
>
> I would like to do something like the following:
>
> [seti mv_autocreate]
> mv_username=[data session username]
> mv_password=[calc][value zip][value
> mv_transaction_id][/calc]
> [/seti]
>
>
> [value mv_transaction_id] is ignored.
>
> Any suggestions?
I have fallen down on this one -- I should have put this
fix in the demo a long time ago...
[tmp auto_create]1[/tmp]
[calcn]
$Tag->tmp('tmp_pass');
for(qw/ zip phone_day phone_night /) {
my $pass = $Values->{$_};
$pass =~ s/\s+//g;
next if length($pass) < 4;
$Scratch->{tmp_pass} = $pass;
}
my @lets = ('A' .. 'Z', '0 .. 9', 'a' .. 'z');
$Scratch->{tmp_pass} .= $lets[ rand @lets ]
while length($Scratch->{tmp_pass}) < 5;
return;
[/calcn]
[if type=explicit compare=|
[userdb
function=new_account
assign_username=1
password='[scratch tmp_pass]'
verify='[scratch tmp_pass]'
]
|]
[seti mv_autocreate]
mv_username=[data session username]
mv_password=[scratch tmp_pass]
[/seti]
Auto-created user [seti auto_username][data session username][/seti][scratch auto_username].
[else]
Auto-create of user failed.
[perl] die errmsg("Auto-create of user failed."); [/perl]
[/else]
[/if]
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.765.647.1295 tollfree 800-949-1889 <mike at perusion.com>
Fast, reliable, cheap. Pick two and we'll talk. -- unknown
More information about the interchange-users
mailing list