Skip to Content Skip to Menu

Wrong Itemid for editProfile with Customer Group

  • Piszi
  • Piszi
  • OFFLINE
  • Posts: 5
  • Thanks: 1
  • Karma: 0
13 years 4 weeks ago #178110 by Piszi
Hello,

I just saw that my Customer Group can't edit profile becouse the Itemid changes if clicking on editprofile

I have a MainMenu item for CB profile page which has the 783 as Itemid with Customer Access Level restriction but if I click on the profile edit it changes to 748

748 is also a CB profile page link but it is for the registred group

Is there any way to resolve this?
Maybe override Itemid in the cb.menu.php with something like this

if(usergroup == X) {
$Itemid = 783;
}

It looks simple but i don't know how to get usergroup in the cb.menu.php

Please Log in or Create an account to join the conversation.

  • Piszi
  • Piszi
  • OFFLINE
  • Posts: 5
  • Thanks: 1
  • Karma: 0
13 years 3 weeks ago #178789 by Piszi
Hello,

Partly I managed to handle this problem.
First I did some mod in the cb.menu.php
Code:
$userthings = & JFactory::getUser(); $usrfuuu = $userthings->groups; if($usrfuuu['Author'] == 3) { $Itemid = "333"; } else { $Itemid = getCBprofileItemid( 0 ); }

Than in comprofiler.html.php I created a function and replaced all getCBprofileItemid(true) with mine
Code:
function myItemid() { $userthings2 = & JFactory::getUser(); $usrfuuu2 = $userthings2->groups; if($usrfuuu2['Author'] == 3) { $myitem2 = "&Itemid=333"; } else { $myitem2 = getCBprofileItemid(true); } return $myitem2; }

This is almost good but when I hit Save button it still redirects to the wrong url and I don't know where to change that.
The form's post URL is good it has the correct Itemid.

Please help me, where can I find the after save URL.

Please Log in or Create an account to join the conversation.

  • Piszi
  • Piszi
  • OFFLINE
  • Posts: 5
  • Thanks: 1
  • Karma: 0
13 years 2 weeks ago - 13 years 2 weeks ago #178796 by Piszi
I solved my problem :)
I modded the plugin.foundation.php
I added this to the getCBprofileItemid() function:
Code:
$userthings = & JFactory::getUser(); $usrfuuu = $userthings->groups; if($usrfuuu['Author'] == 3) { $cmsGid = "4"; $mypattern = "= "; } else { $cmsGid = $_CB_framework->myCmsGid(); $mypattern = "<= "; }

And than I replaced the $_CB_framework->myCmsGid() in the Query to $cmsGid and I also replaced the condition in the query with the $mypattern
Than I went back to comprofiler.html.php and changed myItemid() back to the original and thats it.
Maybe there is a more elegant way or more professional but it will do.

I think it would be better if the $_CB_framework->myCmsGid() would contain the ACL of the User maybe from this JAccess::getAuthorisedViewLevels($userid) and than the MYSQL Query condition shoud be equal for the "access" column to avoid miss categorization except for Super Users becouse normally they have full access.

Like in my case Customer Access Level has the id=4 and the Customer User Group has the id=3 and with CB's Itemid query the Customer Group can only access menu items which are equal or lower than 3 but my joomla menu item has Customer ACL and the CB query resulted a lower level menu item becouse of this.
Last edit: 13 years 2 weeks ago by Piszi.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum