MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Userdb without Login???



Quoting Loy Ellen Gross (design@iinc.com):
> 
> I want to achieve the following effect:
> 
> Any user can create a new account for him/herself and save a 
> single cart to that account. So far, so good.
> 
> Now, I want anyone who wants to be able to view that cart to do
> so without logging in (without needed the password). I'm not 
> allowing the original user to save personal or credit card info,
> so security isn't an issue.
> 
> The purpose is to creat a "Wish List" of items I want for 
> Christmas. With my password, I can go in and change the list.
> With just my username, my family and friends can go in and look
> at the list.
> 
> It's the look-up part I'm having trouble with. Am I on the right
> track? Can this be done?
> 

With the power of Perl....

UserTag wish-list Order username
UserTag wish-list Routine <<EOR
sub {
	my($username) = @_;
	my $cart_string;
	package Vend::Interpolate;
	return 'No wish list'
		unless $cart_string = tag_data('userdb', 'carts', $username);
	my $safe = new Safe;
	my $ref = $safe->reval($cart_string);
	return "Bad cart save." if $@;
	return "Bad cart save." unless ref $ref;
	my $list = $ref->{wish_list};
	my $item;
	my $out = '';
	foreach $item (@$list) {
		$out .= "Code: $item->{code}<BR>";
		$out .= "Item: ";
		$out .= tag_data('products','description', $item->{code});
		$out .= "<P>";
	}
	return 'Nothing in wish list.' unless $out;
	return $out;
}
EOR

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
If you think nobody cares if        131 Willow Lane, Floor 2  | ||  _ \
you're alive, try missing a couple  Oxford, OH  45056         | || |_) |
of car payments.                    <mikeh@minivend.com>     |___|  _ <
 -- Earl Wilson                     513.523.7621 FAX 7501        |_| \_\


Search for: Match: Format: Sort by: