[interchange-cvs] interchange - heins modified dist/standard/etc/log_transaction

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Aug 4 10:57:23 EDT 2006


User:      heins
Date:      2006-08-04 14:57:22 GMT
Modified:  dist/standard/etc log_transaction
Log:
* Prevent user creation problems when password from zip is not long enough.

Revision  Changes    Path
1.7       +32 -18    interchange/dist/standard/etc/log_transaction


rev 1.7, prev_rev 1.6
Index: log_transaction
===================================================================
RCS file: /var/cvs/interchange/dist/standard/etc/log_transaction,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- log_transaction	3 Feb 2006 22:40:57 -0000	1.6
+++ log_transaction	4 Aug 2006 14:57:22 -0000	1.7
@@ -250,24 +250,38 @@
 		[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.








More information about the interchange-cvs mailing list