DISCUSSION: "You are not authorized to view this resource. You need to login."

Discuss the FAQ's here, and get in touch with the FAQ Team.
ardith
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Aug 26, 2006 12:06 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by ardith » Sat Aug 26, 2006 12:30 am

ccheaton wrote:
Purogamer wrote: I've been getting this since upgrading from 1.0.7 to 1.0.10.  It actually only gives the message to me WHEN I LOGIN, which makes no sense.  If i try it a second time, it doesn't even popup the message, it just reloads the page.  If i click "home", suddenly the login boxes are replaced by the logged-in box.  Doesn't make any sense. 
This happens to me under the following conditions:
My configuration.php file is set to http://www.mywebsite.com
I go to mywebsite.com without the preceeding www. and try to login.

It's a cookie problem, I think.
I'm having a similar problem with my website. I can't login through the frontend of the website as a Superadministrator. I can do it if I am just a regular registered user, but not the other way.

http://www.hanabatake.com

This only happened when I upgraded to .10
;_;
I've tried to see if anyone has had this particular problem with 1.0.10, but I haven't found anything.

I have the following components installed:
  • !JoomlaComment
  • APF by MrRat
  • Banners
  • Contacts
  • eWriting
  • ExtCal Calendar
  • Hashcash cryptography
  • JCE
  • Joomlaboard Forum
  • Mass Mail
My eyes are crossing from all of the different ways that this issue can occur.

It's happening with my sites  on the following circumstances ONLY when I'm trying to login as a SUPER ADMINISTRATOR on the frontend of my website.

I've also installed it on my company's retail store site:
http://retail.animegamers.com.

I'm terribly sorry for the trouble, but could someone point me in the right direction?


Ardith

julesbravo
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Aug 30, 2006 2:12 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by julesbravo » Wed Aug 30, 2006 2:15 am

I get this problem when I try to add a new story. When I select the section from the drop down it comes up. The URL I get ends with: "/index.php?option=com_content&task=new"

Should there be an itemid on the end?

I've tried everything in this thread and nothing seems to fix the problem. Oh yeah I'm using mycontent to add content.

Thanks,
James
Last edited by julesbravo on Wed Aug 30, 2006 2:18 am, edited 1 time in total.

User avatar
coldfrost
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Sun Oct 30, 2005 6:20 pm
Location: Norway

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by coldfrost » Mon Sep 11, 2006 12:04 pm

I get this error when I have the Show categories, and Category Name Linkable in the menu options for the frontpage menu.
I hope someone can help me out here, I think I have tried all the stuff written about it in these forums...

Daniel Tulp
Joomla! Guru
Joomla! Guru
Posts: 630
Joined: Mon Oct 03, 2005 12:30 pm
Location: Arnhem
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by Daniel Tulp » Mon Sep 11, 2006 11:28 pm

When I add a submit content link to my menu, I get this error.

Permission is set to registered, but only admin don't get the error.

I have CB2, but no other of the known 3rd party causes.

I tried everything in the FAQ and this thread, but it doesn't work.

Server config:
PHP built On:  Linux [....] 2.6.15-1-686 #2 Mon Mar 6 15:27:08 UTC 2006 i686
Database Version: 4.1.10-standard
PHP Version: 5.1.2
Web Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.8a DAV/2 PHP/5.1.2 SVN/1.3.2
WebServer to PHP interface: apache2handler
Joomla! Version: Joomla! 1.0.11 Stable [ Sunbow ] 28 August 2006 20:00 UTC
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Your version of Joomla! [ 1.0.11 Stable ] is 15 days old

Relevant PHP Settings:
Joomla! Register Globals Emulation: ON
Register Globals: OFF
Magic Quotes: ON
Safe Mode: OFF
File Uploads: ON
Session auto start: OFF
Session save path: /tmp
Short Open Tags: ON
Output Buffering: OFF
Open basedir: none
Display Errors: ON
XML enabled: Yes
Zlib enabled: Yes
Disabled Functions: none
My personal website: http://www.danieltulp.nl
My photo showcade: http://photo.danieltulp.nl

User avatar
v2maxx
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 12, 2006 9:40 am
Location: Hanover
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by v2maxx » Tue Sep 12, 2006 10:02 am

Hi,
I recently upgraded my site from 1.0.8 to 1.0.11 stable and eversince i can't login from the frontend. I always get the " You are not authorized to view this resource" prompt.
I've tried all the forementioned suggestions,with no result (all my content items,menus and links are public, I've emptied the trash and so on).
My site also runs with zoom media gallery and joomlaboard.
Any suggestions? ???

