*** LdapPlugin.old	Tue Dec  9 17:45:12 2003
--- LdapPlugin.pm	Tue Dec  9 17:45:49 2003
***************
*** 63,68 ****
--- 63,69 ----
  	# and it won't ever happen.
  	my $jpegPhoto=&TWiki::Func::extractNameValuePair( $attr, "jpegPhoto" ) || $LDAP_jpegPhoto;
  
+ 	my $jpegDefaultPhoto=&TWiki::Func::extractNameValuePair( $attr, "jpegDefaultPhoto" ) || $LDAP_jpegDefaultPhoto;
  	
      # Error message if LDAP request give no answer
      my $NotFoundError=&TWiki::Func::extractNameValuePair( $attr, "notfounderror" ) 
***************
*** 117,136 ****
  				  binmode(FILE);
  				  print FILE $y;
  				  close (FILE);
! 				  $y="<IMG SRC=\"". TWiki::Func::getPubUrlPath()."/LdapPhotos/$jpegPhotoFile\" border=\"0\" ALIGN=\"MIDDLE\">";
  				  &TWiki::Func::writeDebug( " - create $dir/$jpegPhotoFile\n") if $debug;
  			        }
  				if ( $y =~ /^cn=([^\d]+)\d+,ou=people,dc=parkeon,dc=com/g ) { $y = "$1"; }
  				$y=~s/\n/ /g;           # remove newlines from data (messes with format)
  				$row =~ s/\$$x/$y/ge;   #replace $field with $y (the value)
  			} else {
  				$row =~ s/\$$x/" "/ge;
  			}
  		} 
  		$value .= "$row\n";
  	}
  	
- 
  	&TWiki::Func::writeDebug( "- $value" ) if $debug;
  	$value=&TWiki::getRenderedVersion( $value );
      return ($value);
--- 118,137 ----
  				  binmode(FILE);
  				  print FILE $y;
  				  close (FILE);
! 				  $y=TWiki::Func::getPubUrlPath()."/LdapPhotos/$jpegPhotoFile";
  				  &TWiki::Func::writeDebug( " - create $dir/$jpegPhotoFile\n") if $debug;
  			        }
  				if ( $y =~ /^cn=([^\d]+)\d+,ou=people,dc=parkeon,dc=com/g ) { $y = "$1"; }
  				$y=~s/\n/ /g;           # remove newlines from data (messes with format)
  				$row =~ s/\$$x/$y/ge;   #replace $field with $y (the value)
  			} else {
+                                 $row =~ s/\$$jpegPhoto/$jpegDefaultPhoto/ge;
  				$row =~ s/\$$x/" "/ge;
  			}
  		} 
  		$value .= "$row\n";
  	}
  	
  	&TWiki::Func::writeDebug( "- $value" ) if $debug;
  	$value=&TWiki::getRenderedVersion( $value );
      return ($value);
***************
*** 162,168 ****
      $LDAP_Filter .= &TWiki::wikiToUserName($topic);
      
      #jpegPhoto define the Photo attribute name, if any
!     $LDAP_jpegPhoto =  &TWiki::Prefs::getPreferencesValue ("LDAPPLUGIN_JPEGPHOTO") || 'jpegPhoto';
          
      # Get plugin debug flag
      $debug = &TWiki::Func::getPreferencesFlag( "LDAPPLUGIN_DEBUG" );
--- 163,170 ----
      $LDAP_Filter .= &TWiki::wikiToUserName($topic);
      
      #jpegPhoto define the Photo attribute name, if any
!     $LDAP_jpegPhoto = &TWiki::Prefs::getPreferencesValue ("LDAPPLUGIN_JPEGPHOTO") || 'jpegPhoto';
!     $LDAP_jpegDefaultPhoto = &TWiki::Prefs::getPreferencesValue ("LDAPPLUGIN_JPEGDEFAULTPHOTO") || '';
          
      # Get plugin debug flag
      $debug = &TWiki::Func::getPreferencesFlag( "LDAPPLUGIN_DEBUG" );
