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

modify.cgi: user modify mod

Quote Reply
modify.cgi: user modify mod
ok.. i believe this code is ready for release. It's quite simple and (hopefully) easy to install.

to see a demo..

www.pdamania.com/modify.cgi

login as:

u: pdamania
p: test

then go to

www.pdamania.com/user.cgi?to=/modify.cgi

login as:

u: jsu7785
p: test

anyways.. overall..

ADD CGI: 0
MOD CGI: 2 (add.cgi, modify.cgi)
ADD TEMPLATE: 2 (modify.html, modify_link.html)
MOD TEMPLATE: 2 (modify_form.html, modify_failure.html)

also.. if you guys want delete.cgi just tell me. it's already finished. it's just that you actually have to mod some things in the admin..

anyways..

get the two files.. add.cgi and modify.cgi

www.widgetz.com/sql/add.txt
www.widgetz.com/sql/modify.txt

then you are going to need to add templates..

HTML_Templates.pm
---------------------
add this to @EXPORT

Code:
&site_html_modify &site_html_modify_link

add these subroutines..

Code:
sub site_html_modify {
# --------------------------------------------------------
# This routine displays the user's links to modify.
#
my ($tags, $dynamic) = @_;
my $style = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('modify.html', {
%$tags,
%GLOBALS
}, undef, $style);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}

sub site_html_modify_link {
# --------------------------------------------------------
my ($rec, $dynamic) = @_;
my $style = defined $dynamic ? $dynamic->param('t') : undef;
(ref $rec eq 'HASH') or croak "HTML_TEMPLATES: Argument '$rec' must be hash reference";

($rec->{'isDetail'} eq 'Yes') ?
($rec->{'LinkURL'} = "$LINKS{build_detail_url}/${$rec}{'ID'}$LINKS{build_extension}") :
($rec->{'LinkURL'} = $rec->{'URL'});

# defined $dynamic and &load_user ($dynamic, $user);
my $output = &load_template ('modify_link.html', {
%$rec,
%GLOBALS
}, undef, $style);
return $output;
}

get the 4 templates..

www.widgetz.com/sql/modify_html.txt
www.widgetz.com/sql/modify_link_html.txt
www.widgetz.com/sql/modify_form_html.txt
www.widgetz.com/sql/modify_error_html.txt

basically.. the form and the error have 1 hidden tag added (the ID) and then the Current URL taken out..

this is a secure system.. it won't let anyone not logged in slip by and it won't let anyone not authorized to edit a link to edit a link.. keep in mind that this mod doesn't allow admins to edit all the links.. Smile [that's what the administration is for]

oh yea.. you have to add a field to the Links Database..

