Page 1 of 1

How to get a logged in user ID from FEU in external php file

Posted: Thu Mar 24, 2016 4:07 pm
by boddhisattva
I am using CMSms 2.1.1 with the FEU module installed. I have a php file in my root directory in which I want to read the User ID of the logged in user. I tried this:

Code: Select all

$feusers = cms_utils::get_module('FrontEndUsers');
$user_id = $feusers->LoggedInId();


...but that didn't work. Could anybody help me with this?

Thanks in advance.

Re: How to get a logged in user ID from FEU in external php

Posted: Thu Mar 24, 2016 5:16 pm
by Rinker
How and where do you call this file?

I don't know what this file do but I think you better can make a plugin of it and put it in the plugin dir or add the code in a UDT if it is not that big.

Re: How to get a logged in user ID from FEU in external php

Posted: Thu Jun 16, 2016 6:31 pm
by magallo
I have the same issue,

Code: Select all

include($_SERVER['DOCUMENT_ROOT'].'/lib/include.php');
$gCms = CmsApp::get_instance();
$feu =& $gCms->GetModuleInstance('FrontEndUsers');
$uid = $feu->LoggedInId();
nothing comes up. Can anyone help?
Thanks