Instance($server_id_src);
if (! $ldapserver_src->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$ldapserver_dst = $ldapservers->Instance($server_id_dst);
if (! $ldapserver_src->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
if (! $ldapserver_src->dnExists($dn_src))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_src)));
if (! $ldapserver_dst->dnExists($dn_dst))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_dst)));
$friendly_attrs = process_friendly_attr_table();
$attrs_src = $ldapserver_src->getDNAttrs($dn_src,false,$config->GetValue('deref','view'));
$attrs_dst = $ldapserver_dst->getDNAttrs($dn_dst,false,$config->GetValue('deref','view'));
# 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; ?> :
(%s)
',_('This entry has no attributes'));
print '
';
print '';
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 ($ldapserver_src->isAttrHidden($attr) || $ldapserver_dst->isAttrHidden($attr))
continue;
?>
isReadOnly()) { ?>
 
';
if (! isset($attrs_src[$attr])) {
echo "<". _('No Value').">
';
if (! isset($attrs_dst[$attr])) {
echo "<". _('No Value').">
";
$toJump = 1;
continue;
} else
$vals = $attrs_dst[$attr];
$ldapserver = $ldapserver_dst;
break;
}
if ($toJump) continue;
if (! is_array($vals))
$vals = array($vals);
/*
* Is this attribute a jpegPhoto?
*/
if ($ldapserver->isJpegPhoto($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() || $ldapserver_dst->isAttrReadOnly($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 ($ldapserver->isAttrBinary($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() && ! $ldapserver->isAttrReadOnly($attr)) { ?>
isReadOnly() || $ldapserver->isAttrReadOnly($attr))) {
if (is_array($vals)) {
foreach ($vals as $i => $val) {
if (trim($val) == "")
echo "[" . _('empty') . "] \n";
elseif (0 == strcasecmp($attr,'userPassword') && $config->GetValue('appearance','obfuscate_password_display'))
echo preg_replace('/./','*',$val) . " ";
else
echo htmlspecialchars($val) . " ";
}
// @todo: redundant - $vals is always an array.
} else {
if (0 == strcasecmp($attr,'userPassword') && $config->GetValue('appearance','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') { ?>
isAttrBoolean($attr)) {
$val = $vals[0];
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; ?>
getSchemaObjectClass($val);
if ($schema_object->getType() == 'structural') {
echo "$val (" . _('structural') . ") ";
if ($side == 'dst') {?>
isDNAttr($attr)) { ?>
isMultiLineAttr($attr,$val)) {
if ($side == 'dst') {?>
isDNAttr($attr))
draw_chooser_link("edit_form.$input_id",false); ?>
isReadOnly()) {
// First check if the required objectClass is in this DN
$isOK = 0;
$src_oclass = array();
$attr_object = $ldapserver_dst->getSchemaAttribute($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 = sprintf('add_oclass_form.php?server_id=%s&dn=%s&new_oclass=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,$src_oclass[0]);
} else {
$add_href = sprintf('add_value_form.php?server_id=%s&dn=%s&attr=objectClass',
$ldapserver_dst->server_id,$encoded_dn_dst);
}
if ($attr == 'objectClass')
printf('
',$add_href,sprintf(_('You need one of the following ObjectClass(es) to add this attribute %s.'),implode(" ",$src_oclass)),_('Add new ObjectClass'));
} else {
if (! $schema_attr_dst->getIsSingleValue() || (! isset($vals))) {
$add_href = sprintf('add_value_form.php?server_id=%s&dn=%s&attr=%s',
$ldapserver_dst->server_id,$encoded_dn_dst,rawurlencode($attr));
printf('