name: Username
form: 20
max : 35
default: PDAmania (in your case the administrator's name.. so when you add links from the admin.. it will be defaulted to you)

now it should be ready.. some of you might have to fix user.cgi (i had to)

find:

Code:
my $session_cookie = $in->cookie ( -name => 's', -value => $session, -expires => '+3h' );
my $user_cookie = $in->cookie ( -name => 'Username', -value => $user, -expires => '+1y' );

change to

Code:
my $session_cookie = $in->cookie (
-name => 's',
-value => $session,
-expires => '+3h',
-path => '/',
-domain => '.pdamania.com'
);
my $user_cookie = $in->cookie (
-name => 'Username',
-value => $user,
-expires => '+1y',
-path => '/',
-domain => '.pdamania.com'
);

change the domain to yours (yes.. keep the first period).. leave the path alone.. it allows for the cookie to be used anywhere.. (in your domain)..

anyways.. hopefully my instructions are good.. tell me..

i'll make a website with the links sql mods after finals and after my ski trip (i snowboard .. parents/relatives ski).. that's in february for your information Smile so it's a LONG time..


------------------
Jerry Su

[This message has been edited by widgetz (edited January 01, 2000).]
Quote Reply
Re: modify.cgi: user modify mod In reply to
forgot to say..

the links do go through validation..

------------------
Jerry Su
Quote Reply
Re: modify.cgi: user modify mod In reply to
ugh..

Code:
sub display {
# --------------------------------------------------------
my ($in, $dynamic) = @_;
my ($links, $span);

# Get the user's links.
my $db = new Links: BSQL $LINKS{admin_root_path} . "/defs/Links.def";
my $recs = $db->query ({ Username => "$USER->{'Username'}", mh => 10, nh => ($in->param('nh') | | '1'), ww => 1 });

# Change the links into HTML.
if ($db->hits) {
foreach my $rec (@$recs) {
$rec = $db->array_to_hash ($rec);
$links .= &site_html_modify_link ($rec);
}

# Span pages if more than 10 hits.
($db->hits > 10) and ($span = $db->toolbar());
}

# Display the page.
&site_html_modify ({ Links => $links, span => $span }, $dynamic);
}

change the "10"s if you want more links per page.. sorry i didn't make a variable like

Code:
$LINKS{build_links_per_modify} = 10;

and change the "10"s to $LINKS{build_links_per_modify}.. *hint*.

------------------
Jerry Su
Quote Reply
Re: modify.cgi: user modify mod In reply to
This sounds pretty cool. I'm going to see how it works on the FAQ....

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: modify.cgi: user modify mod In reply to
can you guys either email me or post here that you successfully installed this mod Smile

also.. one of the reasons i am not releasing many of my mods are because they require much modifications to certain scripts.. this one only required you to add a username field.. but usually that means you should get rid of the contact email field too.. but because nph-email.cgi uses that field.. i am not suggesting it unless you know the code to get the username out of the links database then fish the email from the users database..

ok?

------------------
Jerry Su
Links SQL Licensed
------------------
Quote Reply
Re: modify.cgi: user modify mod In reply to
LOL... you know, I forgot in the mess of what was going on. I had trouble with the sessions data, and once I got that fixed, I forgot to finish the mod.

I'll let you know later today <G>

But, _PLEASE_ start releasing the mods. If you'd want me to polish the docs, I'll do it. There are a lot of people waiting for the code, and it's better to get it out there, and worry about the docs later -- Smile Just put a little armour all on your shell.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Quote Reply
Re: modify.cgi: user modify mod In reply to
i couldn't find the thread myself.. so you can just find this in user.cgi

Code:
$db->add_record ( $in_r );

and change it to
Code:
$db->add_record ( $in_r ) or &site_html_signup_form ( { error => $Links::DBSQL::error, %{$in_r} }, $dynamic ) and return;

also.. there are many other bugs in user.cgi.. you should go to Pugdog's FAQ and go read all the bugs threads..

------------------
Jerry Su
Links SQL Licensed
------------------



[This message has been edited by widgetz (edited January 22, 2000).]
Quote Reply
Re: modify.cgi: user modify mod In reply to
I am using that mod. There is a little bug in it.
If you add some required fields to the user table user.cgi won't display the DBSQL error and will send the user to the success page because you don't evaluate the return value of the function add_record()

Quote Reply
Re: modify.cgi: user modify mod In reply to
i already gave alex the fix for that...

search this forum for user.cgi bug

there were quite a few..

it's a simple fix

------------------
Jerry Su
Links SQL Licensed
------------------

Quote Reply
Re: modify.cgi: user modify mod In reply to
Thanks, it works fine now.

I left the field Contact_Email in the links Table and then changed add.cgi to fill in this field with the value from authenticate

$in->param ( -name => 'Contact_Email', -value => $USER->{Email} );

By the way do you have an idea how to redirect the user to the page he intended to reach?

Lets say he clicked on modify.cgi; modify sends him to the login; login sends him to login_success;

Is there a way to send him back to modify.cgi or add.cgi where he initially intended to go?

[This message has been edited by Alex404 (edited January 25, 2000).]
Quote Reply
Re: modify.cgi: user modify mod In reply to
the thing i did with the ?to=lala

i just put like

Code:
if ($to) {
print $in->redirect( -uri => "$LINKS{build_root_url}$to" );
}
else {
# regular stuff
}

of course i put the cookie stuff in too..
Quote Reply
Re: modify.cgi: user modify mod In reply to
Hi widgetz,

are you storing the "?to=lala" data in a cookie or passing it as a tag to the different forms?

regards, Alexander
Quote Reply
Re: modify.cgi: user modify mod In reply to
oh.. for that i passed it to the template and said..

Code:
<%if to%>
<input type="hidden" name="to" value="<%to%>">
<%endif%>

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: modify.cgi: user modify mod In reply to
i forgot to mention when you change the cookies to the one with the path and domain.. you need to change the logout cookie too..

just add

Code:
, -path => '/', -domain => '.pdamania.com'

to the middle of that one line in the logout elsif..

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: modify.cgi: user modify mod In reply to
Thanks,

it's perfect now.
I had to modify add.cgi to send the ?ID=Id_No param with the $to

regards, Alexander
Quote Reply
Re: modify.cgi: user modify mod In reply to
Code:
if ($to) { print $in->redirect( -uri => "$LINKS{build_root_url}$to" );}else { # regular stuff}

where do i have to put the code?
I've tried to implant it in add.cgi, but the redirection doesn't work.



Quote Reply
Re: modify.cgi: user modify mod In reply to
Hello,

I jsut installed this mod. It does not redirect to the add or modify page after login. I also could not figure out where to place the following code to redirect me:
Code:
if ($to) {
print $in->redirect( -uri => "$LINKS{build_root_url}$to" );
}
else {
# regular stuff
}

Where do I put that? Please help...



------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: modify.cgi: user modify mod In reply to
that wasn't part of the mod.. but ok..

in sub login_user..

replace
Code:
print $in->header( -cookie => [$session_cookie, $user_cookie] );
&site_html_login_success ( $user_r, $in );

with
Code:
if ($in->param('to')) {
print $in->redirect( -cookie => [$session_cookie, $user_cookie], -uri => ("$LINKS{build_root_url}" . $in->param('to')) );
}
else {
print $in->header( -cookie => [$session_cookie, $user_cookie] );
&site_html_login_success ( $user_r, $in );
}

then don't forget to put that template thing in..

did i ever show you
http://www.pdamania.com/review2.cgi?ID=1002

it is the complete review.cgi v2.. with posting disabled..

------------------
Jerry Su
Links SQL User
------------------
Quote Reply
Re: modify.cgi: user modify mod In reply to
So Review.cgi 2 is ready Jerry Smile

BTW - I realise there is still code that needs help - if you need a version of Links SQL which is 99.99% unmodified then I have a solution for ya :P

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------






[This message has been edited by Michael_Bray (edited March 02, 2000).]
Quote Reply
Re: modify.cgi: user modify mod In reply to
Hello,

I entered the code above into sub login_user, but what teplate does the following go into:
Code:
<%if to%>
<input type="hidden" name="to" value="<%to%>">
<%endif%>

I did not see it explained anywhere.


------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: modify.cgi: user modify mod In reply to
It seems like the user.cgi doesn't parse <%to%> tag's correctly.

I got 'Unknown tag to' error.

Quote Reply
Re: modify.cgi: user modify mod In reply to
 So when is Review.cgi v2 planned to be released?

------------------
Robert Blackstone
Webmaster of Scato Search
www.scato.com
Quote Reply
Re: modify.cgi: user modify mod In reply to
jerry,

can I have the delete.cgi file?

thanks

Quote Reply
Re: modify.cgi: user modify mod In reply to
anyone can give the delete.cgi file ?
Quote Reply
Re: modify.cgi: user modify mod In reply to
Could someone be kind enough to post where I could pick up these files?

------------------
Robert Blackstone
Webmaster of Scato Search
www.scato.com
Quote Reply
Re: modify.cgi: user modify mod In reply to
Robert,

You can pick up the files at the following address:

http://jsu7785.hypermart.net/sql/

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: modify.cgi: user modify mod In reply to
Thank you Eliot.
Your help is appreciated.

------------------
Robert Blackstone
Webmaster of Scato Search
www.scato.com
Quote Reply
Re: modify.cgi: user modify mod In reply to
No problem...Robert.

Smile

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: modify.cgi: user modify mod In reply to
Hello,

I have tried this modification, but I can't figure out how to get the system to then forward me to the add or modify template depending on whether the user came from modify.cgi or add.cgi.

It just says you are now logged into the system.

Anyone have an idea? Please help.

------------------
James L. Murray
PaintballCity.com
The Yahoo of Paintball
www.paintballcity.com
AIM: Paintball City







Quote Reply
Re: modify.cgi: user modify mod In reply to
that's what the to stuff was about..

here.. in user.cgi sub login_user

replace...

Code:
print $in->header( -cookie => [$session_cookie, $user_cookie] );
&site_html_login_success ( $user_r, $in );

with

Code:
if ($in->param('to')) {
print $in->redirect( -cookie => [$session_cookie, $user_cookie], -uri => ("$LINKS{build_root_url}" . $in->param('to')) );
}
else {
print $in->header( -cookie => [$session_cookie, $user_cookie] );
&site_html_login_success ( $user_r, $in );
}

then in modify.cgi and add.cgi.. replace

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

with

Code:
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;

then in login.html.. in the form.. add

Code:
<%if to%>
<input type="hidden" name="to" value="<%to%>">
<%endif%>

jerry

[This message has been edited by widgetz (edited April 22, 2000).]

[This message has been edited by widgetz (edited April 22, 2000).]
Quote Reply
Re: modify.cgi: user modify mod In reply to
Hello Jerry,

I could not find the following code in your add.cgi and modify.cgi files I pulled from your site:
Code:
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;

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

Any ideas?

Maybe those filesn your site that AntroRules pointed us to are not the correct files?

------------------
James L. Murray
PaintballCity.com
The Yahoo of Paintball
www.paintballcity.com
AIM: Paintball City


[This message has been edited by Ground Zero (edited April 22, 2000).]
Quote Reply
Re: modify.cgi: user modify mod In reply to
i fixed the instructions..

what i did was i was copying and pasting both replace and with codes and i edited the wrong one..

jerry
Quote Reply
Re: modify.cgi: user modify mod In reply to
Ok...it still doesn't work for some reason. It doesn't forward me to the modify page or the add form.

Check it out at http://www.medinfolinks.com/cgi-local/links/add.cgi

Widgetz, maybe you can forward me your email address so that I can email you my code, if you would be so kind. This mod is really cool and I would love to use it. My email address is info@virtuetech.com

Or even talk to me on AIM at "Paintball City"

Thanks.



------------------
James L. Murray
PaintballCity.com
The Yahoo of Paintball
www.paintballcity.com
AIM: Paintball City







Quote Reply
Re: modify.cgi: user modify mod In reply to
FYI:

If anyone is using this Mod, I had to hack some of the codes widgetz (Jerry Su) provided to make the redirection work properly....

Here is what I did....The username check codes in the sub main routine in both the modify.cgi and add.cgi file should look like the following:

Code:

# Get user information.
my $s = $in->param('s') || $in->cookie('s');
$USER = &authenticate ($s);
if (! defined $USER) {
my $encurl = "$ENV{'SCRIPT_NAME'}";
print $in->redirect("$LINKS{build_user_url}?to=$encurl") and return;
}


2) The else statement in the sub main in the user.cgi file should look like the following:

Code:

else {
print $in->header();
my $username = $in->cookie('Username') || '';
my $to = $in->param('to'); &site_html_login_form ( { Username => $username, to => $to,}, $dynamic);
}


Notice the bolded codes...The to variable has to be defined in order for the parameter to be passed from the add and modify forms.

3) The conditional "to" statements at the end of the sub login_user routine should look like the following:

