Hello,
I'm trying to display a form inside an article only for a specific user group. I currently came up with these two alternatives on how to display the form:
1. I could use the {chronoforms} tags inside the article. I don't see an option to restrict the access in the form editor though. Is there a way?
2. I could use php inside the article. My code currently looks like this:
I found the following code snippet in this link https://www.chronoengine.com/forums/posts/f2/t99179.html
But just like the user in that other thread I am getting just a blank page. Can you help me solve this?
I'm trying to display a form inside an article only for a specific user group. I currently came up with these two alternatives on how to display the form:
1. I could use the {chronoforms} tags inside the article. I don't see an option to restrict the access in the form editor though. Is there a way?
2. I could use php inside the article. My code currently looks like this:
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
$user = JFactory::getUser();
$groups = JUserHelper::getUserGroups($user->id);
if(in_array(10, $groups)){
// SHOW FORM HERE
} elseif(in_array(11, $groups)) {
$output .= "<a style='float:right;' onclick='return confirm(\"Do you really want to leave your clan?\");' href='components/com_joodb/plugins/leave.php'><img src='images/exit.png' align='center' border='10' alt=''> Leave Clan...</a>";
}
?>
I found the following code snippet in this link https://www.chronoengine.com/forums/posts/f2/t99179.html
jimport('cegcore.joomla_gcloader');
ob_start();
$output = new JoomlaGCLoader('front', 'chronoforms5', 'chronoforms', array("chronoform" => "FORM_NAME"), array('controller' => '', 'action' => ''));
$return = ob_get_clean();
echo $return;
But just like the user in that other thread I am getting just a blank page. Can you help me solve this?
Hi Moh-Aw,
Please try using an Authenticator action from the Security Actions Group in the form On Load event.
In the On Success event add the HTML (Render form) action and in the On Fail event add a Display Message action.
Not tested but I think that should work OK. Setting the Group permissions can be tricky - Max has written a bit about it in this ChronoForums FAQ.
Bob
Please try using an Authenticator action from the Security Actions Group in the form On Load event.
In the On Success event add the HTML (Render form) action and in the On Fail event add a Display Message action.
Not tested but I think that should work OK. Setting the Group permissions can be tricky - Max has written a bit about it in this ChronoForums FAQ.
Bob
Hi GreyHead,
Hi Max,
Thanks a lot for Chonoforms !
I'm tryng to use Athentificator with parameters like Max offers here : http://www.chronoengine.com/component/chronoforums/posts/f2/t95208.html
Unfortunately that doesn't work : if I put "no set" to Public, everybody can access the form.
If I put "denied", nobody can read it even super users.
I don't understand.
Please help me !
Sten
Hi Max,
Thanks a lot for Chonoforms !
I'm tryng to use Athentificator with parameters like Max offers here : http://www.chronoengine.com/component/chronoforums/posts/f2/t95208.html
Unfortunately that doesn't work : if I put "no set" to Public, everybody can access the form.
If I put "denied", nobody can read it even super users.
I don't understand.
Please help me !
Sten
Hi Sten,
Please set Public to 'Allowed' - Public here is not really Public, it is the root User Group and if that is Not Set or Denied then all other groups are as well.
To block Guests set Guest to Denied, then other groups as needed - but check in the User Group tree - if you set a Group to Denied, then all sub groups will be Denied as well.
Bob
Please set Public to 'Allowed' - Public here is not really Public, it is the root User Group and if that is Not Set or Denied then all other groups are as well.
To block Guests set Guest to Denied, then other groups as needed - but check in the User Group tree - if you set a Group to Denied, then all sub groups will be Denied as well.
Bob
This topic is locked and no more replies can be posted.