52 Posts
paulbr
10 years ago
Topic

Hello,

With version 3.3.3 of SEBLOD I could App folders to export.
As of version 3.3.4 no longer possible. (version 3.3.5, it is also not possible)

I always get the message: You are not allowed to access this file.

As Super-User must be possible.
SEBLOD rights are ok, the Super-User can do anything.

Where could be the problem?

regards,

Paul

Get a VIP membership
4229 Posts
Kadministrator
10 years ago
0
Level 1

Hi,

this sounds like file permission issue, so you are not allowed to open file seblod has just created. Take a look at your file permissions set in tmp folder of joomla and ownership of that folder, web server user needs to be able to red and write from/to that folder.

52 Posts
paulbr
10 years ago
1
Level 1

Hi Klas,

the permissions are ok, all is 777.

The problem is probably related to the downloader.
Despite error message the app folder is stored as a zip in the / tmp folder.

regards,

Paul

4229 Posts
Kadministrator
10 years ago
0
Level 2

Hi,

some hosters block access to files with 777, try accessing this file directly using browser e.g. http://www.yoursite.com/tmp/filename

52 Posts
paulbr
10 years ago
0
Level 1

Again to clarify:
Installed is joomla! 3.3.0 and 3.3.3 SEBLOD
An export an app folder is ok.
Update only SEBLOD on 3.3.4 the download is no longer work (see error message), but the zip folder is stored in / tmp folder.

regards,

Paul

52 Posts
paulbr
10 years ago
1
Level 1

All is writeable!
I have tested this on local wamp installation and on different live servers.

It's always the same result, the zip is stored in the / tmp folder,
but the download dialog is not open, only the error message appears.

regards,

Paul

4229 Posts
Kadministrator
10 years ago
0
Level 2

Hi,

try looking at your apache and php error logs if there is any error, this is not something that is happening to others so difficult to resolve. I can't repicate it, for me it works on all servers I have access too (windows, linux, freeBSD with different php versions). It could be something specific to your content type, e.g. some field - try exporting default joomla article app if the same thing happens.

52 Posts
paulbr
10 years ago
0
Level 1

Hi Klas,

I have changed neither the local nor at the 8 live servers anything.
Just made an update seblod from 3.3.3 to 3.3.4.

I have tested the following (local and Live Server):
Joomla 3.3.0 + seblod 3.3.3 - download works | Update seblod to 3.3.4 | does not work
Joomla 3.3.0 + seblod 3.3.5 - does not work
Joomla 3.3.1 + seblod 3.3.3 - download works | Update seblod to 3.3.4 | does not work
Joomla 3.3.1 + seblod 3.3.4 - does not work
Joomla 3.3.1 + seblod 3.3.5 - does not work

In the Apache access log (width seblod 3.3.3):
127.0.0.1 ... "GET /administrator/components/com_cck/download.php?file=.../tmp/app_cck_bestellformular_1.zip HTTP/1.1" 200 44280

In the Apache access log (width seblod 3.3.4 and later):
127.0.0.1 ... "GET /administrator/index.php?option=com_cck&task=download&file=.../tmp/app_cck_bestellformular_1.zip HTTP/1.1" 303 -

regards,

Paul

52 Posts
paulbr
10 years ago
0
Level 1

Yes is the same.
Whether I want to export their own folder or joomla folder.
The zip is allways stored in / tmp, but the Download dialog is not opened.
I've tested it in Firefox (latest) and IE (latest).

4229 Posts
Kadministrator
10 years ago
0
Level 1

Judging by the link your Joomla tmp folder is somehow not correctly set, I get file=tmp/app_cck_joomla_user.zip at the end of the link, if I change this to file=.../tmp/app_cck_joomla_user.zip I get the same mesage as you. Tmp folder in joomla should be pointing to tmp folder inside joomla directory, not to server tmp folder.

52 Posts
paulbr
10 years ago
0
Level 1

Sorry Klas, but I'm not stupid.
I am computer scientist for 30 years.
I have the link only cropped for better readability.

Here is the complete link so you can see that:
127.0.0.1 - - [30/Jun/2014:14:44:16 +0100] "GET /administrator/index.php?option=com_cck&task=download&file=D:/SERVER/www/TEST/TEST/Website/tmp/app_cck_bestellformular_1.zip HTTP/1.1" 303 -

regards,

Paul

4229 Posts
Kadministrator
10 years ago
0
Level 1

Hi,

I'm just trying to help here. 

