2

I am running into the strangest problem. I am unable to change template preferences on an EE site. I am a Super Admin, but when I click "Edit Preferences" and try to Enable Caching I get a dropdown at the top of the page that says, "You are not authorized to access this page".

Help! I’ve tried all sorts of things and can’t figure out what on earth is going on.

3

I ran into this a while back and Robin helped me. Here's the thread on the subject: http://ellislab.com/forums/viewthread/224591/

And here's the answer:

As an update for anyone who stumbles on to this post, the great EllisLab team tracked the issue down to headers and post data through json. Info is below:

It boiled down to a json array being sent as a string on that manage page whenever it had to pull back the template group’s data via ajax.

But looking at it- we couldn’t figure out why we couldn’t reproduce. It’s because you have your site set to NOT send http headers. And EE’s output class, when sending AJAX, sends a header to treat it as json. But since you’ve got sending headers turned off- it gets seen as a string, and goes wrong.

We’re actually going to discuss the long term solution tomorrow. Really- that header probably should be sent regardless of the header setting. But- it can be worked around by explicitly including it in the ajax call. That’s actually what I’ve done on your site for now- in themes/javascript/compressed/cp/manager.js :

function refresh_prefs_ajax(id) {

 $.ajax({
  type: "GET",
  url: EE.template_prefs_url,
  data: "is_ajax=TRUE&group;_id=" + id,
  dataType: 'json',
  success: function (data) {
   EE.pref_json = data;
  }
 }); 

see that dataType param? That’s what fixed it.

I suspect the long term fix may be different- and we’ll attack it from the output class. But it needs some discussion. For the short term- the hack should work fine. And when we release the next version we’ll have a fix in it, though what that fix is may vary a bit.

  • Robin
  • 1
    That was it. HTTP Page Headers was causing some issues and slow CP load so I had turned it off. Strangely, I turned it back on and the CP is not loading slowly anymore. I’ll give it some time and see what happens. I would never have imagined that this was the cause. Thanks! – TJ Draper Jan 28 '13 at 20:11
1

Doing a search on lang('unauthorized_access') in the EE codebase shows that it's used for just about everything. Have you checked file permissions within your site directory? Is it trying to create a cache directory or file on the server and unable to?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.