Code:


if (!$to) {
print $in->header( -cookie => [$session_cookie, $user_cookie] );
my $title_linked = &build_linked_cgi_title ("User Login/Login Success");
&site_html_login_success ({Username => $user, title_linked => $title_linked, {%$user_r}}, $in, $dynamic);
}
else {
print $in->redirect(-cookie => [$session_cookie, $user_cookie], -uri => $to);
}


Notice the uri configuration.

4) Then the following codes do work in the login.html template file:

Code:

<%if to%>
<input type="hidden" name="to" value="<%to%>">
<%endif%>


With these codes, the modify.cgi and add.cgi modifications work. However, there are some other changes I've made to the modify.cgi to make the ID pass from the selection form to the modify form. When I work out all the kinks with the codes, I will post them.

Regards,

Eliot Lee

Quote Reply
Re: modify.cgi: user modify mod In reply to
Okay...I figured out the missing codes in the sub modify that was causing the unblessed param error. I changed the following codes:

Code:

&site_html_modify_form ($rec, $dynamic);


to the following:

Code:

&site_html_modify_form ({%$rec}, $in, $dynamic);


BTW: I have also added the following features in the modify.cgi Mod:

1) If the user only has one Link in the database, then the modify_form pops up without having to select it from the table. If the user has more than one link, then they can select the links from the display screen.

