Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIXED BUG #18589 about Project tasks linked file access denied #18617

Closed
wants to merge 1 commit into from
Closed

FIXED BUG #18589 about Project tasks linked file access denied #18617

wants to merge 1 commit into from

Conversation

alsoft10
Copy link
Contributor

@alsoft10 alsoft10 commented Sep 6, 2021

Instructions

#18589 linked files with the task is not working. And it is fixed. Hopefully it will be merged.

@@ -2293,7 +2295,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,

// Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10'
if (empty($refname)) {
$refname = basename(dirname($original_file)."/");
$refname = basename(dirname($original_file, 2)."/");
Copy link
Member

@eldy eldy Sep 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add ",2" parameter it means that for original_file = a/b/c, dirname(original_file, 2) will return
a
But here we want
b
Old code seems good.
Which value did you receive in $original_file ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I partially agree with you as I am not experienced as you are in Dolibarr. But here...
a= Project Reference
b= Task Reference inside the above project
c= Filename

Dolibarr creates directory for each and every project to store linked files in it. Now tasks files are stored new directory inside the project directory. So you must know the a, before you go to b. I have fixed it and it is completely working in my system pretty good. I will suggest to check once again. Thank you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good morning,

Dolibarr V 14.0.2 latest update already installed and problem persisting.

I've also changed code following your instructions but still facing the same problem. The most surprising is that depending in system, problem is persisting or not. I mean, I tested 2 desktop PCs, 3 mobile/tablets and all of them working fine, but from laptops (Lenovo & MacBook Air) we are facing problems, no matter from which country do we try or the navigator we use (Chrome or Edge). I don't know if it makes sense, but seems that problems are generated by laptops??!!

Best regards and grateful, hope you could help us. Thanks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dolibarr V 14.0.3 latest update already installed and problem persisting.

eldy added a commit that referenced this pull request Sep 9, 2021
@eldy eldy closed this Sep 9, 2021
@JoAnMaFe
Copy link

18617

In v14.0.2 it doesn't work for me either.
Access denied.
You try to access a page, area or functionality of a disabled module or without an authenticated session or not allowed to your user.
Permissions for this user can be assigned by Dolibarr administrator via menu Start-> Users.

In addition, thumbnails of events are not visible, they can be opened, but a blank icon is displayed.

@edupulpillo
Copy link

Same here.
The problem persist in the version 14.0.2, with old files attached in a task, and also new files attached in v14.0.2

How can be requested to "reopen" an issue in GIthub/Dolibarr ?

@Euroiranian
Copy link

Hi,
I just updated to V 14.0.2 and problem persists.

Anyone following this issue?????

Thanks.

@JoAnMaFe
Copy link

#18716 """"Solved""""

@edupulpillo
Copy link

In 14.0.3 the problem persist, returning a problem of permissions, even using the admin user with all the rights enabled:

Access denied.
You try to access to a page, area or feature of a disabled module or without being in an authenticated session or that is not allowed to your user.

Current login: admin
Permission for this login can be defined by your Dolibarr administrator from menu Home->Users.

@edupulpillo
Copy link

The problem persist in 14.0.5

@edupulpillo
Copy link

Problem solved with commit 5d5a219 explained in #19770
Please close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants