Page 1 of 1
FrontEndUsers... total Newbie
Posted: Tue Feb 27, 2007 10:42 pm
by rnelson0
It's the stereotypical, bad development situation. Basically I've been handed this project without knowing much about CMSMS or FrontEndUsers. And of course... there is a short turn around time.
Anyway, I am trying to make a custom user defined Tag that will check if a front end user is logged in or not and based on that, redirect them to a different page. My problem is, I can't even figure out how to get the log in status of a FrontEnd User. I've been up and down this site looking at documentation, and the examples I've tried are not working.
The best example on this site I've found looked like this
global $gCms;
$feuClass = $gCms->modules['moduleName']['object'];
but even using that didn't work properly. I think I just don't know CMSMS well enough. Can anyone help and maybe give examples of how to check if a user is logged in or not?
Re: FrontEndUsers... total Newbie
Posted: Tue Feb 27, 2007 10:45 pm
by calguy1000
You don't need a user defined tag. In the preferences tab of the FrontendUsers module there's a field where you can put a pageid/alias to redirect to after login.
Re: FrontEndUsers... total Newbie
Posted: Tue Feb 27, 2007 10:57 pm
by rnelson0
Thats not what I'm trying to accomplish. Let me give a perspective from the user. A user (who maybe logged in or may not be logged in via FrontEnd Users) will click on a link to certain page made with CMSMS. Ideally, that page would just be my script that would first check if the current user is logged in Via CMSMS... if they are logged in, I would get the userID and retrieve some of their info and redirect them to an ecom system outside of CMSMS.
IF they are NOT logged in, they would be redirected to a some other page.
Does that make sense?
Re: FrontEndUsers... total Newbie
Posted: Tue Feb 27, 2007 11:31 pm
by calguy1000
Code: Select all
$logginid = '';
global $gCms;
$feuClass = $gCms->modules['moduleName']['object'];
if( is_object( $feuClass ) )
{
/* From FrontEndUsers.api.php */
$logginid = $feuClass->LoggedInID();
}
if( $loginid == '' )
{
/* not logged in */
}
else
{
/* logged in */
}
Re: FrontEndUsers... total Newbie
Posted: Tue Feb 27, 2007 11:49 pm
by rnelson0
Thank you for you patience with me as I am just learning all this CMS and FEU stuff today. I used the example you posted below and added a coupl echo statments in the if..else clause. Even though I am logged in with via FEU, its returns as not logged in. Basically I've run into the same problem that made me post this. I tried using the FrontEndUsers.api.php, but it never worked for me.
Am I supposed to change the follwing? What am I supposed to put for moduleName and object?
$gCms->modules['moduleName']['object'];
Once again. Thank you fro your patience.
Re: FrontEndUsers... total Newbie
Posted: Wed Feb 28, 2007 12:23 am
by calguy1000
oh yeah, I didn't pay attention:
$feusers = $gCms->modules['FrontEndUsers']['object'];
Re: FrontEndUsers... total Newbie
Posted: Wed Feb 28, 2007 11:56 am
by Pierre M.
rnelson0 wrote:
... if they are logged in, I would get the userID and retrieve some of their info and redirect them to an ecom system outside of CMSMS.
...Does that make sense?
If you mean that :
-you are aiming at single sign on,
-you are using CMSms as an e-id management system,
-the "ecom system outside of CMSMS" has its own login protection,
then I'm sorry to say it sounds nonsense to me. Because :
-CMSms is not (yet?) a e-id MS nor a SSO solution,
-I'm fearing your "ecom system outside of CMSMS"' protection is weakened because you are building a way of bypassing it.
ecom needs strong security. You should authenticate your users in the ecom system.
I'm feeling your are messing ecom site building and blogging site building.
May be you can use an LDAP directory has a shared e-id MS ? There are LDAP hints in the last 50 days in the forums.
Pierre M.