fixed image download
This commit is contained in:
parent
8b50339b57
commit
1e05c1ae9c
|
@ -177,14 +177,16 @@ class lamUserList extends lamList {
|
|||
elseif ($attribute == "jpegphoto") {
|
||||
if (sizeof($entry[$attribute][0]) < 100) {
|
||||
// looks like we have read broken binary data, reread photo
|
||||
$result = @ldap_search($_SESSION['ldap']->server(), $entry['dn'], $attribute . "=*");
|
||||
$result = @ldap_search($_SESSION['ldap']->server(), $entry['dn'], $attribute . "=*", array($attribute));
|
||||
if ($result) {
|
||||
$tempEntry = @ldap_first_entry($_SESSION['ldap']->server(), $result);
|
||||
if ($tempEntry) {
|
||||
$binData = ldap_get_values_len($_SESSION['ldap']->server(), $tempEntry, $attribute);
|
||||
if (isset($binData['count'])) unset($binData['count']);
|
||||
$entry[$attribute] = $binData;
|
||||
}
|
||||
}
|
||||
}
|
||||
$jpeg_filename = 'jpg' . $_SESSION['ldap']->new_rand() . '.jpg';
|
||||
$outjpeg = @fopen($_SESSION['lampath'] . 'tmp/' . $jpeg_filename, "wb");
|
||||
fwrite($outjpeg, $entry[$attribute][0]);
|
||||
|
|
Loading…
Reference in New Issue