Skip to content

Commit

Permalink
* Prevent user creation problems when password from zip is not long e…
Browse files Browse the repository at this point in the history
…nough.
  • Loading branch information
perusionmike committed Aug 4, 2006
1 parent 4e4b122 commit 7a238b4
Showing 1 changed file with 32 additions and 18 deletions.
50 changes: 32 additions & 18 deletions dist/standard/etc/log_transaction
Expand Up @@ -250,24 +250,38 @@ Set order number in session: [calc]
[userdb function=logout clear=0 clear_cart=0]
[/if]
[tmp auto_create]1[/tmp]
[if type=explicit compare=|
[userdb
function=new_account
assign_username=1
password='[value zip]'
verify='[value zip]'
]
|]
[seti mv_autocreate]
mv_username=[data session username]
mv_password=[value zip]
[/seti]
Auto-created user [seti auto_username][data session username][/seti][scratch auto_username].
[else]
Auto-create of user failed. Reason: [data session failure]
[perl] die errmsg("Auto-create of user failed. Reason: %s", $Session->{failure}) [/perl]
[/else]
[/if]
[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]
[/try]
[catch error-set="Customer record creation" error-scratch="mv_route_failed"]
There was an error adding you to the customer table.
Expand Down

0 comments on commit 7a238b4

Please sign in to comment.