thediva
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sat Jun 24, 2006 4:18 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login."

Post by thediva » Fri Sep 15, 2006 9:55 pm

I'm on joomla 1.0.8 I have tried every suggestion on these boards and in the FAQ and I'm still getting You are not authorized to view this resource. You need to login .

I've cleared my trash and my cache. *everyhting* is now public (although we really want some stuff registered only)
I can only see the site as admin and even then You are not authorized to view this resource.
shows up under the content.
Registered users can not see content when they are logged in.

http://www.aafca.com

please help
thank you

tflores21
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Mon Jul 10, 2006 7:37 pm

Re: DISCUSSION: "You are not authorized to view this resource."

Post by tflores21 » Mon Sep 25, 2006 5:14 pm

After upgrading to 1.0.11, when trying to login from frontpage I get "You are not authorized to view this resource." pop up.  I don't have to put anything in the user/password, but get this just by clicking on the login button as well.  I notice in the pop up that the url is without "www".

I am very green at all this and have browsed the forum postings all weekend.  At this time I have not turned on SEF so I have not pursued the corrections for that.  I am running on Apache, but didn't feel like I understood enough to change the htaccess.txt to .htaccess.

I have a test site that has the basic Joomla install with no additional components/modules installed and when I upgraded that site I get the same error.

Please help!!

hamsel
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sun Oct 30, 2005 1:39 am
Location: Denmark
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by hamsel » Mon Nov 06, 2006 3:36 pm

Propaganda wrote:
...
And now it finally works, I can be logged out from the website, and still click latest news items, or place links to topics on my website which are public on in emails....etc
...
gr. Frank
Hi, Frank -

... does this work for you with the build-in seach function as well? 

I'm facing a similar problem with /components/com_search/search.php, and my solution to both situations (i.e., with /modules/latestnews.php as well), was to hack the code to provide a dummy Itemid.

When applied to /modules/latestnews.php, I don't need to link to a dummy menu, but you can discuss which solution is the uglier...  ;D

Yours
Per

User avatar
cdbragg
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Aug 22, 2005 4:06 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by cdbragg » Sun Nov 12, 2006 10:42 am

Hi all...

This isn't quite the right place for this question - but I couldn't find any other way to post it (I'm a bit daft at all this).  I'm trying to read the press release and information that relates to the release of 1.0.11 - but it tells me I'm not authorised!  I can't find any way to log in, so I'm a bit confused.  Anyone else had this problem?  The address is: http://www.joomla.org/content/view/1843/74/

Thanks to all who contribute their time and energy to this project!

Cameron

digidivakathy
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Mon Mar 27, 2006 3:52 pm

Re: DISCUSSION: "You are not authorized to view this resource. You need to login."

Post by digidivakathy » Sat Nov 18, 2006 3:51 am

I am suddenly having this problem and I have no idea why.  These are public items, items I've never had issues with before, but now I am getting the ugly message and others are, too.  I have tried all the suggestions in the other thread but I'm not sure what SEF is.  I did turn on SEO search friendly URLs, but it said something about renaming my .htaccess file and I don't know where that is.  The problem is still happening at this time.  I can't run a site with content that I'm directing my members to if they can't see it...are you working on a real solution to this problem?  Don't mean to sound like an ingrate, I sincerely appreciate Open Source and have suggested Joomla to people before...but it was before this started...and I can't suggest it again until this is resolved.  It seems like there are an awful lot of people having this problem so it can't just be us, can it?

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Thu Nov 30, 2006 2:16 am

I have read so many posts about this issue and still not solved the problem

i still get You are not authorized to view this resource. for some of the pages

I have created the hidden menu for my sections, removed the trash, use one link in menu only once no duplicate dontent  and still the site is a mess

i use open sef componentand and especially my blog links are opening as tables and sometimes as blogs with intros

in my open sef i get 3 or more different friendly URLs for each page

I was asking on their forum and no answer for months
they do not even say that they do not know what to do, they just do not care and if i complain then they get into rage and stuff and delete my posts. I must say open sef has the worse forum support i have ever seen in my life and i am stuck with them and my site is a mess

like i get links that are creating different id for soem of the pages and i do not knwo why

the site is

http://www.bestofcalifornia.info
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

User avatar
omnialive
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Sep 10, 2006 10:51 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login."

Post by omnialive » Fri Dec 01, 2006 3:28 pm

Propaganda wrote: The following topic made it all work for me:

http://forum.joomla.org/index.php/topic ... cseen.html

I followed the directions, and create a dummy new menu named 'hiddenmenu', and made sure I checked it was not published in the site modules list.
Next in the admin backend I went to: content > section manager.
For each section I did the following:
- clicked the section name
- copied the title towards from the title field towards the 'menu item name' field on the right
- selected the hiddenmenu item
- select the 'section list' from the drop down list options
- finally clicked the 'link to menu button.

Next closed this screen, and did the same for all the sections I had listed.

And now it finally works, I can be logged out from the website, and still click latest news items, or place links to topics on my website which are public on in emails....etc

Hope this helps people out a bit more.....it took me 3 days to find this sollution....
(Thanks stingrey for the sollution!!)

gr. Frank
The only thing that works for me, so far, is if I link the content item itself to a menu!!!! I can't seem to link the section or even categories to a menu in order to make them visible to the public directly!!! The public can see my blog fine...but not when they click on any "Read More..." or the content titles (which I have linked as a work-around [permalink] for directly linking!).

I personally find this "feature/bug" rather absurd! The accessibility (i.e. viewability) of a content item should be SOLELY related to the items permissions as well as the item's aggregate parental permissions (sect, cat...), but that is just the programmer in me!
All comedy comes from pain...I laugh a lot! ;-)

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Fri Dec 01, 2006 4:15 pm

