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

Media becomes inaccessible when savedir is relative #11

Open
pv2b opened this issue Oct 15, 2019 · 3 comments
Open

Media becomes inaccessible when savedir is relative #11

pv2b opened this issue Oct 15, 2019 · 3 comments

Comments

@pv2b
Copy link
Contributor

pv2b commented Oct 15, 2019

The savedir parameter of dokuwiki is by default set to ./data. If you run Dokuwiki with this kind of configuration, when using the dokuwiki-saml plugin, the media breaks (i.e. pictures stop loading). Also, the media manager becomes unaccessible, because it thinks an admin is no longer an admin.

saml_user_file is set here using $conf['savedir']

$this->saml_user_file = $conf['savedir'] . '/users.saml.php';

saml_user_file is later referenced in different places, such as here:

if(!@file_exists($this->saml_user_file))
return;
$lines = file($this->saml_user_file);

However! Depending on where exactly where the code is called from, the current working directory can be different, resulting in that sometimes, when you use a relative path like this, it tries to look at the wrong path. This is true when trying to use media manager.

Workaround: Made sure that $conf['savedir'] is configured as an absolute path, i.e. /var/www/dokuwiki/data in my install. (This is what I've done in my install, rather than try to fix this bug.)

@Stopi
Copy link

Stopi commented Nov 25, 2019

A thousand thanks for this workaround, I was struggling with displaying pictures for users belonging to an Active Directory group, while the admin was able to see them perfectly.

Now the permissions seems to work correctly, using absolute path for savedir.

@pitbulk
Copy link
Owner

pitbulk commented Nov 25, 2019

@pv2b do you have a PR?

@pv2b
Copy link
Contributor Author

pv2b commented Nov 25, 2019

@pitbulk Unfortunately, no. I was able to identify the problem and a workaround, but I'm not familiar enough with the codebase or with PHP to identify where the fix would be best put in place.

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

No branches or pull requests

3 participants