[ic] Running Script as interchange user

JT Justman jt-lists at sirius.airdelights.com
Tue May 16 15:33:27 EDT 2006


Mark wrote:
> JT Justman wrote
> 
> Actually I want it to run from within Interchange.  I am sure that I read on
> the paypal howtos that they recommend not to use a page (I cant find the
> exact reference).
> 
> To keep the script in interchange is it as simple as saving with the tags
> and then calling it with the URL:
> 
> www.example.com/cgi-bin/catalog/script.pl
> 
> The script has to receive IPNs from paypal (which may arrive asynchronously
> with the transaction) filter the content, respond to paypal and record them
> in a postgres table.
> 
> Any clues would be a great help
> 
> Thanks
> 

Hi again, Mark. Sorry I hadn't replied before; I was out of town over
the weekend showing off my new baby boy.

There are a lot of considerations here, and that's probably why nobody
else jumped on this.

When you make a call to 'www.example.com/cgi-bin/catalog/script.pl', you
are asking Interchange to handle the request directly. Normally,
Interchange will treat this as a request for a file called
'pages/script.pl', which would be treated as an ITL-based page, NOT a
Perl script.

If you are calling it as 'www.example.com/cgi-bin/script.pl', you are
calling a Perl script that is not within Interchange but could be run as
the interchange user if you like.

'A page' doesn't have much meaning in this case. What you really need to
think about is:
	* What URL are they calling?
	* What do you need to do with the data internally?
	* What is the content (and content type) of the response they receive?
	* How are you going to be sure that a malicious person can't access
sensitive information by guessing this URL?

You can do pretty much whatever you ant while staying within Interchange:
	* Use a different content type using the [deliver] tag
	* Use whatever ITL or Perl code you want in the page. Use [perl] tags
for embedded Perl.
	* Use the handy Interchange database access tags and code you are
probably familiar with.

Good luck...

JT

-- 
	|Waiting to fix the world since 1995|
"Progress isn't made by early risers. It's made by lazy men trying to
find easier ways to do something."
	- Robert Heinlein


More information about the interchange-users mailing list