Course images not displayed to LDAP users

Course images not displayed to LDAP users

de Christian Binkert -
Número de respuestas: 3

Hi all,

I have a weird problem where I need your help. The short version is that all course images are displayed correctly to users that have been created MANUALLY, however they are all broken for users authenticated through LDAP.

The long version: all course images that are correctly displayed to MANUALLY created moodle users are not shown for users authenticated through LDAP, independent of their internal role. This affects only course images displayed using file.php (e.g. http://myserver/moodle/file.php/3/test.jpg), hardcoded images e.g. from the theme directory are displayed correctly to all users. If I paste the URL for such an image into the browser directly, it displays the source code of the image (weird characters). This happens on all browsers. However, it does not seem to be a server / file permission / browser / role issue as the moodle system and LDAP work correctly apart from that issue.

We tracked the error further down and found out that it is at least on first sight related to the value of the field 'auth' in the table 'mdl_user'. If I change the 'auth' value of an LDAP user from 'ldap' to 'manual', the images are displayed correctly! Very strange, overall as there seem to be no differences between a manual and an LDAP user apart from that auth type field that should not influence their image display rights. But as changing all users to manual cannot be the solution, how can I solve the issue?

System: Solaris 10, Apache 2.2.3, PHP 5.2.0, MySQL 5.0.33

Note: this error has also been posted in the issue tracker:
http://tracker.moodle.org/browse/MDL-10429

Promedio de valoraciones: -
En respuesta a Christian Binkert

Re: Course images not displayed to LDAP users

de Iñaki Arenaza -
Imagen de Core developers Imagen de Documentation writers Imagen de Peer reviewers Imagen de Plugin developers
The only thing I can think of is that you have some extra characters outside the '<?php' and '?>' delimiters in .../auth/ldap/auth.php, that is breaking the MIME headers for content served through file.php

Saludos. Iñaki.
En respuesta a Iñaki Arenaza

Re: Course images not displayed to LDAP users

de Christian Binkert -
The issue has been solved by simply overwriting the modified file '/auth/ldap/auth.php' with the original one - sorry for the false alarm. However, this behaviour is strange as the applied modification code should not contain any (delimiter) errors, it seems like Moodle would only accept the original file. Perhaps it's a Windows / Unix issue between editing client and server, I had similar troubles with authentication before when I changed a single language string(!) in moodle/index.php which broke the whole authentication.