Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

metamodpro with Juga Groups

metamodpro with Juga Groups

Hi, thanks for a very wonderful extension. My case is this: I am trying to allow users from a juga group see a certain module and only when they are logged in. So for instance, say I have three juga groups user1, user2 and user3 and I want them to see module 50, when logged in and if someone is not a member of any of these three groups, to see module 60 when logged in. Juga does not add user groups to joomla core acl.
Here is what I tried:
if ( $user->usertype == "user1"  or $user->usertype == "user2" or $user->usertype == "user3" ) return 50; else return 60;

I'm not sure what I'm doing wrong, but it always returns module id 60 and completely ignores what is before it. I would really appreciate your help on this as I have been on this for the last couple of days and the site is already live.

Thank you so much!
Tee

eyilara
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: metamodpro with Juga Groups

Hi Tee,

I see that on the JUGA site they mention mod_hiddenbyjuga which is supposed to do what you're asking for. Have you tried that?

If you really do want to use MetaMod (perhaps so that you can use the Pro features), could you please send me a copy of mod_hiddenbyjuga so that I can use the same logic for retrieving the user group info?

I'll PM you with my e-mail address.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: metamodpro with Juga Groups

Just sent it. Thank you so much!

eyilara
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: metamodpro with Juga Groups

Thanks for that - now try this. I haven't tested it but I think it will work. You need to have mod_hiddenbyjuga installed because it uses the logic in that module to control MetaMod:


// customise the following, as a comma-separated list
// of JUGA group names, as you would have typed them
// into mod_hiddenbyjuga. I think you can prefix a
// group name with "!" to exclude that group.
$groups = "Public Access, Administrator";

// customise the list of modules to display if the user
// is in one of the groups above (replace XXX, YYY with
// a comma-separated list of module ids)
$modules = "XXX, YYY";

///////////////////////////////
// should not need to edit below here
///////////////////////////////
require_once( JPATH_BASE . DS . 'modules' . DS . 'mod_hiddenbyjuga' . DS . 'helper.php');
$items = explode(",", trim($groups));
$success = false;
// if any of the statements is true, trigger modules
for ($i=0; $i<count($items) && !$success; $i++) {
  $item = $items[$i];
  $success = modHiddenByJugaHelper::_isTrue( $item );
}
if ($success) return $modules;



I hope that works! I think it should...
Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: metamodpro with Juga Groups

Wow it works perfectly! Thank you so much. I really need to learn PHP smile
I have just one more question, how can i show a different module if a user is not among one of the listed groups?

eyilara
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: metamodpro with Juga Groups

Please disregard the last message. I figured it out and got everything working perfectly. Thank you so much Stephen. God bless you!

eyilara
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10772
Newest User:
alton29318
Members Online:
0
Guests Online:
119

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked