Ok check this out....
I installed party staff and set it to public access for viewing and then added the "update details" menu item for registered users to update their details using the party staff extended features.
Now when you are a public user and want to look at the "full details" of a staff member on the party staff component you get the message "You are not authorized to view this resource".
So I hunted around for the little bugger of a function that was doing this and I found a possible bug.
The function I found was not part of party staff at all. It was in the "<mabo root>/classes/mambo.php". The function is called "mosMenuCheck".
Now what happened was that there were two items in the "mos_menu" table that linked to the "com_partystaff" component (this can be seen in the "link" column). The SQL in the "mosMenuCheck" function would select all the items in the "mos_menu" table that had the word "com_partystaff" in the "link" column.
Because one of these items was for "registered" and the other was for "public" the code in this function selected the last entry in the result set and this result was the "registered" access row. This then made the "You are not authorized to view this resource" message come up on the party staff "full details" page when it should have let you see it.
This is how I fixed it...
PHP Code:
/**
* Checks whether a menu option is within the users access level
* @param int Item id number
* @param string The menu option
* @param int The users group ID number
* @param database A database connector object
* @return boolean True if the visitor's group at least equal to the menu access
*/
function mosMenuCheck( $Itemid, $menu_option, $task, $gid ) {
global $database;
$dblink="index.php?option=$menu_option";
if ($Itemid!="" && $Itemid!=0) {
$database->setQuery( "SELECT access FROM #__menu WHERE id='$Itemid' And type<>'url'" );
} else {
if ($task!="") {
$dblink.="&task=$task";
}
$database->setQuery( "SELECT access FROM #__menu WHERE link like '$dblink%' And type<>'url'" );
}
$results = $database->loadObjectList();
$access = 0;
//echo "<pre>"; print_r($results); echo "</pre>";
foreach ($results as $result) {
$access = max( $access, $result->access );
}
return ($access <= $gid);
}
Basically I just got it to ignore the "URL" type in the menu as the "component" type is more likley how we want it to work.
Hope this is usefull to someone.
Laters