Path you get differs from the one I get, mine is relative (see above), which means your tmp path is not recognized as relative to component folder for some reason (could be something trivial like upper case vs. lowercase letters) and since stricter checks in download function which came in 3.3.4 denies access to this file.

If detailed inspection of the tmp folder path does not help, try adding this path to the Allowed Paths in Media tab of the component options, by default only tmp/ is in allowed paths list.

52 Posts
paulbr
10 years ago
0
Level 1

Hi,

"D :/ SERVER / www / test/ test/ website" is the document root for this domain. In the Apache log is not the domain name but the absolute path is specified.
This path is for the local domain: bundesverband-gutachter.loc
I Work with local as online domains.

But let's leave that, I think without which I log the entire download process precisely, we will not know to what this is.
I was here just ask because it could be that someone knows this problem-and know why this is so.
I will write a script and record the entire process in the export exactly, then I'll know where or what is the problem.

Thanks
Regards,
Paul

4229 Posts
Kadministrator
10 years ago
2
Level 1

"try adding this path to the Allowed Paths in Media tab of the component options, by default only tmp/ is in allowed paths list."

The above should work

52 Posts
paulbr
10 years ago
1
Level 2

you do not understand.
I do not change the path, "tmp/" is an default joomla path.
The file is correctly stored in "tmp/filename.zip".
In the browser I can download the file with http://meine-domain.com/tmp/filename.zip
Only the download dialog window just will not open when you export from seblod.
The problem is NOT the path but the rights to downlaod over seblod.

Why should I add the "tmp/" to the allowed paths in Media? .. that's nonsense
"tmp/" is an default joomla folder and is in the allowed path list.

again:
With a fresh joomla + seblod installation everything works.
With a seblod update > 3.3.3 it does not work.
I have not changed the paths, or other things.

Thank you for your time

regards,

Paul

4229 Posts
Kadministrator
10 years ago
0
Level 3

Seblod is stricter about this path since 3.3.3

If you look at joomla configuration file you will see the whole path to tmp folder stored there (

D:/SERVER/www/LITTERARIUS/BUNDESVERBAND/Website/tmp/ )

Anyway, you can either try to add it to allowed paths or continue claiming it is nonsense, it is your choice.

251 Posts
Viktor Iwan
9 years ago
0
Level 1

I have the same problem ! 

After tracing and debug...i know what caused this.

the current JCckDevHelper::getRelativePath(); FAILS to work on windows environtment...

Here's why (if you like directly go to solution, skip all this explaination step):

1. Open administrator/components/com_cck/controllers/folder.php, and focus on line 51-56:

if ( $file = $model->prepareExport( $recordId, $elements, $dependencies, $options ) ) {
     $file=JCckDevHelper::getRelativePath( $file, false );
     $this->setRedirect( JUri::base().'index.php?option=com_cck&task=download&file='.$file );
} else {
     $this->setRedirect( _C0_LINK, JText::_( 'JERROR_AN_ERROR_HAS_OCCURRED' ), 'error' );
}

the prepareExport method, will give return the value of $file in this format:

C:/Zend/Apache2/htdocs/guru/tmp/app_cck_customcck.zip

Now, jCckDevHelper::getRelativePath is try to get the relative part of the file, not the full path given. The method is declared on /libraries/cms/cck/dev/helper.php

Look at the line 90-91

$path=str_ireplace( JPATH_ROOT, '', $path );

$path=str_replace( '\\', '/', $path );

This is where the problem happen, because on line 90, it try to remove JPATH_ROOT from the $path, right ? in windows, its totally wrong ! Why ? because JPATH_ROOT will return:

C:\Zend\Apache2\htdocs\guru

See all the 'flip' slash produced by JPATH_ROOT...

SOLUTION ?

it's very easy.

you, just need to modify the line 90:

From:

$path=str_ireplace( JPATH_ROOT, '', $path );

To:

$root=str_replace( '\\', '/', JPATH_ROOT ); // this is the way i forced the flip slash into the correct one produced prepareExport() method

$path=str_ireplace( $root, '', $path );

DONE. PROBLEM SOLVED !

SUBMITTING PULL-REQUEST on /dev now....

251 Posts
Viktor Iwan
9 years ago
1
Level 1

For anyone who like to see what need to change:

https://github.com/Octopoos/SEBLOD/pull/26/files

(look on changes in ibraries/cms/cck/dev/helper.php)

9 years ago
0
Level 2

Hi,

Thanks a lot Viktor! Well done!

We're trying to include this fix in the next version.

Sebastien.

Get a VIP membership