php - Joomla JUser return 0 -


hi (sorry bad english :c) have trouble in code. there 2 versions of site in web - dev , main. both use php 5.4 , have 1 host provider. in dev site work , on main - not. problem i'm use xmlhttprequest send ajax requests php file, included in start other file (head of ajax controller). here source of (last) file :

<?php  define( '_jexec', 1 ); define('jpath_base', dirname(__file__).'/../../../../../' ); define( 'ds', directory_separator );   require_once ( jpath_base .ds.'includes'.ds.'defines.php' ); require_once ( jpath_base .ds.'includes'.ds.'framework.php' );  jfactory::getapplication('site')->initialise (); $user = jfactory::getsession()->get( 'user' ); $___temp_user =& jfactory::getuser(); $user_id = $___temp_user->get('id'); 

but, how said, on main $___temp_user return 0; (im loggined in) please, tell me why happen.

(joomla 1.5.9)

this code

define('jpath_base', dirname(__file__).'/../../../../../' ); 

should not same both sites.

doubly check path or

var_dump(jpath_base); exit; 

you can give hardcoded path of joomla installation like

define('jpath_base', '/var/www/joomla' ); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -