This topic is locked

PHPRunner and Joomla

12/2/2009 12:33:29 AM
PHPRunner Tips and Tricks
admin

This article explains how to integrate PHPRunner and Joomla. Tested with PHPRunner 5.x-6.2 and Joomla 1.5, 1.6, 1.7, 3.1.
The key to PHPRunner/Joomla integration is to display PHPRunner app in iframe.
[size="6"]Joomla 3.1[/size]
Tested with PHPRunner 6.2. Works with any database type, doesn't have to be MySQL.
1. Create a menu item in Joomla using Wrapper extension
Create a new menu item in Joomla choosing Wrapper as a menu item type. Enter your application URL as a Wrapper URL. Make sure URL points to PHP page i.e. http://localhost/joomla31/carscars_list.php or http://localhost/joomla15/phprunner/menu.php'>http://localhost/joomla15/phprunner/menu.php.
2. Add Joomla sessions support to PHPRunner application
Add the following code to 'After application initialized' event. The only required change is the adjust the path to the folder where Joomla is installed.

define( '_JEXEC', 1 );

define( 'DS', DIRECTORY_SEPARATOR );
// change the following line to point to your Joomla 3.1 installation

define('JPATH_BASE', "c:\\xampp\\htdocs\\joomla31\\" );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );

require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe = JFactory::getApplication('site');

$mainframe->initialise();
$user = JFactory::getUser();
if($user->id)

// log in

{
$_SESSION["UserID"] = $user->get("username");

$groups = $user->get('groups');

$_SESSION["GroupID"] = reset($groups);

$_SESSION["UserName"] = $user->get("name");

if ($user->get('isRoot'))

$_SESSION["AccessLevel"] = ACCESS_LEVEL_ADMINGROUP;

else

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;
}

else

// log out

{

$_SESSION["UserID"] = "";

$_SESSION["AccessLevel"] = "";

$_SESSION["GroupID"] = "";

$_SESSION["UserName"] = "";

}



This is it. Once you are logged in to Joomla you are logged in to PHPRunner application as well.


[size="6"]Joomla 1.5-1.7[/size]
Tested with PHPRunner 5.x-6.x
1. Wrapper extension (com_wrapper).
Copy components/com_wrapper/views/wrapper/tmpl/default.php to templates/<your_template_here>/html/com_wrapper/wrapper/default.php. Default template in Joomla 1.5 is 'rhuk_milkyway' so you need to copy default.php to templates/rhuk_milkyway/html/com_wrapper/wrapper folder.
Modify com_wrapper/views/wrapper/tmpl/default.php the following way (see changes in bold).
We retrieve the current session id and pass it to PHPRunner application via URL.

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

$session = JFactory::getSession();

$sid = $session->getId();


?>
...

name="iframe"

src="<?php echo $this->wrapper->url . "?sessionid=$sid"; ?>"

width="<?php echo $this->params->get( 'width' ); ?>"

...


Once you made this change create a new menu item in Joomla choosing Wrapper as a menu item type. Enter your application URL as a Wrapper URL. Make sure URL points to PHP page i.e. http://localhost/joomla15/phprunner/carscars_list.php or http://localhost/joomla15/phprunner/menu.php'>http://localhost/joomla15/phprunner/menu.php.
It doesn't really matter where PHPRunner application is located, just make sure it uses the same database as Joomla does.
2. Wrapper plugin.
Another approach is to use iframe plugin.
We'll need to implement a similar change in plugins/content/iframe.php file (in Joomla 1.5 file name is plg_iframe.php). See changes in bold.

...

$session = JFactory::getSession();

$sid = $session->getId();

if ($params0['src'])

$params0['src'].="?sessionid=$sid";