Are you suggesting that I should link all my articles to menu, I have over 300 articles
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

User avatar
omnialive
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Sep 10, 2006 10:51 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by omnialive » Sat Dec 02, 2006 12:08 pm

fendy wrote: Are you suggesting that I should link all my articles to menu, I have over 300 articles
Of course I'm not suggesting that!!!! I have a large amount of items and it keeps growing everyday as well!!! I was merely remarking that the even though the person I quoted above said he could link the section and it worked for him...I had no such luck!

Unfortunately, I'm not sure what a reasonable solution is going to be for people like us!
All comedy comes from pain...I laugh a lot! ;-)

User avatar
omnialive
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Sep 10, 2006 10:51 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login."

Post by omnialive » Sun Dec 03, 2006 6:46 pm

Talk about a WILD RIDE, but I finally figured out what my problem was! On my site, I am pretty much the only "user" and everyone else is considered to be "public". I do have some family which use my site for family stuff, so I put the "Blog Entries" menu item on the User Menu as "Private"...which was blocking things at the following code in index.php:

Code: Select all

if ($path = $mainframe->getPath( 'front' )) {
        $task   = strval( mosGetParam( $_REQUEST, 'task', '' ) );
        $ret    = mosMenuCheck( $Itemid, $option, $task, $gid );

        if ($ret) {
                require_once( $path );
        } else {
                mosNotAuth();
        }
How did I find this, you ask? Well...simple! I first searched all files on the server for the error message "You are not authorized". I found the global variable _NOT_AUTH in "language/english.php" file.

I then searched all files that had "_NOT_AUTH" in them...which led me to "includes/joomla.php" which had the function "mosNotAuth()". As you can see where this is going...I finally narrowed down the source of the error message to the index.php file.

Of course this didn't take too long...because I didn't search the files manually. I used PERL and a combination of the "find" and "grep" commands to automate this for me.

Anyway, at that point, I dug into the function "mosMenuCheck" (which is also in joomla.php) and saw the SQL that was causing the problem:

Code: Select all

                $query = "SELECT *"
                . "\n FROM #__menu"
                . "\n WHERE id = $Itemid"
                ;
I then turned DEBUGGING on in the Admin Panel and narrowed down the exact SQL and looked up what it was complaining about! In this case, it was the "Blog Entries" menu link in the User Menu as I said above. This proves the fact that you have to link the section/category to a menu (even though I don't agree with that logic), you just have to make sure that menu link is PUBLIC!

Hope this helps people. If you have any questions, feel free to PM me!
All comedy comes from pain...I laugh a lot! ;-)

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Sun Dec 03, 2006 7:00 pm

BUT I have to have some menu items hidden just for the administrators so you are telling me that that should not be like that. So how can I hide content from public users?
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

User avatar
omnialive
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Sep 10, 2006 10:51 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by omnialive » Sun Dec 03, 2006 8:09 pm

fendy wrote: BUT I have to have some menu items hidden just for the administrators so you are telling me that that should not be like that. So how can I hide content from public users?
The menu item itself is going to be a specific type that should be fine for mass consumption (public use). That type is "List - Content Section" for EVERY section that you want the content directly viewable instead of in a blog context.

If you don't want your public audience to have access to this section list of content, then create the "hiddenmenu" mentioned above and simply don't publish the menu under the "site modules" admin area. You do want to ensure that the hiddenmenu, section, categories and content item are all set to PUBLIC perms.

If you have further questions, please let me know.
All comedy comes from pain...I laugh a lot! ;-)

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Sun Dec 03, 2006 8:19 pm

