Joomla! Discussion Forums



It is currently Sun Nov 22, 2009 3:57 am (All times are UTC )

 




Post new topic Reply to topic  [ 3 posts ] 
Author Message
Posted: Tue May 23, 2006 2:28 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Tue Oct 04, 2005 3:56 pm
Posts: 428
Hi,
I'm the author of two bridges, one for coppermine and other for phpbb.
Both use the same logic and I'd like to adapt them to work with the coming Joomla 1.5.

Explanation of the logic: it's not joomla that include the script as a component  but the contrary: the script that include joomla.
I modify the script in a way that it capture joomla's output  (by including index.php). Then the output is processed  in order
that this output is viewable from script subfolder.
Additional processing is done to join  script's output to joomla's output in order to avoid the use of a wrapper.
Well that's a "rough"  explanation, but you should get the idea.

Here's a basic example of how to capture Joomla's output from a subfolder:
Code:
<?php

$tmpdir=getcwd();
chdir("../");
ob_start();
include("index.php");
$joomlapage= ob_get_contents();
ob_end_clean();      
chdir($tmpdir);

// Fix the links in the included page to refer to the Joomla root directory
   $joomlapage=preg_replace('#(<[^>]*)(href|src|action|link|background)\s*=\s*"([^/:"][^:"]*)"#i',' \1\2="../\3"',$joomlapage);

//other fixes, not there for simplicity of example

echo $joomlapage;

?>


Now here's my problem. This logic work pretty well with Joomla 1.08.
When I login into Joomla 1.08, and then that I use that the previous basic script in a subfolder, I get a correct Joomla's output; in particular, In the  output I see  that I'm also logged.


However with the latest Joomla 1.5 build  I've downloaded, I see a problem . I can be connected into Joomla 1.05, but with the script it looks like as if I'm still disconnected.


I can also perform the test by changing a line in the previous basic example.
Instead of:
Code:
echo $joomlapage;

I replace by:
Code:
if($my->id) echo "connected";
else echo "disconnected";


It this case it will always display "disconnected" with Joomla 1.5. Not  the case with version 1.08.

Would you help me to find/fix the problem ?
Does this have with increased security inside Joomla 1.5 ?
Could the problem be avoided ?

thanks


Last edited by mehdi on Tue May 23, 2006 3:08 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Tue May 23, 2006 7:43 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Tue Oct 04, 2005 3:56 pm
Posts: 428
well,  I found the solution.
problem is that constant $mosConfig_live_site or equivalent is no more stored in configuration but is instead determined dynamically.
Since sessions depend on this , I have the previously mentioned problem.

Solution is to overwrite value $_SERVER['PHP_SELF'] before inclusion.
Then the dynamically  determined 'live_site' value will be correct.


Top
  E-mail  
 
Posted: Tue May 23, 2006 10:10 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 12:06 pm
Posts: 707
Location: Netherlands
Please read this thread --> http://dev.joomla.org/index.php?option= ... nsions_fit


There you can see the usage of $mosConfig_live_site globals is deprecated (but supported for backward compatibility), use JRequest::getVar('live_site') instead.

_________________
Personal blogs can be found on http://JFoobar.org
/www.moovum.com - The Bird is in the air! Get Mollom Anti-Spam on your Joomla! website with Moovur...
www.abillo.com - The dream expierence


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

Quick reply

 



Who is online

Users browsing this forum: Cyb, ksorbo and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group