Gossamer Forum
Home : Products : Links 2.0 : Customization :

Mod to retrieve record for user to modify link

Quote Reply
Mod to retrieve record for user to modify link
Has anyone written a mod to allow users to retrieve a stored record based on authentication in a form already filled out when they want to modify their link? Much like the admin interface modify record that retrieves the record in a form, except scaled down and customizable with options to choose which fields users can see and modify.

Tongue
Quote Reply
Re: [awwa] Mod to retrieve record for user to modify link In reply to
http://www.gossamer-threads.com/...t_reply;so=ASC;mh=25;

Read ALL of the thread...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Mod to retrieve record for user to modify link In reply to
Thanks Leonard for the link.

I updated all the subs and added the Username and Password fields in all my add and modify forms, updated my mod.cgi, added the codes to my site_html_templates.pl file but keep getting the “Invalid username or password. Record not found” Error.

(I do have the AltCategories mod installed so the I’m not sure if I have the subs in site_html_templates.pl right).

Anyway, this tells me that the mod.cgi is working and the site_html_templates.pl is sending me to the mod_up.html page. I am making it to the check sub in mod.cgi but then I get the error. I have the Username and Password fields added in the Links.def and can retrieve a record in admin.cgi for a specific Username and Password so the record exists.

I will attach the site_html_templates.pl subs for review.
Quote Reply
Re: [awwa] Mod to retrieve record for user to modify link In reply to
At least it's doing something...Tongue

Do you have the altcat in field [5]?

Then this from the mod:

Username => [14, 'alpha', 40, 75, 1, '', '[\w\d]+'],
Password => [15, 'alpha', 40, 75, 1, '', '[\w\d]+']

would change to 15 and 16, respectively. Do you have something entered in the field in the db for username and password? Not just a space for it, but an entry? Also from the readme:

Then further down add:

$db_user = 14; $db_pw = 15;

or 15 and 16...

If you still have trouble, upload a copy of your links.def for us to see.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Mod to retrieve record for user to modify link In reply to
The links.def is fine, I simply changed my Invoice field to Password and another extra field to Username. I’m sure it doesn’t matter where they are in the db.

Password => [26, 'alpha', 40, 75, 1, '', '[\w\d]+'],



Username => [37, 'alpha', 40, 75, 1, '', '[\w\d]+']



$db_pw = 26;

$db_user = 37;



The problem has to be the altcat mod. I already attached the site_html_templates.pl.



Guess I could include the mod.cgi

Attached Generalmod.cgi

see if you find any problems here.
Quote Reply
Re: [awwa] Mod to retrieve record for user to modify link In reply to
Try that upload again.
Quote Reply
Re: [awwa] Mod to retrieve record for user to modify link In reply to
Did everything work OK before you added the modifyprotection? Do you really have 37 fields in your link.def?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Mod to retrieve record for user to modify link In reply to
Yes everything worked fine, and yes I do have 37 fields. And I'm going to take the mod off and return to the origional.



Jake
Quote Reply
Re: [awwa] Mod to retrieve record for user to modify link In reply to
More thoughts:

is this an active site, with many links already in the db? If yes, you might try setting up a second Links, a copy of your current, working version, then add the modifyprotection mod, THEN add cats and links to test it. It's possible the fields are out of whack...

Or, make a backup uf your data files, upload new, blank ones, then build all.


Leonard
aka PerlFlunkie
Quote Reply
Re: password protect mod problems In reply to
Problem: When you click on the add.cgi or mod.cgi after updating with the password mod codes, the scripts will not execute. Yes they point to perl and have a 755 chmod, tried 777 also. Yes I made sure the code is exact dup of readme file updates. Even tried the substitute add and mod.cgi files and they won’t execute either. The problem is in the site_html_templates.pl code updates, cause when I put back the original file the scripts execute. I told you earlier that I had on the alt categories mod and that changes the code in site_html_templates.pl.



Do you have the alt cat mod on? If so can you show me your add and mod subs in site_html_templates.pl.



Thanks



Jake
Quote Reply
Re: [awwa] password protect mod problems In reply to
I see what you're after, listing any alt cats on the modify form. I have not done that, though I do have the altcat mod installed. I just have not given that option to others, it's only an admin function. I'll look over the code more, see what I see...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] password protect mod problems In reply to
Oh that’s right, I forgot that the mod to make alt cats show on the user forms was extra. That’s what is messing things up. If I replace the altcat mod changes in site_htm_templates.pl with the routines in the zip you sent, the modify_up.html template shows but I get a Contact Name Tag error. I’m not getting that value (probably lots of values) after login, and I'm not passing Contact Name to the mod form template. I checked all the Cap issues, they seem to be right. I just wanted to see if it would work as sent. It don't on my script because of the other changes altcat mod has made. I also do not have the Username and Password in sequence, ie 15 16 in links.def. I don't see how that could matter.


I'll upload the latest files.

Last edited by:

awwa: Oct 28, 2003, 8:11 PM
Quote Reply
Re: [awwa] password protect mod problems In reply to
You can add the Contact Name and whatever else you need to the globals in site_html_templates. That should stop the 'unknown tag' error. Some fields in the links.def are referred to from other files, and have the field number entered there. Changing it just in the def file would cause problems... An example:

$numlinks = $stats{"$subcat"}[0];

where the script will look to field 0 for the ID. I know, you didn't change that, but this applies to other fields, too. At least, I'm pretty sure it works that way...Unimpressed


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] password protect mod problems In reply to
I found the problem: In modify.cgi I changed the reversed from

my $reversed = reversed $in{'Password'};



To

my $reversed = $in{'Password'};



Now it works.
Quote Reply
Re: [awwa] password protect mod problems In reply to
I removed that reversing "feature" as I found it just made things more complicated.


Leonard
aka PerlFlunkie