if($url !='') {

if(strpos($url,'http://';) === false) $params0['src'] = 'http://';.$url;


Now you can insert the following in any article:

{iframe width="600" height="350" align="top" src="http://localhost:81/joomla17Project/menu.php"; }{/iframe}


You can use any of methods above or even both methods together.
3. Add Joomla sessions support to PHPRunner application
Now we need to make PHPRunner application understand Joomla session id.
Add the following code to 'After application initialized' event. This code snippet assumes that table name prefix is jos_. If your Joomla installation uses another prefix make sure to update jos_session table name accordingly.


$jconn=db_connect();
// Get sessionvariable of Joomla-Session over the URL which passes the Joomla-Wrapper to the iframe

if (@$_GET["sessionid"])

$_SESSION["sessionid"] = @$_GET["sessionid"];
if (@$_SESSION["sessionid"])

{
//Get the values out of the jos-session-table:
$rs=db_query("select * from `jos_session` where session_id='" . $_SESSION["sessionid"]. "'",$jconn);

$data=db_fetch_array($rs);

if($data)

// log in

{

$_SESSION["UserID"] = $data["username"];

$_SESSION["GroupID"] = $data["usertype"];

$_SESSION["UserName"] = $data["username"];

if ($data["gid"]>=24)

$_SESSION["AccessLevel"] = ACCESS_LEVEL_ADMINGROUP;

else

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

}

else

// log out

{

$_SESSION["UserID"] = "";

$_SESSION["AccessLevel"] = "";

$_SESSION["GroupID"] = "";

$_SESSION["UserName"] = "";

}
}


This will logon you to PHPRunner application automatically. It will log out you automatically as well.
If your PHPRunner applications uses advanced security options or AfterSuccessfulLogin event you need to copy some code from login.php to 'After application initialized' event.
Open login.php file in any text editor and find the following section:

if($logged)

{

$_SESSION["UserID"] = $pUsername;

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

$_SESSION["UserName"] = $pUsername;
...
if($myurl)

header("Location: ".$myurl);

else

header("Location: ".$defaulturl);

return;
}


Select and copy everything between $_SESSION["AccessLevel"] = ACCESS_LEVEL_USER; and if($myurl)

Paste it to the end of 'After application initialized' event;
4. Static permissions
You may want to use Joomla's user groups. For this purpose turn on User Group Permissions in PHPRunner and create one or more groups named after Joomla usergroups.
Super Administrator

Administrator

Manager

Publisher

Editor

Author

Registered
5. Further considerations

  • dynamic permissions
    It is possible to make Joomla/PHPRunner work with dynamic permissions though it requires some code changes in PHPRunner. Technically speaking we'll need to modify admin area to read a list of groups from jos_core_acl_aro_groups table and disable 'user management' and 'assign users to groups' pages. We'll implement this in one of the following versions.
    Here is how it looks in action


Update
According to number of votes we received via email here is the list of what we should implement next.
Drupal

Wordpress

Typo3

http://www.cmsmadesimple.org/

xoops.org

X-site Pro 2

http://www.concrete5.org/

redaxo

SPIP

glfusion

R
runey 12/2/2009

Excellent to see a tutorial for integration with Joomla <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=45881&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Something you might want to include though is you do not need to modify the com_wrapper itself... It can be done as a template override... That way you don't have to worry about the mod getting overridden when you update Joomla...
Simply copy components/com_wrapper/views/wrapper/tmpl/default.php to templates/<your_template_here>/html/com_wrapper/wrapper/
Make the changes as described to that file instead of the original... Joomla will use that copy and the original core file can remain unchanged...
Unfortunately I don't think this will work with the plugin option... However since it is not a core Joomla plugin that really shouldn't be a big deal...

admin 12/2/2009

Runey,
thank you, I'll check that and update article accordingly.

B
bfr 12/3/2009



Runey,
thank you, I'll check that and update article accordingly.


Please, PLEASE do a integration module for drupal also!

hichem 12/3/2009

I am a fan of Joomla as well but had to switch to ASPRunner.

Any chance we get a module to integrate with an ASP based open source CMS system? (i.e Umbraco . A full list can be found here http://www.cmsmatrix.org/matrix )
It's great to see CMS features integrated with PHPRunner/ASPRunner and would avoid having to duplicate efforts to build CMS features in ASPR

PHPR/ASPR development team might ne better suited to choose a couple of CMS to integrate to, may be reuse teplates, use CMS access groups like for joomla, integrate to other modules of the CMS etc...

Although it looks like ASPR/PHPR has the potential to become a CMS itself....with much moe features on top
Great effort and thanks Sergey for this article.
Hich

D
dsaunier 12/3/2009

"What is the next CMS we should integrate with?"
Wordpress no doubt ! That would be amazing.

Any other supporters ?
Thanks.

S
salus1DevClub member 12/3/2009

There are a number of iframe plug-ins available which make it very easy to implement PHPRunner or ASPRunner solutions into WodPress sites...

M
mlapl1 12/9/2009

Hello
for new integrations, I suggest drupal (of course) but also glfusion which is very nice indeed.
Cheers

Andrew

K
kharazm 12/16/2009

Thanks you very much for this article .

but I have a question :

you written : Add the following code to 'After application initialized' event.

But I cant find 'After application initialized' event.

Please explain me were is this event and were can I paste that codes.

Best Regards

Kharazm

admin 12/16/2009

You can find it on Events screen in PHPRunner.

B
biotechsun 12/16/2009

Dear Admin

thanks for the joomla integration and we require the advanced security settings, login events etc to be activated through joomla login. can you please explain what code from login.php to be pasted where?

thanks in advance

it will be a real help.

regards

admin 12/30/2009

Open login.php file in any text editor and find the following section:

if($logged)

{

$_SESSION["UserID"] = $pUsername;

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;
...
if($myurl)

header("Location: ".$myurl);

else

header("Location: ".$defaulturl);

return;
}


Select and copy everything between $_SESSION["AccessLevel"] = ACCESS_LEVEL_USER; and if($myurl)

Paste it to the end of 'After application initialized' event;

jwoker 2/2/2010

Putting Moodle on the horizon would be nice.

D
dsaunier 3/19/2010



There are a number of iframe plug-ins available which make it very easy to implement PHPRunner or ASPRunner solutions into WodPress sites...


Hi,

I missed that reply it seems. Did you successfully manage to integrate a phprunner-generated form into a wordpress site, and if so by using which plugin or method exactly ?
Thanks for the help !

E
ejosterberg 3/23/2010



According to number of votes we received via email here is the list of what we should implement next.


I'll add another vote for Drupal!

B
bobdansei 3/26/2010
L
lordkain2 3/26/2010



"What is the next CMS we should integrate with?"
Wordpress no doubt ! That would be amazing.

Any other supporters ?
Thanks.


Wordpress!! Wordpress!! Wordpress!! The #1 Open Souce CMS Wordpress.
Where can I vote?

F
FunkDaddy 4/8/2010

you have my vote for a WordPress integration as well!!!!

500474 4/9/2010



This article explains how to integrate PHPRunner 5.1 with Joomla 1.5.15. It should work the same way with other versions of PHPRunner and Joomla.
The key to PHPRunner/Joomla integration is to display PHPRunner app in iframe. There are at least two ways to do so. We'll walk through both, step by step.
1. Wrapper extension (com_wrapper).
Copy components/com_wrapper/views/wrapper/tmpl/default.php to templates/<your_template_here>/html/com_wrapper/wrapper/default.php. Default template in Joomla 1.5 is 'rhuk_milkyway' so you need to copy default.php to templates/rhuk_milkyway/html/com_wrapper/wrapper folder.

.

.

.

.


Hello. thanks to this tutorial, I could connect joomla(mysql) with my phprunner app(postgres). Now, which I have not been able to do is to take the username (joomla login) and to assign it to a field of a form to avoid that the user must write it again.
Thanks
Mauricio

A
Astrid 10/19/2010

Does anybody have a solution for the following problem? PHP runner now works great with wrapper menu item and wrapper plugin.
But:

Now I have another problem. I'm having another PHP runner project in my Joomla site (calendar). Works with wrapper menu item, but opens current month with some code programming in PHP and this url: /kalender/kalender_list.php?showrecords=maand (where maand is dutch for month).
I discovered that the line:

src="<?php echo $this->wrapper->url . "?sessionid=$sid"; ?>"



in default.php now prevents my calendar from loading the current month. Instead it loads the first page of the list.
As this is a 5.0 project I'm unable to try if adding the code that goes in PHPRunner in "After application initialized" would solve the problem as there is no such function in 5.0. Have already spent a lot of hours trying to convert this project to 5.2, but without success.
Found solution

Changed URL into: /kalender/kalender_list.php?showrecords=maand& and problem is solved.

D
droogers 3/7/2011

Hello,
does anyone know if dynamic permissions is working now when you integrate PHPrunner 5.3 in Joomla 1.5 ?

F
FrankR 5/14/2011

Voting for integration with:
[size="5"]Umbraco[/size]

M
Mwilson91325 5/23/2011

I am using Joomla 1.6 on a godaddy Linux hosting any updates on how Joomla and PHPRunner can use the same login?. I followed th example number one for the wrapper (This would be assume)but looks like joomla 1.6 is deferent. Also i would like not to keep changing it when we do Joomla updates (good point Runey)

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=58479&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

verbi 8/21/2011

Hello,

Any news for PHPRunner and wordpress integration?

admin 8/21/2011
P
pimpid 9/9/2011

I use wrapper extension to login by joomla pass to phprunner

login step is OK

but can not see and edit user data, Ha Ha help me please


...........


.............


...........


..........

admin 9/9/2011

pimpid,
you need to contact support directly with this. Post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

K
kenlyle 9/27/2011

Would the team consider updating this integration for the latest, Joomla 1.7? I believe that the encryption of the passwords has changed.
Thanks!

admin 9/27/2011

Ken,
password encryption method is irrelevant here as we rely on built-in Joomla functionality here.

G
GamezBeCJ 10/8/2011

I've successfully merged PHPRunner with a Joomla wrapper module as it is explained in this post. However, when I added Child Tables to the main table, the child table displays all the child records for each record on the parent table.

I was wondering if anyone has experienced the same issue.

I noticed that the child-master queries rely on GET to pass the reference on which child records to display.

The 'hack' that is needed to login to PHPRunner using Joomla credentials, relies on modifying the URL to pick it up with a GET variable. Would this be overriding the normal PHPRunner mechanisms to pass information through GET?

G
GamezBeCJ 10/8/2011



I've successfully merged PHPRunner with a Joomla wrapper module as it is explained in this post. However, when I added Child Tables to the main table, the child table displays all the child records for each record on the parent table.

I was wondering if anyone has experienced the same issue.

I noticed that the child-master queries rely on GET to pass the reference on which child records to display.

The 'hack' that is needed to login to PHPRunner using Joomla credentials, relies on modifying the URL to pick it up with a GET variable. Would this be overriding the normal PHPRunner mechanisms to pass information through GET?


Please disregard ... I had an error on a custom snippet ...

D
Donald Ackley 1/2/2012



Ken,
password encryption method is irrelevant here as we rely on built-in Joomla functionality here.


However in Joomla 1.7 the gid is no longer used in the user table. would it be possible for someone to update the instructions to link the new Joomla to phprunner?
Thnaks!

-Donald

admin 1/2/2012

Donald,
simple remove the code that relies on "gid" field. This code provides some extra functionality that is totally optional.

D
Donald Ackley 1/3/2012



Donald,
simple remove the code that relies on "gid" field. This code provides some extra functionality that is totally optional.


Thanks for the quick response! I tried commenting out the lines like this:
//Get the values out of the jos-session-table:
$rs=db_query("select * from j17_session where session_id='" . $_SESSION["sessionid"]. "'",$jconn);

$data=db_fetch_array($rs);

if($data)

// log in

{

$_SESSION["UserID"] = $data["username"];

$_SESSION["GroupID"] = $data["usertype"];

// if ($data["gid"]>=24)

// $_SESSION["AccessLevel"] = ACCESS_LEVEL_ADMINGROUP;

// else

// $_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

}

else

// log out

{

$_SESSION["UserID"] = "";

$_SESSION["AccessLevel"] = "";

$_SESSION["GroupID"] = "";

}
}
// Place event code here.

// Use "Add Action" button to add code snippets.
But it did not make a difference. I still end up with: You don't have permissions to access this table Back to login page. Should there be a replacement line for the $_SESSION["AccessLevel"] = ACCESS_LEVEL_USER; ?
-Donald

admin 1/4/2012

Donald,
uncomment the following line:

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;
Another option - simply leave original code as is.

K
kenny_robb 5/21/2013

I had this solution working wonderfully well up to the point that Joomla upgraded to v2.5 and the DB schema and how the session data was stored changed. usertype is no longer stored in a separate field, instead there is a lot of data stored in the "data" field. Anyone got any ideas how to make this work for Joomla 2.5?

admin 5/22/2013

Show us an example of what is stored in data field - probably I can suggest something.

K
kenny_robb 5/22/2013

Table still Has Session_id, Client_id, guest, time, data, userid, username and usertype
There is nothing in usertype however there is a load of stuff in the data field which has data type of mediumtext
__default|a:9:{s:15:"session.counter";i:12;s:19:"session.timer.start";i:1369246235;s:18:"session.timer.last";i:1369246683;s:17:"session.timer.now";i:1369246778;s:22:"session.client.browser";s:71:"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)";s:8:"registry";O:9:"JRegistry":1:{s:7:"data";O:8:"stdClass":0:{}}s:4:"user";O:5:"JUser":26:{s:9:"isRoot";b:1;s:2:"id";s:3:"342";s:4:"name";s:16:"Merlin Ambrosius";s:8:"username";s:16:"Bob Smith";s:5:"email";s:25:"bobsmith@@bobsmith.com";s:8:"password";s:65:"456ccf78f08a2e6c0553a411e2426fa0:cTEghygQKdlWvfUab3Sm6TaIlWT94ULK";s:14:"password_clear";s:0:"";s:8:"usertype";s:19:"Registered";s:5:"block";s:1:"0";s:9:"sendEmail";s:1:"1";s:12:"registerDate";s:19:"2012-12-20 16:52:30";s:13:"lastvisitDate";s:19:"2013-05-22 17:37:14";s:10:"activation";s:0:"";s:6:"params";s:116:"{"admin_language":"en-GB","language":"en-GB","editor":"","helpsite":"","timezone":"Europe\/London","admin_style":""}";s:6:"groups";a:2:{i:8;s:1:"8";i:16;s:2:"16";}s:5:"guest";i:0;s:13:"lastResetTime";s:19:"0000-00-00 00:00:00";s:10:"resetCount";s:1:"0";s:10:"_params";O:9:"JRegistry":1:{s:7:"data";O:8:"stdClass":6:{s:14:"admin_language";s:5:"en-GB";s:8:"language";s:5:"en-GB";s:6:"editor";s:0:"";s:8:"helpsite";s:0:"";s:8:"timezone";s:13:"Europe/London";s:11:"admin_style";s:0:"";}}s:14:"_authGroups";a:6:{i:0;i:1;i:1;i:8;i:3;i:13;i:4;i:14;i:5;i:15;i:6;i:16;}s:14:"_authLevels";a:4:{i:0;i:1;i:1;i:1;i:2;i:2;i:3;i:3;}s:15:"_authActions";N;s:12:"_errorMsg";N;s:10:"*_errors";a:0:{}s:3:"aid";i:0;s:3:"gid";s:2:"25";}s:13:"session.token";s:32:"29b7ec443d0ca02bef2aede6643dc347";s:16:"com_mailto.links";a:1:{s:40:"5c6f8ef73a21e0ae40c2d6cd8d4b0ca59b60313a";O:8:"stdClass":2:{s:4:"link";s:51:"http://bobsmith.com/index.php/2013-04-28-16-21-13";s:6:"expiry";i:1369246778;}}}

K
kenny_robb 6/3/2013

Went for a slightly different approach to get what I needed. Used the original code above and then simply did another query on other tables to get the information I needed using the uid that was in the session table.
Set some Session Variables and all was well again. It was not quite a simple as using the jos_users table as the usertype is no longer held there and is a combination of users group and joing tables.

admin 6/7/2013

kenny_rob,
thank you for the update. I'll revisit my tutorial to work with the latest version of Joomla as soon as I have time.
It appears that they store the whole PHP session info there now however I'm not able to decode it yet. I'll try a few other things.

M
mmponline 6/14/2013

This integration is very helpful and I've used it with success. The main issue is still the Iframe. As most of you know, the Iframe does not work properly for search engine indexing. When a page is listed in Ex. Google and one clicks on it, it will open the PHPRunner page in a page with out the headers and footers and look of the page as it is shown in the page where the file is in the Iframe.
The only solutions ( I think) would be a component or module written for Joomla where the PHPrunner development is inserted in the module or component and when the page displays on the page, the address bar would show the actual path to the PHP runner files. This should be possible as we have several modules and components where the development shows as part of the Joomla look and feel (integrated) but the path in the address bar shows the actual link to the file or page. The Google searches thus show the development as part of the joomla look and feel (integrated). A good example of this would be the Joomgallery used for showing a photo gallery. Eg here: http://lebonevillage.com/galleries/gallery/add-hope-and-riaan-manser-visit-to-lebone-village/add-hope-1-48.html
I wish I had the knowledge to develop such a module or plugin, but I don't have. I'm even willing to contribute to the developer of this, as we have several sites where Joomla and PHPrunner needs integration. I'm sure it's possible and the auto login could most probably be integrated as well.

S
simonedan 6/18/2013

Which php file is it exactly where

2. Add Joomla sessions support to PHPRunner application

is to be applied considering Joomla 3.1 and RUNNER 6.2 ?

admin 6/19/2013

simonedaniele,
I've updated the tutorial. This code goes to AfterAppInit event.

O
oermops 7/2/2013

I may be missing something but I just tried the code above and PHPRunner isn't logging in automatically. All I can get after logging into Joomla is the PHPRunner login screen. I may have the Joomla and PHPRunner paths incorrect. I am using http://www.abc.com/joomla31 as the format for the Joomla path and www.abc.com/phprunner/menu.php as the PHPRunner path. Is there anything else missing?

J
jdu001 10/30/2013

PHPRunner 6.2 and Joomla! 3.0.3

I followed the instructions and PHPRunner isn't logging in automatically. I get the following message:

Warning: require_once(/domains/mySite.nl/htdocs/myJoomlaSite/includes/defines.php):

failed to open stream: No such file or directory in /home/vhosting/h/vhost/domains/mySite.nl/htdocs/www/myPHPRunnerSite/include/appsettings.php'>mySite.nl/htdocs/www/myPHPRunnerSite/include/appsettings.php on line 396

Fatal error: require_once(): Failed opening required '/domains/mySite.nl/htdocs/myJoomlaSite/includes/defines.php'

(include_path='.:/usr/share/php:/usr/share/pear') in /home/vhosting/h/vhost/domains/mySite.nl/htdocs/www/myPHPRunnerSite/include/appsettings.php'>mySite.nl/htdocs/www/myPHPRunnerSite/include/appsettings.php on line 396
I have my Joomla path defined as:

// change the following line to point to your Joomla 3.1 installation

define('JPATH_BASE', "/domains/mySite.nl/htdocs/myJoomlaSite"; );
What must I change to get PHPRunner working properly.
Kind regards,
Jo van Duin

admin 10/31/2013

It might be the problem with the fact you trying to apply Joomla 3.1 tutorial to Joomla 3.0.3 installation. It looks like it's trying to find defines.php file and not able to do so.

A
angelcause 11/28/2013

I am using PHPRunner 6.2 and Joomla 3.1.1 Stable, I have added the below given code in the Wrapper menu but I am getting a error as below :
Fatal error: Access denied for user ''@'localhost' to database 'req_vehicle' in C:\xampp2\htdocs\portal\vrequest\include\dbconnection.my.mysqli.php on line 16

define( '_JEXEC', 1 );

define( 'DS', DIRECTORY_SEPARATOR );
// change the following line to point to your Joomla 3.1 installation

define('JPATH_BASE', "c:\\xampp\\htdocs\\joomla31\\" );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );

