Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 18

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Archive > Mambo 4.5 > Mambo 4.5 Bugs

 
 
LinkBack Thread Tools Display Modes
Old 27.07.2004, 16:58   #1 (permalink)
Baby Mamber
 
Myles's Avatar
 
Join Date: Jul 2004
Location: London - UK
Posts: 15
Myles is on a distinguished road
Send a message via ICQ to Myles Send a message via AIM to Myles Send a message via MSN to Myles Send a message via Yahoo to Myles
Default You are not authorized to view this resource

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
__________________
"The journey of a thousand miles begins with one step, and a lot of bitching."

Last edited by Myles; 27.07.2004 at 20:33.
Myles is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Old 15.08.2004, 18:21   #2 (permalink)
Baby Mamber
 
nascent's Avatar
 
Join Date: Jul 2004
Posts: 23
nascent is on a distinguished road
Thumbs up Re: You are not authorized to view this resource

Just wanted to say thanks Myles.

I was looking for ages to find what was causing the problem and you hit it in one.

Cheers
n
nascent is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08.09.2004, 23:06   #3 (permalink)
Baby Mamber
 
Myles's Avatar
 
Join Date: Jul 2004
Location: London - UK
Posts: 15
Myles is on a distinguished road
Send a message via ICQ to Myles Send a message via AIM to Myles Send a message via MSN to Myles Send a message via Yahoo to Myles
Thumbs up Re: You are not authorized to view this resource

Hey, no problem mate.

Glad it was of some help to you.
__________________
"The journey of a thousand miles begins with one step, and a lot of bitching."
Myles is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 11.09.2004, 18:37   #4 (permalink)
Baby Mamber
 
raydar's Avatar
 
Join Date: Aug 2004
Posts: 16
raydar is on a distinguished road
Default Re: You are not authorized to view this resource

Thanks Myles! I had just ran into this problem. You might want to post it as a bug and a fix to the Mambo team.

Again thanks.
raydar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 12.09.2004, 19:48   #5 (permalink)
Baby Mamber
 
Myles's Avatar
 
Join Date: Jul 2004
Location: London - UK
Posts: 15
Myles is on a distinguished road
Send a message via ICQ to Myles Send a message via AIM to Myles Send a message via MSN to Myles Send a message via Yahoo to Myles
Default Re: You are not authorized to view this resource

I thought they would read this forum LOL

Where would I go to send a fix then?
__________________
"The journey of a thousand miles begins with one step, and a lot of bitching."
Myles is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 26.09.2004, 20:11   #6 (permalink)
Mamber
 
Join Date: Aug 2004
Location: Finland
Posts: 51
Caygill is on a distinguished road
Default Re: You are not authorized to view this resource

Gee, thanks Myles!
First time I actually found directly a solution to an issue!!!
Make this sticky.
Caygill is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 15.10.2004, 17:49   #7 (permalink)
Junior Mamber
 
Join Date: May 2004
Posts: 25
demito is on a distinguished road
Thumbs up Re: You are not authorized to view this resource

i've got some problems with my loudmouth...
A Big thanks
demito is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 23.10.2004, 07:17   #8 (permalink)
Junior Mamber
 
Join Date: May 2004
Posts: 25
demito is on a distinguished road
Default Re: You are not authorized to view this resource

when use this hack, my loudmouth works fine but my pms not accessible, even if when my user login
demito is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 05.11.2004, 02:25   #9 (permalink)
Baby Mamber
 
Join Date: Jul 2004
Posts: 6
fly476 is on a distinguished road
Default Re: You are not authorized to view this resource

Hey guys,

Im not a PHP prorgamer so i dont understand thew code stuff (im trying to learn) how can i fix my problem. it seems the same as you have described above. any help would be appriciated
fly476 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 30.11.2004, 17:43   #10 (permalink)
Baby Mamber
 
VicentGiner's Avatar
 
Join Date: Apr 2004
Posts: 13
VicentGiner is on a distinguished road
Default Re: You are not authorized to view this resource

Hello!

I also have similar problems with my Mambo. I'm usig version 4.5.0 (1.0.9).

So, my question is this: Is that bug and that "patch" related with my Mambo version?

Thank you in advance.
VicentGiner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not Authorized to view?? Is there a real fix?? Sydney Mambo 4.5 General Talk 7 06.01.2006 19:26
You are not authorized to view this resource. Farrukh Mambo 4.5 General Talk 4 11.09.2004 18:43
index2.php?mosmsg=You are not authorized to view this resource bluesky Mambo 4.5 'How Do I' Questions 1 11.09.2004 18:41
not authorized to view this, please log in ashtek Mambo 4.5 Bugs 1 11.09.2004 18:40
Printer Friendly pages: You are not authorized to view this resource. Ceesjan Mambo 4.5 Installation and Upgrades 2 08.07.2004 16:21


All times are GMT +2. The time now is 19:55.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.