haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
$ldapserver_dst = new LDAPServer($server_id_dst);
if( ! $ldapserver_src->haveAuthInfo())
pla_error( $lang['not_enough_login_info'] );
dn_exists( $ldapserver_src, $dn_src ) or pla_error( sprintf( $lang['no_such_entry'], pretty_print_dn( $dn_src ) ) );
dn_exists( $ldapserver_dst, $dn_dst ) or pla_error( sprintf( $lang['no_such_entry'], pretty_print_dn( $dn_dst ) ) );
$friendly_attrs = process_friendly_attr_table();
$attrs_src = get_object_attrs( $ldapserver_src, $dn_src, false, get_view_deref_setting() );
$attrs_dst = get_object_attrs( $ldapserver_dst, $dn_dst, false, get_view_deref_setting() );
# Get a list of all attributes.
$attrs_all = array_keys($attrs_src);
foreach ($attrs_dst as $key => $val)
if (! in_array($key,$attrs_all))
$attrs_all[] = $key;
include './header.php'; ?>
: name; ?> :
: name; ?> :
(" . $lang['no_attributes'] . ")
\n";
echo "
";
echo "";
die();
}
sort( $attrs_all );
// Work through each of the attributes.
foreach( $attrs_all as $attr ) {
flush();
# If this is the DN, get the next attribute.
if( ! strcasecmp( $attr, 'dn' ) )
continue;
// Has the config.php specified that this attribute is to be hidden or shown?
if( is_attr_hidden( $ldapserver_src, $attr) || is_attr_hidden( $ldapserver_dst, $attr))
continue; ?>
isReadOnly() ) { ?>
 
<". $lang['no_value'].">
";
$toJump = 1;
continue;
} else
$vals = $attrs_src[$attr];
$ldapserver = $ldapserver_src;
break;
case 'dst':
if (! isset($attrs_dst[$attr])) {
echo "<". $lang['no_value'].">";
$toJump = 1;
continue;
} else
$vals = $attrs_dst[$attr];
$ldapserver = $ldapserver_dst;
break;
}
if ($toJump) continue;
/*
* Is this attribute a jpegPhoto?
*/
if( is_jpeg_photo( $ldapserver, $attr ) ) {
switch ($side) {
case 'src':
// Don't draw the delete buttons if there is more than one jpegPhoto
// (phpLDAPadmin can't handle this case yet)
draw_jpeg_photos( $ldapserver, $dn_src, $attr, false );
break;
case 'dst':
if( $ldapserver_dst->isReadOnly() || is_attr_read_only( $ldapserver_dst, $attr ) )
draw_jpeg_photos( $ldapserver, $dn_dst, $attr, false );
else
draw_jpeg_photos( $ldapserver, $dn_dst, $attr, true );
break;
}
// proceed to the next attribute
echo "\n";
continue;
}
/*
* Is this attribute binary?
*/
if( is_attr_binary( $ldapserver, $attr ) ) {
switch ($side) {
case 'src':
$href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_src,$attr);
break;
case 'dst':
$href = sprintf("download_binary_attr.php?server_id=%s&dn=%s&attr=%s",$ldapserver->server_id,$encoded_dn_dst,$attr);
break;
}
?>
1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?>
"> ()
isReadOnly() && ! is_attr_read_only( $ldapserver, $attr ) ) { ?>
isReadOnly() || is_attr_read_only( $ldapserver, $attr )) ) {
if( is_array( $vals ) ) {
foreach( $vals as $i => $val ) {
if( trim( $val ) == "" )
echo "[" . $lang['empty'] . "] \n";
elseif( 0 == strcasecmp( $attr, 'userPassword' ) && obfuscate_password_display() )
echo preg_replace( '/./', '*', $val ) . " ";
else
echo htmlspecialchars( $val ) . " ";
}
} else {
if( 0 == strcasecmp( $attr, 'userPassword' ) && obfuscate_password_display() )
echo preg_replace( '/./', '*', $vals ) . " ";
else
echo $vals . " ";
}
echo "";
continue;
}
/*
* Is this a userPassword attribute?
*/
if( ! strcasecmp( $attr, 'userpassword' ) ) {
$user_password = $vals[0];
$enc_type = get_enc_type( $user_password );
// Set the default hashing type if the password is blank (must be newly created)
if( $user_password == '' ) {
$enc_type = get_default_hash( $server_id );
}
if ($side == 'dst') { ?>
$val ) {
if ($side == 'dst') {
$input_name = "new_values[" . htmlspecialchars( $attr ) . "][$i]";
// We smack an id="..." tag in here that doesn't have [][] in it to allow the
// draw_chooser_link() to identify it after the user clicks.
$input_id = "new_values_" . htmlspecialchars($attr) . "_" . $i; ?>
type == 'structural') {
echo "$val (" . $lang['structural'] . ") ";
if ($side == 'dst') {?>
server_id ) ) {
if ($side == 'dst') {?>
isReadOnly()) {
// First check if the required objectClass is in this DN
$isOK = 0;
$src_oclass = array();
$attr_object = get_schema_attribute( $ldapserver_dst, $attr, $dn_dst );
foreach ($attr_object->used_in_object_classes as $oclass) {
if (in_array(strtolower($oclass),arrayLower($attrs_dst['objectClass']))) {
$isOK = 1;
break;
} else {
// Find oclass that the source has that provides this attribute.
if (in_array($oclass,$attrs_src['objectClass']))
$src_oclass[] = $oclass;
}
}
print "
 
";
if (! $isOK) {
if (count($src_oclass) == 1) {
$add_href = "add_oclass_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&new_oclass=$src_oclass[0]";
} else {
$add_href = "add_value_form.php?server_id=$ldapserver_dst->server_id&dn=$encoded_dn_dst&attr=objectClass";
}
if ($attr == 'objectClass')
printf('