[interchange] Prevent user creation problems for UI orders when password from zip is not long enough or non-existe
Jon Jensen <[email protected]>
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 9d8d4a8d983c7ad6cd8e9c1c540998b07e129def Author: Josh Lavin <[email protected]> Date: Thu Aug 5 17:26:26 2010 -0500 Prevent user creation problems for UI orders when password from zip is not long enough or non-existent. dist/standard/etc/log_transaction | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) --- diff --git a/dist/standard/etc/log_transaction b/dist/standard/etc/log_transaction index 0d3131a..d549d58 100644 --- a/dist/standard/etc/log_transaction +++ b/dist/standard/etc/log_transaction @@ -294,12 +294,26 @@ There was an error adding you to the customer table. [tmpn tmp_compare][/tmpn] [tmp tmp_username][data table=userdb col=username key="[value customer_id]"][/tmp] [if !scratch tmp_username] + [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] [tmp hide_status][userdb function=new_account no-login=1 assign-username=1 - password='[value zip]' - verify='[value zip]' + password='[scratch tmp_pass]' + verify='[scratch tmp_pass]' ][/tmp] [tmp tmp_username][data session auto_created_user][/tmp] [if scratch hide_status]