[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Update on Cory's Coupons
This is what I added to UserDB.pm to delete an account:
it might be of assistance:
---snip---
sub delete_username {
my $self;
$self = shift
if ref $_[0];
my(%options) = @_;
eval {
unless($self) {
$self = new Vend::UserDB %options;
}
die "Bad object.\n" unless defined $self;
my $pass = $self->{DB}->delete_record(
$self->{USERNAME}
);
die "Database access error.\n" unless defined $pass;
$self->log('delete username') if $options{'log'};
};
if($@) {
if(defined $self) {
$self->{ERROR} = $@;
$self->log('delete username failed') if $options{'log'};
}
else {
logError( errmsg('UserDB.pm:3', "Vend::UserDB error: %s", $@ ) );
}
return undef;
}
---snip---
Add to sub userdb:
---snip---
elsif($function eq 'delete_username') {
$user = new Vend::UserDB %options;
unless (defined $user) {
$Vend::Session->{failure} = "Unable to access user database.";
return undef;
}
if($status = $user->delete_username(%options)) {
}
}
1;
}
---snip---
->All credit goes to Bill Rothenbauer, who wrote this (thanks!)
-Gideon
> ****** message to minivend-users from ".cory.trese."
<digital@arcane.specialty-books.com> ******
>
>
> >
> > Try something similar to this:
> >
> > [if data student::code::[value student_id]]
> > You have a listing in my student.asc which I defined in my catalog.cfg
> > that matches the value you entered into the student id field.
> > [else]
> > You've been expelled or you're too dumb to enter your id correctly.
> > [/else]
> > [/if]
>
> Thanks for the code idea. That works great.
>
>
> >
> > >2) how to remove a record from a database using minivend.
> >
> > I've seen this recently in the maillist... I don't know off hand.
>
> I did check the archives before harassing the list, but the only
references to
> deleting records from a database had no workable responses : The questions
went
> unresolved. I asked again because I thought that between then and now
someone
> had written a patch to fix the delete mv_data_function or someone had
figured
> out the correct syntax for using it.
>
> >
> >
> > >
> > >Thank you so very much for reading this,
> > >========================================
> > >Cory Trese
> > >email : digital@specialty-books.com
> > >phone : (740) 594 - 2274, ext 223
> > >phax : (740) 593 - 3045
> > >========================================
> > >Mail Sent from
> > >
> > >Specialty Books,
> > >Athens Ohio, 45701
> > >www.specialty-books.com
> > >
> > >RedHat Linux, Hedwig
> > >P][ / 2.3.5
> > >========================================
> > >-
> > >To unsubscribe from the list, DO NOT REPLY to this message. Instead,
send
> > >email with 'UNSUBSCRIBE minivend-users' in the body to
> > Majordomo@minivend.com.
> > >Archive of past messages:
http://www.minivend.com/minivend/minivend-list
> > >
> >
> > Ryan Hertz tel
520-645-3812
> > Webmaster tel
800-645-BAIT
> > Advertising Director fax
520-645-2588
> > Gary Yamamoto Custom Baits, Inc.
http://www.yamamoto.baits.com
> > -
> > To unsubscribe from the list, DO NOT REPLY to this message. Instead,
send
> > email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
> > Archive of past messages: http://www.minivend.com/minivend/minivend-list
> --
> ========================================
> Cory Trese
> email : digital@specialty-books.com
> phone : (740) 594 - 2274, ext 223
> phax : (740) 593 - 3045
> ========================================
> Mail Sent from
>
> Specialty Books,
> Athens Ohio, 45701
> www.specialty-books.com
>
> RedHat Linux, Hedwig
> P][ / 2.3.5
> ========================================
> -
> To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
>