2) I also added radio buttons for the ReceiveMail fields.

Anyway...if you want either of these hacks, let me know...and I will post the codes.

Regards,

Eliot


Quote Reply
Re: modify.cgi: user modify mod In reply to
In Reply To:
# Get user information.
my $s = $in->param('s') || $in->cookie('s');
$USER = &authenticate ($s);
if (! defined $USER) {
my $encurl = "$ENV{'SCRIPT_NAME'}";
print $in->redirect("$LINKS{build_user_url}?to=$encurl") and return;
}
this won't allow for the form input to be inputted when redirecting..

ie: modify.cgi?ID=12&Title=Hello
will return to modify.cgi.. my original would actually return there..



Jerry Su
Quote Reply
Re: modify.cgi: user modify mod In reply to
In Reply To:
&site_html_modify_form ({%$rec}, $in, $dynamic);
umm.. first off.. dynamic is suppose to contain the contents of $in if it is dynamic.. ie : page.cgi..

also.. {%$rec} is the same thing as $rec..

by defining a hash in {} you are creating a hash reference.. $rec is a hash reference.. by putting a % in front of it you are dereferencing the hash reference.. so....... {%$rec} is... first of dereferencing the hash reference $rec and then referencing it again... which is............ stupid..

by putting $in in place of dynamic is obviously going to fix the problem.. but if the page isn't dynamic.. it is not suppose to contain anything..

