diff --git a/lib/AttributeFactory.php b/lib/AttributeFactory.php index 975b2a3..82cf562 100644 --- a/lib/AttributeFactory.php +++ b/lib/AttributeFactory.php @@ -99,7 +99,7 @@ class AttributeFactory { if (! strcasecmp($name,'objectClass')) { return $this->newObjectClassAttribute($name,$values,$server_id,$source); - } elseif ($app['server']->isJpegPhoto($name)) { + } elseif ($app['server']->isJpegPhoto($name) || in_array($name,$app['server']->getValue('server','jpeg_attributes'))) { return $this->newJpegAttribute($name,$values,$server_id,$source); } elseif ($app['server']->isAttrBinary($name)) { diff --git a/lib/ds_ldap_pla.php b/lib/ds_ldap_pla.php index 925d877..d3ae234 100644 --- a/lib/ds_ldap_pla.php +++ b/lib/ds_ldap_pla.php @@ -51,6 +51,10 @@ class ldap_pla extends ldap { 'desc'=>'Custom operational attributes to be treated as internal attributes', 'default'=>array('+')); + $this->default->server['jpeg_attributes'] = array( + 'desc'=>'Additional attributes to treat as Jpeg Attributes', + 'default'=>array()); + # This was added in case the LDAP server doesnt provide them with a base +,* query. $this->default->server['root_dse_attributes'] = array( 'desc'=>'RootDSE attributes for use when displaying server info', diff --git a/lib/functions.php b/lib/functions.php index 104448d..87d0bf6 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -2000,7 +2000,7 @@ function draw_jpeg_photo($server,$dn,$attr_name='jpegphoto',$index,$draw_delete_ 'type'=>'warn')); # This should atleast generate some text that says "Image not available" - echo 'Photo'; + printf('Photo',$attr_name); return; } @@ -2053,7 +2053,7 @@ function draw_jpeg_photo($server,$dn,$attr_name='jpegphoto',$index,$draw_delete_ $img_height = $height; } - $href = sprintf('view_jpeg_photo.php?dn=%s&index=%s',rawurlencode($dn),$index); + $href = sprintf('view_jpeg_photo.php?dn=%s&index=%s&attr=%s',rawurlencode($dn),$index,$attr_name); printf('',number_format($outjpeg),_('bytes'),$width,$height,_('pixels'));