Page 1 of 1
[solved] Groups within FEU and customContent, and secure pages
Posted: Wed Jul 22, 2009 8:22 am
by lampsie
Hi,
I'm trying to see if there is a nice streamlined way to do this:
In FEU I have set up a number of 'groups'...what I want to acheive is that when a user logs in, the login box will check which group the user belongs to, and then redirect them to a particular page on the site.
Is this possible to do?
Thanks,
lamps
Re: Groups within FEU and customContent, and secure pages
Posted: Wed Jul 22, 2009 12:06 pm
by NaN
With an UDT and the eventmanager it should be possible.
Since i don't know what parameters the FEU Module is passing to the eventmanager if a user logs in (maybe Calguy can tell you) i would do a test first.
Try this:
Create a UDT called "test".
Insert this Code:
Code: Select all
echo '<pre>';
print_r($params);
echo '</pre>';
Subscribe this UDT to the FEU login event ("Extensions->Eventmanager").
Login to your frontend and view the result.
There might be something like Array( index => value ).
If there is the groupid or groupname you can try this UDT (example - it won't work yet):
Code: Select all
global $gCms;
$manager =& $gCms->GetHierarchyManager();
$page_alias = "home";
switch($params['group']) {
case "Group A": $page_alias = "group_a";
case "Group B": $page_alias = "group_b";
case "Group C": $page_alias = "group_c";
...
}
$node =& $manager->sureGetNodeByAlias($page_alias);
$content =& $node->GetContent();
if (isset($content) && is_object($content))
{
if ($content->GetURL() != '')
{
redirect($content->GetURL());
}
}
else return '<!-- redirect udt - page not found: '.$page_alias.' -->';
(adapted from here:
http://wiki.cmsmadesimple.org/index.php ... direct_UDT)
Re: Groups within FEU and customContent, and secure pages
Posted: Wed Jul 22, 2009 1:53 pm
by seensite
Re: Groups within FEU and customContent, and secure pages
Posted: Wed Jul 22, 2009 5:28 pm
by jmcgin51
this is a default feature of FEU. Check the Preferences tab. You can redirect based on username or usergroup
Re: Groups within FEU and customContent, and secure pages
Posted: Thu Jul 23, 2009 7:47 am
by lampsie
Hi all,
Thank you all for the replies, each useful in their own way for other stuff I'm doing too! As I go into preferences, I can see now where to do this (enter "{group}" into the login redirect)...as it happens, all my users are only in one group, so this works well for me
Thanks,
Lamps