Gossamer Forum
Home : Products : Others : Fileman :

How to call another cgi script with fileman.cgi

Quote Reply
How to call another cgi script with fileman.cgi
<as subject> Thanks!Shocked
Quote Reply
Re: [hippo] How to call another cgi script with fileman.cgi In reply to
Could you provide a little more detail. How do you mean exactly?
Quote Reply
Re: [RedRum] How to call another cgi script with fileman.cgi In reply to
Shocked Sorry! Ok, I have another script installed to check password sharing for httpaccess.

I want to call when my visitors reach the login page. My host supports SSI, however it requires shtml doc.

Thanks!
Quote Reply
Re: [hippo] How to call another cgi script with fileman.cgi In reply to
Create a .shtml document to mimic the fileman login page.
Thus, place your <!--#exec call in that page.
Quote Reply
file no found? In reply to
Crazy I am not sure if I am not doing the right thing ...

(is that what you mean?)

I have added the SSI tag in the admin_login.html,

then renamed it to shtml doc.

then, script can't finding admin_login.html.

Please advice, thank you!

Last edited by:

hippo: Feb 10, 2002, 6:30 AM
Quote Reply
Re: [hippo] file no found? In reply to
Hi,

Just make a little change in login_form subroutine within Admin.pm:
.....
$self->page('admin_login.shtml',{msg => $msg});
...

TheStone.

B.
Quote Reply
Doesn't not perform the action?! In reply to
Shocked Hi! I have edited the admin.pm successful. Yes, the admin_login.shtml is now found. However, it doesn't perform the SSI tag action.

(For example, I include the tag to echo the remote address, it doesn't display on the login page. ) <!--#echo var="REMOTE_ADDR" -->

Basically, I have a script to detect valid referer url. It will automatically redirect it to my front page if found invalid. <!--#exec cgi="/cgi-bin/thebouncer.cgi"-->

I try to call this script inside the admin_login.shtml, however, 'nothing' happens. Please advice. Thank you! Tongue

Last edited by:

hippo: Feb 12, 2002, 11:49 AM
Quote Reply
I need more help please! In reply to
Hi! Would one of your stuff give me more help.

I bought this script last week, and I still can't really start using it yet.

I was told that I can call another script within fileman script before I made my purchase.

However, I still can't get it to work. Please kindly help and reply to my problem. Thanks in advance.
Quote Reply
Re: [hippo] I need more help please! In reply to
Hi,

Let try to call your script inside fileman.cgi like:

sub sub main () {
#-------------------------------------------------------------------
# Main process
#

do thebouncer.cgi
....
}

TheStone.


B.
Quote Reply
Re: [TheStone] I need more help please! In reply to
I am not sure if I add the code to the wrong spot.

It's because I receive internal server error. What should i do??Crazy

Attached is the script I am trying to call. Thank you for you time. Tongue
Quote Reply
Re: [hippo] I need more help please! In reply to
You didn't add the ... too by any chance?

You would also need a ; at the end:

do yourfile.cgi;

Last edited by:

RedRum: Feb 14, 2002, 1:14 PM
Quote Reply
Re: [RedRum] I need more help please! In reply to
Please tell me EXACTLY where to ADD this part:

------------------------------

sub sub main () {

do thebouncer.cgi;

}

--------------------------------

I did what I have been told, but I am still getting 500 internal server error.

Please help!!! Thanks!!
Quote Reply
Re: [hippo] I need more help please! In reply to
You can find sub main (only one sub) in the fileman.cgi and just add a new line do thebouncer.cgi; inside that subroutine;

(thebouncer.cgi must be in the same directory with fileman.cgi)

Cheers,
jean(at)gossamer-threads.com
Quote Reply
Re: [jean] I need more help please! In reply to
Frown It's still getting errors. 500 internal server error???

What can I do!!! Please advice. Thank you!
Quote Reply
Re: [hippo] I need more help please! In reply to
So, does anyone here can help me please???

If not, I will contact send email to the support instead.
Quote Reply
Re: [hippo] I need more help please! In reply to
Hi,

Could you just paste your error log here ? We will take a look and be able to help you.

Regards,

Jean
Quote Reply
Re: [jean] I need more help please! In reply to
Is this the log you mentioned?

*************************************************
Bareword "cgi" not allowed while "strict subs" in use at fileman.cgi line 31.
Execution of fileman.cgi aborted due to compilation errors.
[Wed Feb 20 05:48:31 2002] [error] [client ip.ip.ip.ip] Premature end of script headers: /home/virtual/site6/fst/var/www/cgi-bin/fileman/fileman.cgi

****************************************************
Thank you for your help.

Last edited by:

hippo: Feb 20, 2002, 12:57 AM
Quote Reply
Re: [hippo] I need more help please! In reply to
Hi hippo,

Yes, exactly . You should put the string thebouncer.cgi between two double-quotes like below:

do "thebouncer.cgi";

It should work now.
Cheers,


Jean
Quote Reply
Re: [jean] I need more help please! In reply to
Yes, the 500 internal error does not appear anymore.

However, it is not able to detect invalid referrer either.

I wonder if it's because the script for the fileman runs prior thebouncer.cgi.

That's why it think that's is valid referrer ALL the time.

What do you think? Unsure

Last edited by:

hippo: Feb 20, 2002, 1:54 AM
Quote Reply
Re: [hippo] I need more help please! In reply to
If you need to check valid referers only , just simply add the code below to the top of subroutine main in your fileman.cgi:

Code:
my @referers = qw|www.yoursite1.com www.yoursite2.com|;
my $redirect = 'http://www.your_redirect.com';
my $found_flag;
foreach (@referers) { $ENV{'HTTP_REFERER'} =~ /\Q$_\E/i and $found_flag++ and last; }
$found_flag or return print GT::CGI->redirect($redirect);
.....
Hope that helps,
jean(at)Gossamer-Threads.com
Quote Reply
check referrer doesn't work In reply to
Hi, I try to add the code,

however, it redirects me EVERYTIME even though it is coming from my own site.

Anyway, don't worry about it, I guess I will call javascript before the page is loaded.

Thanks for trying to help.