you should just try and make the...

my $dynamic = $in->param('d') ? $in : undef;

line... to..

my $dynamic = $in->param('d') ? $in : "";

or something.. same meaning..

Jerry Su
Quote Reply
Re: modify.cgi: user modify mod In reply to
Thanks for your feedback, Jerrysu. However, I kept getting unblessed param error using the codes you suggested...so that is why I came up with the solution I posted.

Regards,

Eliot Lee

Quote Reply
Re: modify.cgi: user modify mod In reply to
Not true...It will redirect to the modify form after the user logs in. Using your codes, the user is never redirected to the modify or add forms. They are redirected to the "login success" page...so, the codes I posted allows redirection to the correct script to occur.

Regards,

Eliot Lee

Quote Reply
Spanning Problem In reply to
I have worked out most of the kinks in this modification...really cool, BTW (Jerry). However, I have a problem with the spanning pages. If I click on the page number link, the page reloads with the first set of links. I have looked through the sub toolbar routine and also similar sub calls in other scripts (like search.cgi) and there does not seem to be any syntax errors in the modify.cgi script. However, the spanning results do not work.

Any ideas will be greatly appreciated.

Thanks in advance.

Regards,

Eliot

Quote Reply
Re: Spanning Problem In reply to
argh.. wrong answer.. some other script unrelated..



Jerry Su
Quote Reply
Re: Spanning Problem In reply to
Nice thought, jerry. However, it didn't work. In fact, the script crashed using GET.

Any other ideas will be appreciated.

Thanks.

Regards,

Eliot Lee

Quote Reply
Re: Spanning Problem In reply to
Eliot,

I tried to apply this mod, starting at the top of the file, and going down through the messages, back tracking where possible.

Here are a few things I found that didn't work with your version, probably due to mods you made prior to making these changes:

Code:
$to is undefined..... in the code 'tweaks" you made above, since you
are assigning my $to = $in->param{'to'}; in two places.

.

## the following is one of your routines?
my $title_linked = &build_linked_cgi_title ("User Login/Login Success");


