Custom User Group DONE, but Menu Item NOT APPEARING

Your code modifications and patches you want to share with others.
jozo2008
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Apr 12, 2010 7:28 am

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by jozo2008 » Mon Apr 12, 2010 6:00 pm

Well, I'm using 1.5.15, but the same thing happenes. Dhvani, it seems the only hope for us is Murfix. I hope he'll come back here soon and continue with helping us. I was just thinking what happened with jjj2, who started this theme. He didn't post anything since December, maybe he solved the problem.

dhvani
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Mon Dec 21, 2009 1:09 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by dhvani » Tue Apr 13, 2010 4:38 am

I tried with 1.5.15 also. I think you are right only murfix can help. But its very big hope as he has only one post in joomla history. I think he is not regular and not much interested. :(

moomerz
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Apr 20, 2010 3:31 am

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by moomerz » Mon Apr 26, 2010 12:26 am

This is really frustrating... I don't get how Joomla! got this far (1.5 that is) without realizing the value of custom user groups. :(

On the bright side I think JanisU was onto something.

As you can see, even the developers knew some fudging was being done...

Code: Select all

// Fudge Authors, Editors, Publishers and Super Administrators into the special access group 
		if ($acl->is_group_child_of($grp->name, 'Registered')      ||
		    $acl->is_group_child_of($grp->name, 'Public Backend'))    {
			$instance->set('aid', 2);
		}
I just added further elseif-clauses after this code segment to test for my custom groups and assign the proper aid.

For my particular groups I haxed it in in this way: /plugins/user/joomla.php

Code: Select all

		if ($acl->is_group_child_of($grp->name, 'Registered')      ||
		    $acl->is_group_child_of($grp->name, 'Public Backend'))    {
			$instance->set('aid', 2);
		}
		if ($grp->name == 'Sub-Member') {$instance->set('aid', 3);}
		if ($grp->name == 'Full Member') {$instance->set('aid', 4);}
		if ($grp->name == 'Super Administrator') {$instance->set('aid', 4);}
It's a very crude hack, but the important thing is it works.

Don't try to test this without logging out and logging back in to the Front End every time you change the files or database.

dhvani
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Mon Dec 21, 2009 1:09 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by dhvani » Tue Apr 27, 2010 5:37 am

hi moomerz,

Sorry but your hack do not works for me.
I am still facing the problem that if one group of mine has the aid 3 and other has 4.
Than when I logged in with the user of group having aid 4 , i got menu items of group having aid 3.

But when I logged in with the user of group having aid 3 i got menu items of that group only.

so it works when you have only one extra user group but when we have multiple groups of users it is not working. :(

moomerz
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Apr 20, 2010 3:31 am

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by moomerz » Mon May 03, 2010 2:27 am

It works for me for the 3 custom groups I defined. Make sure to hard-code the hack properly; the aid you assign via "$instance->set" should be the right aid and it should correspond to the value you put into the database for that group.

However one thing about Joomla! that you can't change, is that groups with higher aid will always see menu items and content meant for groups with lower aid. That's just a Joomla! problem that the team has to fix for us in 1.6.

A comprehensive, cascading permissions system like there is in PHPBB is just too much for a simple hack or mod to create for Joomla!.

dhvani
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Mon Dec 21, 2009 1:09 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by dhvani » Mon May 03, 2010 10:52 am

Yes this is my problem that i wants to have different menus for higher aid group and lower aid group. I dont want to show the content of lower aid to higher aid one.

dhvani
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Mon Dec 21, 2009 1:09 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by dhvani » Tue May 18, 2010 4:50 am

Hi all,

I like to know is there any component available for this?

sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by sp1d3r » Thu Aug 26, 2010 8:23 pm

I would like to have a follow up on this as I am in need of adding a new group. I googled and found http://docs.joomla.org/Custom_user_groups and this forum topic.

My setup
Joomla 1.5.20
PHP 5.2.8

I followed the instructions from the Joomla doc but when running the php script I get

"Parse error: parse error in ...\rebuild.php on line 49"

Line 49 is the last line with the "?>"

Not sure why...

Also when I go into the User Manager I do not see my new group.

Please help.

Update:

I just installed noixACL and I was able to add my new group buuuut still couldn't add that group to the jos_group list, check box was grayed out, so I added it manually to the database.

I went to the module I wanted to restrict to the new group and tested it with the user I gave added to the group. Nothing happened.

All I want to do is restrict access to menu items. I have both registered and authors but I need a third group...

Nightslyr
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Apr 26, 2006 6:35 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by Nightslyr » Thu Sep 23, 2010 4:34 pm

I'd like to add custom user groups myself, but am now a bit daunted about the prospects of getting it to work. I think part of the problem is that the documentation on the wiki simply isn't clear about what to do. Changing the code on line 113 is the easy part. The rest is muddled and confusing.

To whoever writes the documentation: don't assume your readers know the system. Write out all the steps, even the stuff that may be painfully obvious to you.

geewiz
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Oct 06, 2010 5:28 am

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by geewiz » Wed Oct 06, 2010 5:32 am

moomerz wrote:This is really frustrating... I don't get how Joomla! got this far (1.5 that is) without realizing the value of custom user groups. :(

On the bright side I think JanisU was onto something.

As you can see, even the developers knew some fudging was being done...

Code: Select all

// Fudge Authors, Editors, Publishers and Super Administrators into the special access group 
		if ($acl->is_group_child_of($grp->name, 'Registered')      ||
		    $acl->is_group_child_of($grp->name, 'Public Backend'))    {
			$instance->set('aid', 2);
		}
I just added further elseif-clauses after this code segment to test for my custom groups and assign the proper aid.

For my particular groups I haxed it in in this way: /plugins/user/joomla.php

Code: Select all

		if ($acl->is_group_child_of($grp->name, 'Registered')      ||
		    $acl->is_group_child_of($grp->name, 'Public Backend'))    {
			$instance->set('aid', 2);
		}
		if ($grp->name == 'Sub-Member') {$instance->set('aid', 3);}
		if ($grp->name == 'Full Member') {$instance->set('aid', 4);}
		if ($grp->name == 'Super Administrator') {$instance->set('aid', 4);}
It's a very crude hack, but the important thing is it works.

Don't try to test this without logging out and logging back in to the Front End every time you change the files or database.
This works for me..thank you ;-)

dhvani
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Mon Dec 21, 2009 1:09 pm

Re: Custom User Group DONE, but Menu Item NOT APPEARING

Post by dhvani » Wed Oct 06, 2010 5:43 am

Hi geewiz,

Yes this is working but the problem is when you assign something specific to the user groups having aid 4 the users with higher authority means aid 5 will get that specifications of user group 4 too.

Thanks,
Dhvani


Locked

Return to “Core Hacks and Patches”