Jump to content

CMS image browse (ajaxfilemanager/login.php) 404


Recommended Posts

I'm aware this has been discussed before but I cannot find a resolution anywhere.

I didn't notice this problem until my client started managing their site in Firefox/Chrome/IE. It seems when you go to the CMS tool, insert an image into a page and try to "browse" (i.e. launch the ajaxfilemanager) all you get is a 404 error. I can reproduce this error in the aforementioned browsers, but it works just fine in Opera. Furthermore, additional investigation shows what appears to be a non-existent URL being called (/ajaxfilemanager/login.php?redirect=ajaxfilemanager.php - login.php doesn't exist in that directory).

This also happens when using the same function in to browse for a link.

I'd like to point out this happens in the prestashop demo shop (although obviously not in Opera) >.<

Now short of telling my client to use another browser (which I know is not an option), does anyone have any ideas?

Link to comment
Share on other sites

Alright I think I know where this is going, and I don't like it.

When I commented out the call to init.php (yes, I know, not the most secure thing to do but I'm bug hunting), Firefox lets me reach the ajaxfilemanager page. However, the left column (with file info etc) is missing as is the file list. Nothing else works - upload, create new folder, etc, open empty white modal boxes.

Meanwhile, on Opera, everything is exactly the way it was before and should be despite the changes.

Link to comment
Share on other sites

I'm not sure what worked: Either uploading init.php, tinymce (incl. plugins)and ajaxfilemanager from the current SVN trunk solved this, or simply forcing a clearing of cookies did it.

In any event, this is effectively solved. But I suspect I've not heard the last of this.

Link to comment
Share on other sites

The above only happens in IE.

I've taken the step of implementing this: http://www.prestashop.com/forums/viewthread/2137/ solution to try and prevent old cookies from screwing up authentication when accessing the ajaxfilemanager, and I also set a negative timeout on the cookie logout function so that previous cookies should be removed by the users browser.

However, despite this working flawlessly on FF and Chrome (Linux Mint and XP SP3) I'm still getting bug reports on this and I'm starting to wonder exactly what is going on. Not only that, but I.E. still won't launch it more than once.

Link to comment
Share on other sites

There are several problem with cookies and ajaxfilemanager. Why create a new administrator cookie foreach script call ? In that case there are :
- one cookie for /admin/ after login
- one cookie for /admin/ajaxfilemanager/ after call to ajax file manager

If the second cookie is expired you are redirect to /ajaxfilemanager/login.php, this page doesn't exist !!!

I have implement this http://www.prestashop.com/forums/viewthread/2137/ for the admin and modifiy code like this in /admin/init.php :

$currentFileName = array_reverse(explode("/", $_SERVER['SCRIPT_NAME']));
$cookie = new Cookie('psAdmin', 'admin');
session_start();
if (isset($_GET['logout']) || !isset($_SESSION['loggedadmin']) ) {
   $url_redirect = '';
   session_destroy();
   $cookie->logout();
}

if (!$cookie->isLoggedBack())
{
       $destination = substr($_SERVER['REQUEST_URI'], strlen(dirname($_SERVER['SCRIPT_NAME'])) + 1);
       Tools::redirectAdmin(Tools::getShopDomain(true).'/admin/login.php'.(empty($destination) || ($destination == 'index.php?logout') ? '' : '?redirect='.$_SERVER['REQUEST_URI']));
}

Link to comment
Share on other sites

  • 8 months later...
  • 5 months later...
  • 1 month later...
  • 2 months later...
×
×
  • Create New...