## the following is also one of your local $LINKS tags:
print $in->redirect("$LINKS{build_user_url}?to=$encurl") and return;
If this is a real requested mod, then it would pay for either you or jerry to sit down, and create a new message, with all the steps, that work on a generic links install -- pointing out what needs to be added to make it fancy.



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Spanning Problem In reply to
In Reply To:

$to is undefined..... in the code 'tweaks" you made above, since youare assigning my $to = $in->param{'to'}; in two places.


Welp...I had to do that because it is used in both the sub main and sub login_user routines.

In Reply To:

## the following is one of your routines?my $title_linked = &build_linked_cgi_title ("User Login/Login Success");


Thanks for pointing this out...yes, it is a unique sub that I created that is a copy of the sub build_linked_title, but replaces $dir with $ENV{SCRIPT_NAME}. Sorry about that.

In Reply To:

# the following is also one of your local $LINKS tags:print $in->redirect("$LINKS{build_user_url}?to=$encurl") and return;


Right...which is easy to create with editing Links.pm and HTML_Templates.pm.

But my main point of my preceding posts is that the Mod did not work with the "out-of-box" codes that Jerry provided.

But it now works fine for me....Wink

In Reply To:

If this is a real requested mod, then it would pay for either you or jerry to sit down, and create a new message, with all the steps, that work on a generic links install -- pointing out what needs to be added to make it fancy.


Well...depending on the new version features...this Mod may be null and void...but I will keep this Mod in place since I will not be upgrading to Links v.1.2 or whatever the next version is called until it is stable...

Regards,

Eliot Lee

Regards,

Eliot Lee

Quote Reply
Re: Spanning Problem In reply to
I left out a part to the above... I wasn't griping, I can get it to work, I just wanted to point out what I found so that someone trying to install it knows what to look for. This mod, and even the mods to it, is still not an 'out of the script' modification to get working.

I just changed the variables to the standard paths already in links, and just assigned $to back to the $in->param('to') variable.... with 'my', etc.

Remember, "my" scopes the variables per "block" of code, which can be in a loop, in an "if" or subroutine, etc. If you scope 'my $to' inside a code block, you could theoretically define it multiple times in any given subroutine, and definitely multiple times in each source file. If you are going to do that, it would pay to pull it out and define it at the top of each subroutine -- or better yet, at the top of 'main' and then it would be available to each subroutine via scope.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Spanning Problem In reply to
Thanks for the suggestion, pugdog...But I tried that and when I went to login...I got an Unknown Tag: to in the login screen...so, when I added the second defined variable $to, it worked.

Regards,

Eliot Lee

Quote Reply
Re: Spanning Problem In reply to
You've probably done other things to your code.

I'm hacking a fairly unmodified version.

I'm really hoping that I can get the new user functions working with the old code... that would be the best interim functioning during the transition.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Spanning Problem In reply to
Uh...I used the original user.cgi file (and applied the codes from this Thread) and the linked modified modify.cgi script in this Thread and...The script would not work until I added the previously posted codes. Wink

Regards,

Eliot Lee

Quote Reply
Re: Spanning Problem In reply to
first off...

the redirection codes should look like this..

Code:
my $s = $in->param('s') || $in->cookie('s');
$USER = &authenticate ($s);
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;
}
plus.. the forms use method GET not POST..

and last but not least..

Code:
&site_html_modify_form ($rec, $in, $dynamic);
.... umm.. of course that would work.. but its not suppose to be like that.. if its not dynamic.. $dynamic would be undefined.. so it goes to site_html_modify_form.. where it gets this..

Code:
my $style = defined $dynamic ? $dynamic->param('t') : undef;
which is...

Code:
my $style;
if (defined $dynamic) {
$style = $dynamic->param('t');
}
else {
$style = undef;
}
so if dynamic isn't defined it won't be used.. so obviously it is not a bug.. just something wrong with your copy of the coding.. maybe even your version of perl.. almost every HTML_Templates.pm subroutine uses that.. so its not a bug and your 'fix' is simply just some stupid way (that works) of getting by the problem..

Jerry Su