but it is hard to access that content that I write only for myself and should be hidden from others. If the menu is hidden or not published I would have to go to backend each time and open each of the content items.
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

User avatar
omnialive
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Sep 10, 2006 10:51 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by omnialive » Sun Dec 03, 2006 10:56 pm

fendy wrote: but it is hard to access that content that I write only for myself and should be hidden from others. If the menu is hidden or not published I would have to go to backend each time and open each of the content items.
It sounds like you may be making this more complicated than it really is! If you have content that is just for you, then you will also want to make a section and category(ies) that are just for you as well!

It is NEVER a good idea to mix content you want to reserve for yourself into sections/cats that are for public consumption! If you seperate the content into the sections like I just mentioned, you won't have any difficulty in accessing just your private content! And at that point you can also put the menu link as "special" so that only you can see and access it!

If this isn't what you are talking about, then I'm afraid you will have to explain in greater detail exactly how your setup is and how you want it to operate!
All comedy comes from pain...I laugh a lot! ;-)

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Sun Dec 03, 2006 11:02 pm

Oh no, I have hidden content in special categories and sections that is linked to the menu as blogcategory and is set to special, so that should work right?
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

abuishaq
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Dec 05, 2006 11:59 pm

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by abuishaq » Wed Dec 06, 2006 12:36 am

My Problem is I cannot login with my password, always any prompt You Need To Login I allready clear all cache,cookies,and all of private data on my PC but its still "You Need To Login"
I Already reset the username and password  but its still "You Need To Login"
the prompt its NOT like this "You are not authorized to view this resource. You need to login" its only "You Need To Login"
help me plizz

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Wed Dec 06, 2006 12:53 am

are you logging in with the http://www.domain.com    or without www

you should set live site in config file to www
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

User avatar
omnialive
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Sep 10, 2006 10:51 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by omnialive » Wed Dec 06, 2006 2:11 am

fendy wrote: Oh no, I have hidden content in special categories and sections that is linked to the menu as blogcategory and is set to special, so that should work right?
If you want this "section" of content to NOT be viewable by the public...then that would work fine. However, any content you want viewable by the public must NOT be in that section or any category under that section or it will not be viewable.

Hence, you must have a seperate section and categories for any publicly viewable content! Any content stored under that "special section" will not be directly accessible outside of a content list or blog section menu link.

Hope this helps. I do try to not be over verbose or terse in my explanations. In an effort to not overrun this post with replies of little substance, we should probably take this discussion into the realm of PM or e-mail and once we have things hammered out, you can post a full account.

Cheers!
All comedy comes from pain...I laugh a lot! ;-)

fendy
Joomla! Explorer
Joomla! Explorer
Posts: 422
Joined: Thu Feb 16, 2006 4:55 pm
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by fendy » Wed Dec 06, 2006 2:47 am

do you have skype?
Professional SEO Search Engine Optimization Los Angeles and Web Design - Joomla. Drupal, Geeklog
http://www.seoandwebdesign.com
http://www.renoseowebdesign.com

Joey2804
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Sun Dec 18, 2005 11:58 pm

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by Joey2804 » Mon Jan 15, 2007 2:58 am

I am still getting this.
It has only crept up in the last couple of days and effects items that are not attached to a menu but are displayed on the main page. All permissions are set to public, there's no registered or anything like that, no-one logs in on the main site. I have followed the FAQ to the best of my ability, but I'm still having problems.

User avatar
dansaintandre
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Tue Jul 04, 2006 11:12 pm
Location: Austin, TX

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by dansaintandre » Mon Jan 15, 2007 10:33 pm

originalbryan wrote: Anyone still suffering from this?
Running 1.0.11 I must login twice.  The first time says, "You are not ..." and I get thrown back to the cold-connect frontpage.
The second time does a proper login.

~~~ Dan 0;-<

User avatar
cronlin
Joomla! Explorer
Joomla! Explorer
Posts: 484
Joined: Sun Aug 28, 2005 1:19 pm
Location: Noel, MO
Contact:

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by cronlin » Fri Jan 19, 2007 1:56 am

