I've just created my own module and it's working fine. I've also installed Front-End-Users. In my own-made module, I need the userid (or username) who is logged on. Which piece of php-code should I use to get the current userid ?
Bart
FEU - get user id
Re: FEU - get user id
IIRC is there a box in the settings of FEU, with either {name} or {username}. Check the settings of FEU, and see what is defaulted in on of the option-boxes.
Ronny
Ronny
Re: FEU - get user id
Thank you, but I think you misunderstood the question. I need the piece of php-code to get the current user who is logged on.
Re: FEU - get user id
Look to the feu code.. the function you want to call is in the FrontEndUsers.api.php (to witch you can call much more too) and is called LoggedInId() from there you can grab the user name well anything.. hope this helps
Cheers
Jeremy
Cheers
Jeremy
Re: FEU - get user id
Thanks for the info. I've been trying, but I can't make it work.
In my custom-made-module I use this code :
require_once($_SERVER["DOCUMENT_ROOT"] . "/modules/FrontEndUsers/FrontEndUsers.api.php" );
echo "your user id is : " . FrontEndUsersManipulator::LoggedInId();
But I get the error : Call to undefined method MyModule::ExpireUsers()
Could you give me some sample code to get me started ?
Thanks
Bart
In my custom-made-module I use this code :
require_once($_SERVER["DOCUMENT_ROOT"] . "/modules/FrontEndUsers/FrontEndUsers.api.php" );
echo "your user id is : " . FrontEndUsersManipulator::LoggedInId();
But I get the error : Call to undefined method MyModule::ExpireUsers()
Could you give me some sample code to get me started ?
Thanks
Bart
Re: FEU - get user id
$feusers =& $mymodule_obj->GetModuleInstance('FrontEndUsers');
if( $feusers )
{
$userid = $feusers->LoggedInID();
}
replace $mymodule_obj with your module obj name.
if( $feusers )
{
$userid = $feusers->LoggedInID();
}
replace $mymodule_obj with your module obj name.
Re: FEU - get user id
Thanks ! That's wat I need.