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?
FrontEndUsers... total Newbie
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: FrontEndUsers... total Newbie
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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: FrontEndUsers... total Newbie
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?
IF they are NOT logged in, they would be redirected to a some other page.
Does that make sense?
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: FrontEndUsers... total Newbie
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 */
}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: FrontEndUsers... total Newbie
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.
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.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: FrontEndUsers... total Newbie
oh yeah, I didn't pay attention:
$feusers = $gCms->modules['FrontEndUsers']['object'];
$feusers = $gCms->modules['FrontEndUsers']['object'];
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: FrontEndUsers... total Newbie
If you mean that :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?
-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.