require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe = JFactory::getApplication('site');

$mainframe->initialise();
$user = JFactory::getUser();
if($user->id)

// log in

{
$_SESSION["UserID"] = $user->get("username");

$groups = $user->get('groups');

$_SESSION["GroupID"] = reset($groups);

$_SESSION["UserName"] = $user->get("name");

if ($user->get('isRoot'))

$_SESSION["AccessLevel"] = ACCESS_LEVEL_ADMINGROUP;

else

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;
}

else

// log out

{

$_SESSION["UserID"] = "";

$_SESSION["AccessLevel"] = "";

$_SESSION["GroupID"] = "";

$_SESSION["UserName"] = "";

}
K
kenny_robb 1/1/2015

I have just upgraded my Joomla Site from 2.5x to 3.3.6
I had all the integration working before and I thought it would be simple.
I too am getting the same error when I try and integrate.
Fatal Error. Access Denied for JUSER@ localhost......etc,etc
Using v7.1 Build 20347 but will try V8 as well and see what happens

K
kenny_robb 1/1/2015

Ok the good news is that I rebuilt the project using V8 and cleared out the upload directory and uploaded all the files and it seems to be working.
Bad news is that the permissions have not taken.
I have a number of groups setup in User group Permissions. When I connect (and I am setup as an admin) I get the default permissions and are therefor missing functionality.
I have 8 levels of permissions so it would be really handy to have this working.
Thanks

U
ustunsoz 4/27/2018

I am using Joomla 3.8.7 and successfully implemented as per the instruction.
However, when phprunner application running in the wrapper, every page giving following warning inside the phprunner app :
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /home/coolhote/public_html/property/libraries/joomla/session/handler/joomla.php on line 48
Can you please help to solve this issue
It is live site you can see the error on link: https://custodian.com.tr/en/manager