here's something weird, I'm using FF for my browser and my version of Joomla is 1.0.11 but I've only had 2 people contact me regarding this issue.

For one of my content items, it's published publicly in a public category and public section and is linked to in both a content item as well as a menu link that are both publicly published.  The first one is Petpet Adventures and the second is Stock Market Tips.  But it only happens when using IE, never with FF. I don't understand what's going on. I tested it myself and sure enough, I get the error when I'm logged out. I have a test account that's Author and neither it nor my main super admin account have the problems with it when logged in on IE, just when logged out. I cleared the cache, history, and temporary internet files for IE and also deleted the cookies and that still didn't solve the problem.

I can't force all of my users to use FF so how would I correct this in IE? I'm also using a different version of IE than the users also experiencing it.

sorry, forgot to post a link:  Neopets Made Easy
Last edited by cronlin on Fri Jan 19, 2007 2:14 am, edited 1 time in total.
As soon as you make something idiot proof, Nature makes better idiots!!!

If you want to know what "coulda", "shoulda", and "woulda" gone wrong, send it my way! I have a natural ability of mucking things up!

asdc
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Feb 02, 2007 7:49 am

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by asdc » Mon Feb 05, 2007 2:12 am

tq reply my ques b4 this .. erm i tryin 2 login the super user bcos i forgot the pass .. i think the pass its right hv any solution ...

Tmack
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Feb 15, 2007 4:04 pm

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by Tmack » Thu Feb 15, 2007 5:27 pm

Quick code fix that doesnt require adding menu items, etc. (note that this is with the current Mambo version, but the code for this is still similar enough to work for Joomla):

The main problem I was having was the inability for logged in users to edit the front page content. Other pages in other areas worked fine. The buttons to edit would show up, but clicking them would give the "You are not authorized..." message. I already had a menu item going to the section/category of the content in question, and tried a menu item going directly to the content  itself, but it was still complaining.

While looking around, I found the same code as mentioned above by omnialive (though a little more directly, I started at the top and found the mosNotAuth call in index.php before digging through includes). The menucheck is the root cause of this evilness, and Im guessing was implemented to keep people from being able to access unpublished items by calling them directly by specially crafted URLs. It either changed in recent versions to be more strict, or something else tickled it so that it bitches alot more than necessary, as I have a page running an older version that didnt have issues like the newer version Im now running does (or I just happend to get it right the first time). Anyway, a simple fix to bypass the mosNotAuth is to simply add to the conditional whatever you want to be allowed (or you can go add them to the menucheck function directly, which is probably the better way).  So... I just added a quick check to see if the user was a logged-in/special user and was requesting something simple from com_content. Also added a check to see if the request was for the login function, as I dont have that published anywhere, or linked anywhere, and is only accessible by editing a URL to com_login (basically allowing specifically what menucheck was trying to prevent).

In index.php, around line 259 (in mambo, might be elsewhere in Joomla, wherever the if ($ret) { statement is:

Code: Select all

 
       if ($ret) {
                require( $path );
        } else {
                mosNotAuth();
        }
Just add to the if():

Code: Select all

 if ($ret || $option == 'com_login' || ( $option == 'com_content' && $my->usertype)) {
       require($path);
  }
  else{
       mosNotAuth();
  }
Note: this punches a big hole in whatever security the menucheck provides, basically bypassing everything it does but what you add to the if(), so implement at your own risk. Check that the logic you add doesnt open it too wide like the goatse man.

$option is the value of ?option= in the URL, and the $my->usertype only returns for people logged in, and is set to what type of user they are ('Administrator','Super Administrator', etc, I actually added if ($my->usertype){ echo $my->usertype; } right before the if($ret) to print the logged in user's user status), so you can further restrict it if you like, and there are plenty of other variables and checks you can  add in (the || is just an OR statement, and && is AND, for you non-coders).

Anyway, hope this helps

T

MortenM
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sun Dec 25, 2005 10:55 am
Location: Norway

Re: DISCUSSION: "You are not authorized to view this resource. You need to login

Post by MortenM » Fri Mar 16, 2007 12:20 pm

what i did was to login to phpmyadmin and deleted the items in usermenu, and added the new one ones from sample_data.sql that was in the core file joomla.
Cus' my site is a migration from mambo to joomla :-)
Now everythning is ok :-)  :pop :D
--
Questions are never indiscreet, answers sometimes are.
Oscar Wilde


Locked

Return to “FAQ Discussion Board”