views:

240

answers:

3

Hi

As usual you write in Joomla Development

defined('_JEXEC') or die('Restricted access');  

I make a plugin which needs access from Paypal/IPN, so i exclude that in that specific file. BUT I also need to use the Joomla-intern Variables to access the Database, so i tried this:

require("../filewithaccesstoframework.php");  

OR even

$baseurl = $_SERVER['HTTP_HOST'];
$baseurl ="http://".$baseurl."/configuration.php";
require($baseurl);  

By using the first code it displays "Restircted Access" since it seems to take this from the included file which i can't skip to put-in-there.

The second code does not seem to recognize the Variables used in configuration.php like $host, $db, $password. the file configuration.php is chmod 444

Why this happens and is there a workarround to allow direct access to a file AND using the Joomla intern Framework (Variables, Functions)?

A: 

Similar problem here....

Forrest
A: 

I'm in your situation, recently a customer has asked user sincronization from their intranet to joomla which looks painful for me.. and after goggling a little and diving through their forums i found a blog post on accessing the joomla framework via the CLI but i haven't tested myself until he tells us what does he want exactly

rmontagud
the second code i displayed does work for me, just call the variables inside the object so that you can have db-access. But direct framework access would faciliate a lot though.
Email
A: 

I developed a custom IPN for Joomla before, had same problem You need to create 2nd entry point and initialize the application there. This way your IPN entry will have all the functions/classes/constants of Joomla Framework but without output.

See this article below. You can download source code for IPN that runs withing joomla framework there http://boolcast.com/joomla/3-development/13-joomla-custom-paypal-ipn

Alex