user uploaded files have always admin access level

Phoca Download - download manager
rudolfpolzer
Phoca Member
Phoca Member
Posts: 12
Joined: 23 Apr 2014, 14:28

user uploaded files have always admin access level

Post by rudolfpolzer »

I want files uploaded by users to have automatically an access level other than administrator. Please help.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: user uploaded files have always admin access level

Post by Jan »

Hi, not sure what you mean, uploaded files have standard public access :idea:

Jan
If you find Phoca extensions useful, please support the project
rudolfpolzer
Phoca Member
Phoca Member
Posts: 12
Joined: 23 Apr 2014, 14:28

Re: user uploaded files have always admin access level

Post by rudolfpolzer »

I am using joomla and phoca download and all uploaded files have admin access level. Up to now I had to change the access level manually.

This might be an error in the mysql database. Because the installation is already in use I want to avoide any uninstallation of Phoca Download.

Can you give me a hint where or how Phoca Download gets the information for the default access level for uploaded files so I have chance to change it? I have direct access to the database and to all of the files on the server.

Rudolf
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: user uploaded files have always admin access level

Post by Jan »

Hi, did you or did someone change the code? As default, uploaded files has standard public access level, means, everybody can access the files :idea:
If you find Phoca extensions useful, please support the project
rudolfpolzer
Phoca Member
Phoca Member
Posts: 12
Joined: 23 Apr 2014, 14:28

Re: user uploaded files have always admin access level

Post by rudolfpolzer »

The code was not changed, but there might have happened an unwanted change by a server error. Some days ago we had a problem with exchanged access levels. This was repaired by manually correcting the mysql database. There still might be an error either in code or in the database which gives uploaded files the wrong access level. Do you know which php file sets the access level for uploaded files? I would look into it and either change the php code or the data base manually.

Rudolf
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: user uploaded files have always admin access level

Post by Jan »

Hi, PHP does not set any access, access information is stored in database :idea:

Jan
If you find Phoca extensions useful, please support the project
rudolfpolzer
Phoca Member
Phoca Member
Posts: 12
Joined: 23 Apr 2014, 14:28

Re: user uploaded files have always admin access level

Post by rudolfpolzer »

Please tell me which database record sets or defines the access level.

Rudolf
rudolfpolzer
Phoca Member
Phoca Member
Posts: 12
Joined: 23 Apr 2014, 14:28

Re: user uploaded files have always admin access level

Post by rudolfpolzer »

Anybody can give me a hint for where to search in the database?

:idea:
rudolfpolzer
Phoca Member
Phoca Member
Posts: 12
Joined: 23 Apr 2014, 14:28

Re: user uploaded files have always admin access level

Post by rudolfpolzer »

I found the point where things go wrong - but I don't know why. :x

In the file components/com_phocadownload/models/user.php, a new database row for the new uploaded file is generated in line 407:
$row = $this->getTable('phocadownload');
At this point I would expect the 'access' value to be set to the database default for this column, this is zero. But this is not the case. Instead, 'access' is set to 6, which is admin level.

As a workaround, I added after line 450
$row->access = 2; // ??? set access level - this should not be necessary!
2 is not the default access level but the one I want to use in this case.

Rudolf
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: user uploaded files have always admin access level

Post by Jan »

Hi, the access column is loaded from table, so depends on which value there was set previously, e.g. in administration :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply