php page called from Joomla menu unable to capture logged in user info -


we have application running in joomla . there menu option 'my data' - on clicking open php page in iframe . in target php want capture current logged in user details facing problem.

we have used jfactory::getuser() not showing . although if specific id passed parameter getuser id's details coming . pfb code . can please us. in advance .

/*******start of code*********/  define('_jexec', 1);  define('ds', directory_separator);  if (file_exists(dirname(__file__) . '/defines.php')) {      include_once dirname(__file__) . '/defines.php'; }  if (!defined('_jdefines')) {      define('jpath_base', dirname(__file__));      require_once jpath_base.'/includes/defines.php';  }  require_once jpath_base.'/includes/framework.php';  $app = jfactory::getapplication('site');  $app->initialise();  $user =& jfactory::getuser();  echo 'user name: ' . $user->username . '<br />'; echo 'real name: ' . $user->name . '<br />';  $specificuser =& jfactory::getuser(403);  echo 'specific user name: ' . $specificuser->username . '<br />'; echo 'specific real name: ' . $specificuser->name . '<br />';  /******eof code********/ 

instead of approach reloads joomla framework inspect session object, dump joomla in debug mode:

session __default     session.counter ⇒ 13     session.timer.start ⇒ 1363124213     session.timer.last ⇒ 1363162265     session.timer.now ⇒ 1363162286     session.client.browser ⇒ mozilla/5.0 (windows nt 6.1; wow64; rv:19.0) gecko/20100101 firefox/19.0     registry ⇒ {}         user             id ⇒ 0             name ⇒             username ⇒  

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -