Hi Paul. Just wondeirng if you've come up with a work-around on this one? I've been trying..it seems simple.. basically you'd just need to retreive the original password from the db file before you overwrite it, and compare it to the one that was passed from the modify; if they're the same you leave it, if they're not you reverse it...unfortunetly I'm not that great at Perl...so I'm not getting too far...
Feb 23, 2003, 3:42 AM
Novice (44 posts)
Feb 23, 2003, 3:42 AM
Post #32 of 41
Views: 14919
Hi Leonard,
Thanks for posting the mod. I have installed and all seems to be ok...Only problem is that when I enter the username and password, I get Invalid username or password. Record not found. Can't understand it, username and password exist in the database, and I entered them exactly the same way as they we saved...Any ideas where I can start looking to find where the problem may be?
The only thing that I think may be a problem is that I had allready added the username and password fields prior to installing the mod, would that make a differance?
Hamsterpants
Thanks for posting the mod. I have installed and all seems to be ok...Only problem is that when I enter the username and password, I get Invalid username or password. Record not found. Can't understand it, username and password exist in the database, and I entered them exactly the same way as they we saved...Any ideas where I can start looking to find where the problem may be?
The only thing that I think may be a problem is that I had allready added the username and password fields prior to installing the mod, would that make a differance?
Hamsterpants
Nov 19, 2003, 10:27 AM
Novice (41 posts)
Nov 19, 2003, 10:27 AM
Post #34 of 41
Views: 14756
I have just installed this mod. I had a few small issues. Both have been mentioned here in this thread, but no fix has been posted.
-----
ecm: "First, after making changes and clicking the modify resource, I got an error msg "Category (Can not be left blank)". Then I would get an error message "A request to modify this record has already been received. Please try again later.""
-----
I am currently having this issue, I realize its a matter of changing the script to create a drop down instead of just passing the value, gonna go look at this to see if I can figure it out in a moment.
-----
DanJ: "Once a user goes into the actual modify section, if they change their password it isn't reversed in the database and therefore if they use that password its denied"
-----
I had this issue and I fixed it by simply removing the reversing feature of the script. A submitted username/password is much stronger them what we had before and I just didnt see the need for the reverse password as I know it would have confused some of my users anyways.
Peace,
MadTech (Rick)
-----
ecm: "First, after making changes and clicking the modify resource, I got an error msg "Category (Can not be left blank)". Then I would get an error message "A request to modify this record has already been received. Please try again later.""
-----
I am currently having this issue, I realize its a matter of changing the script to create a drop down instead of just passing the value, gonna go look at this to see if I can figure it out in a moment.
-----
DanJ: "Once a user goes into the actual modify section, if they change their password it isn't reversed in the database and therefore if they use that password its denied"
-----
I had this issue and I fixed it by simply removing the reversing feature of the script. A submitted username/password is much stronger them what we had before and I just didnt see the need for the reverse password as I know it would have confused some of my users anyways.
Peace,
MadTech (Rick)
Nov 19, 2003, 11:29 AM
Novice (41 posts)
Nov 19, 2003, 11:29 AM
Post #35 of 41
Views: 14736
To fix the category issue, open site_html_templates.pl
make sure your site_html_modify_form sub looks similar to this...
sub site_html_modify_form {
# --------------------------------------------------------
# This routine determines how the modify form page will look like.
my (%record) = @_;
my $cat ?
($record{'Category'} = qq~<input type=hidden name="Category" value="$record{'Category'}">$record{'Category'}~) :
($record{'Category'} = &build_select_field ("Category"));
&html_print_headers;
print &load_template ('modify.html', {
Cat => $cat,
%record,
%globals
});
}
Hope that helps the few of us who still use Links 2.0
Only other issue I just noticed with this mod is that if you request a lost password and you have more then one resource with that e-mail address, it only sends you the user/pass for the first one it encounters.
Peace,
MadTech
make sure your site_html_modify_form sub looks similar to this...
Code:
sub site_html_modify_form {
# --------------------------------------------------------
# This routine determines how the modify form page will look like.
my (%record) = @_;
my $cat ?
($record{'Category'} = qq~<input type=hidden name="Category" value="$record{'Category'}">$record{'Category'}~) :
($record{'Category'} = &build_select_field ("Category"));
&html_print_headers;
print &load_template ('modify.html', {
Cat => $cat,
%record,
%globals
});
}
Hope that helps the few of us who still use Links 2.0
Only other issue I just noticed with this mod is that if you request a lost password and you have more then one resource with that e-mail address, it only sends you the user/pass for the first one it encounters.
Peace,
MadTech
Jun 4, 2004, 2:05 AM
Novice (41 posts)
Jun 4, 2004, 2:05 AM
Post #36 of 41
Views: 14677
I was just looking back through to see if anyone found a way to make the password retrieval work correctly? As I stated last year in this thread, when you load the password retrieval page and put in your e-mail address it only gives you the first listing if finds with that e-mail. If you have 3 listings with one email it doesnt allow you to retrieve all listings.
Jun 22, 2004, 1:06 PM
Veteran (1352 posts)
Jun 22, 2004, 1:06 PM
Post #37 of 41
Views: 14661
I have not solved your problem, but maybe somebody can look at this code and see what it needs. I'm sure it's pretty simple, just gotta know perl...
This is from modify_ret.cgi:
sub process_form {
# --------------------------------------------------------
($in{'Email'} !~ /.+@.+\..+/[/url]) and &site_html_modify_up_ret_failure ("You did not specify a valid email address.") and return;
# Let's check to make sure the link we want to update is actually
# in the database.
open (DB, "<$db_file_name") or &cgierr("Error in validate_records. unable to open db file: $db_file_name. Reason: $!");
$found = 0;
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_contact_email] eq $in{'Email'}) {
$u = $data[$db_user];
$p = reverse $data[$db_pw];
$t = $data[$db_title];
$n = $data[$db_contact_name];
$found = 1;
last LINE;
}
}
close DB;
!$found and &site_html_modify_up_ret_failure ("Record not found.") and return;
if ($found) {
&send_email();
&site_html_modify_up_ret_success() and return;
}
}
Leonard
aka PerlFlunkie
This is from modify_ret.cgi:
sub process_form {
# --------------------------------------------------------
($in{'Email'} !~ /.+@.+\..+/[/url]) and &site_html_modify_up_ret_failure ("You did not specify a valid email address.") and return;
# Let's check to make sure the link we want to update is actually
# in the database.
open (DB, "<$db_file_name") or &cgierr("Error in validate_records. unable to open db file: $db_file_name. Reason: $!");
$found = 0;
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_contact_email] eq $in{'Email'}) {
$u = $data[$db_user];
$p = reverse $data[$db_pw];
$t = $data[$db_title];
$n = $data[$db_contact_name];
$found = 1;
last LINE;
}
}
close DB;
!$found and &site_html_modify_up_ret_failure ("Record not found.") and return;
if ($found) {
&send_email();
&site_html_modify_up_ret_success() and return;
}
}
Leonard
aka PerlFlunkie
Nov 26, 2006, 2:35 AM
Novice (32 posts)
Nov 26, 2006, 2:35 AM
Post #38 of 41
Views: 14410
you are right... the solution i came up with (even though its two years later ) is to have the email include multiple passwords and usernames for each title they have on file under the email. Replace both process_form and send_email in modify_ret.cgi with the following:
sub process_form {
# --------------------------------------------------------
($in{'Email'} !~ /.+@.+\..+/[/url]) and &site_html_modify_up_ret_failure ("You did not specify a valid email address.") and return;
# Let's check to make sure the link we want to update is actually
# in the database.
open (DB, "<$db_file_name") or &cgierr("Error in validate_records. unable to open db file: $db_file_name. Reason: $!");
$found = 0;
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_contact_email] eq $in{'Email'}) {
if ($found > 0) {
$u[$found] = $data[$db_user];
$p[$found] = $data[$db_pw];
$t[$found] = $data[$db_title];
$n[$found] = $data[$db_contact_name];
$found++;
}
else {
$u = $data[$db_user];
$p = $data[$db_pw];
$t = $data[$db_title];
$n = $data[$db_contact_name];
$found = 1;
# last LINE;
}
}
}
close DB;
!$found and &site_html_modify_up_ret_failure ("Record not found.") and return;
if ($found) {
&send_email();
&site_html_modify_up_ret_success() and return;
}
}
sub send_email {
# --------------------------------------------------------
# Sends an email to the admin, letting him know that there is
# a new link waiting to be validated.
if ($n =~ /^(\w+)\s\w+$/) {
$n = $1;
}
# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");
my $to = $in{'Email'};
my $from = $db_admin_email;
my $subject = "Password retrieval for: $t";
my $msg = qq|Hello $n,|;
$found = $found - 1;
if ($found > 0) {
$msg .= qq|
Here are your Contact Names and Passwords for all your listings:
Company Name : $t
Username : $u
Password : $p
|;
$number = 1;
while ($found >= $number) {
$msg .= qq|
Company Name : $t[$number]
Username : $u[$number]
Password : $p[$number]
|;
$number++;
}
} else {
$msg .= qq|
Here is your Contact Name and Password:
Username : $u
Password : $p|;
}
$msg .= qq|
found is $found
Please login here:
$db_cgi_url/modify.cgi
Sincerely,
Links Manager.
|;
# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return undef;
$mailer->send or return undef;
}
Hope that helps :D
Vote Stinky
Code:
sub process_form {
# --------------------------------------------------------
($in{'Email'} !~ /.+@.+\..+/[/url]) and &site_html_modify_up_ret_failure ("You did not specify a valid email address.") and return;
# Let's check to make sure the link we want to update is actually
# in the database.
open (DB, "<$db_file_name") or &cgierr("Error in validate_records. unable to open db file: $db_file_name. Reason: $!");
$found = 0;
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_contact_email] eq $in{'Email'}) {
if ($found > 0) {
$u[$found] = $data[$db_user];
$p[$found] = $data[$db_pw];
$t[$found] = $data[$db_title];
$n[$found] = $data[$db_contact_name];
$found++;
}
else {
$u = $data[$db_user];
$p = $data[$db_pw];
$t = $data[$db_title];
$n = $data[$db_contact_name];
$found = 1;
# last LINE;
}
}
}
close DB;
!$found and &site_html_modify_up_ret_failure ("Record not found.") and return;
if ($found) {
&send_email();
&site_html_modify_up_ret_success() and return;
}
}
sub send_email {
# --------------------------------------------------------
# Sends an email to the admin, letting him know that there is
# a new link waiting to be validated.
if ($n =~ /^(\w+)\s\w+$/) {
$n = $1;
}
# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");
my $to = $in{'Email'};
my $from = $db_admin_email;
my $subject = "Password retrieval for: $t";
my $msg = qq|Hello $n,|;
$found = $found - 1;
if ($found > 0) {
$msg .= qq|
Here are your Contact Names and Passwords for all your listings:
Company Name : $t
Username : $u
Password : $p
|;
$number = 1;
while ($found >= $number) {
$msg .= qq|
Company Name : $t[$number]
Username : $u[$number]
Password : $p[$number]
|;
$number++;
}
} else {
$msg .= qq|
Here is your Contact Name and Password:
Username : $u
Password : $p|;
}
$msg .= qq|
found is $found
Please login here:
$db_cgi_url/modify.cgi
Sincerely,
Links Manager.
|;
# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return undef;
$mailer->send or return undef;
}
Hope that helps :D
Vote Stinky