Gossamer Forum
Home : Products : Links 2.0 : Customization :

case sensitive unsubscribe

Quote Reply
case sensitive unsubscribe
Is there a way to make unsubscribe NOT case sensitive in subscribe.cgi. I find that when dummys use mixed case they can't remember how they entered it originally and complain that unsubscribe does not work and I have to spend my time unsubscribing them.

Thanks
---
Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: [willdeb] case sensitive unsubscribe In reply to
Its just a case of using the lc() function to lowercase both the email addresses that are searched through in email database, and the one that was submitted. Quite a simple process really. I'll have a look in search.cgi now to see if I can find out what you need to modify Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] case sensitive unsubscribe In reply to
search.cgi?
Quote Reply
Re: [Paul] case sensitive unsubscribe In reply to
My boo boo...I mean subscribe.cgi ;)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [willdeb] case sensitive unsubscribe In reply to
Ok, not gonna guarantee this will work, as it isn't tested, and I have never really done much with subscribe.cgi Wink

Ok, open up subscribe.cgi, and replace the unsubscribe sub routine with the following;

Code:
sub unsubscribe {
# -----------------------------------------------------------
# Removes a user from a mailing list.
#
my %in = @_;
my $in_list = $db_email_name;
my $list = lc($in_list);

# Check that the user is already subscribed.
my $in_email = $in{'email'};
my $email = lc($in_email); # lower case the in email...
my $name = $in{'name'};
my $users_r = &get_users ($list);
${$users_r}{$email} or &site_html_mailing_error ("The email address: $email is not subscribed to this list.") and return;

# Made it this far, so let's remove the user.
delete ${$users_r}{$email};

open (LIST, ">$list") or &cgierr ("Unable to open list: $list. Reason: $!");
if ($db_use_flock) { flock (LIST, 2) or &cgierr ("Unable to get exlusive lock! Reason: $!"); }
foreach (sort keys %{$users_r}) {
print LIST "$_$db_delim${$users_r}{$_}\n";
}
close LIST;

# Go to the success page.
&site_html_mailing ('unsubscribe');
}

Give it a go..but make sure you have a backup of the old script first Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] case sensitive unsubscribe In reply to
Nope, that didn't do it.

I subscribed Joe Blow|jOe@blOw.cOm. That worked.

I unsubscribed joe@blow.com.

Oops, there was a problem!

Error: The email address: joe@blow.com is not subscribed to this list.

I unsubscribed jOe@blOw.cOm.

Oops, there was a problem!

Error: The email address: joe@blow.com is not subscribed to this list.

Just in case I wasn't clear, I want to be able to unsubscribe using any case no mater what case was used originally. Clear as mud?
---
Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: [willdeb] case sensitive unsubscribe In reply to
Any body got any ideas on this?
---
Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/