Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

User Login - list associated links to modify

Quote Reply
User Login - list associated links to modify
Question: Has anyone done a mod yet that when a person logs into the system, he/she is presented with a list of links associated with their login and links to modify.cgi for each and spanning pages if there are say more than 25 or 50 or x? I'm assuming that in HTML_templates.pm in the sub site_html_login_success area I would just make a new sql call to select the record id's where the Username equals the login name just entered. But I'm not sure about validating input, spanning pages and continuing to validate so someone can't circumvent the login. I'm also guessing I'll need a new template for the follow on list if there are more than x links.

Jerry


Quote Reply
Re: User Login - list associated links to modify In reply to
http://gossamer-threads.com/perl/forum/showflat.pl?Cat=&Board=LSQLDisc&Number=69827&page=&view=&sb=&vc=1

remember... i think widgetz.com works right now.. but in the future.. use jsu7785.hypermart.net

also.. my demo might not work right if you used any of my other scripts using cookies.. i did something wrong with the cookie settings in my forum.cgi and login.cgi and they conflicted in msie..

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: User Login - list associated links to modify In reply to
Yeah, I'm using that your mod, but I don't think I'm using either forum.cgi or login.cgi since I don't have those files anywhere. It's weird... I've gotten pretty far in this, I think I have most everything done. What I ended up doing is when someone logs in, if they aren't coming from add link request requiring them to log in, they I redirect them to modify.cgi - no parameters - so it displays their list of links using the mod. That all works fine, but when I select one of the links to edit, and click on Modify, then I get the main modify page with No Links to Modify, which appears to happen because of this part of the template:
<%ifnot Links%>
No Links to Modify!
<%endif%>

And I can't figure out why the ID from the display part isn't being passed... or I guess it could be something with an error in the cookie, but believe it or not, I'm using Netscape 3 to test this right now, since I always get things working in the older browsers and I'll know it should pretty much working in anything. I do get the same exact problem in IE 4.0 though.

Jerry


Quote Reply
Re: User Login - list associated links to modify In reply to
i sort of think it has to do with calling the same template in site_html_modify_form..

it should be modify_form.html instead of modify.html..

a lot of people get this error.. i'm sorry i didn't put that in the instructions.. it is a little thing that i forgot..

hope you like the mod.. there are a few new things that i did to it that those files were not updated with.. such as..

in both add.cgi and modify.cgi..

Code:
if (! defined $USER) {
print $in->redirect("$LINKS{db_cgi_url}/user.cgi?to=$ENV{'SCRIPT_NAME'}") and return;
}
to

Code:
if (! defined $USER) {
my $encurl = "$ENV{'SCRIPT_NAME'}?$ENV{'QUERY_STRING'}";
$encurl =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
print $in->redirect("$LINKS{db_cgi_url}/user.cgi?to=$encurl") and return;
}
this simply allows all the inputs to be passed to and back to modify.cgi and add.cgi after the login..

for example.. if the user goes to modify.cgi?ID=1.. in the old version.. after logging in.. it would go to modify.cgi and list all the links the owner has.. in the new version.. if the user owns the link, it will go to the form to edit the link..

also.. it should work if the user some reason logged out or session expired before he submits the form.. so instead of making him type it over after login.. it will return the success page if all inputs are valid..

sorry i didn't put this mod in the resource center.. i don't put many mods there.. i publish them in the forum usually..

also.. i hope to see alex's version of this in the new version.. my guess is he will be having something similiar..

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: User Login - list associated links to modify In reply to
i feel like i'm talking to myself..

all of a sudden there is Jerry and JerryP in these forums.. :)

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: User Login - list associated links to modify In reply to
Perfect, that seems to have done it.. I did already have the other code for add.cgi and modify.cgi from the forum postings on the mod.. it was just the form name that caused me problems.

I'd say great minds think alike, both being Jerry's and what not but that would only mean our parents were great minds, not us :)

Jerry


Quote Reply
Re: User Login - list associated links to modify In reply to
What's happening to widgez.com ?

Quote Reply
Re: User Login - list associated links to modify In reply to
nothing.. i was going to make a cgi site out of it..

but then i am using it with jerrysu.com

Jerry Su
email@jerrysu.com
http://www.jerrysu.com/
Quote Reply
Re: [JerryP] User Login - list associated links to modify In reply to
I have this idea for long time but never see any disscussion about that.
after a user submit a lot of links, it may be good to list his links by category .


when a link submitter logs into the system he/she is presented with a list of
category contain the links he/she submitted.


Thanks