getServer(get_request('server_id_src'));
$ldap['DST'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id_dst'));
if (! $ldap['SRC']->dnExists($request['dnSRC']))
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($request['dnSRC'])),'error','index.php');
if (! $ldap['DST']->dnExists($request['dnDST']))
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($request['dnDST'])),'error','index.php');
$request['pageSRC'] = new PageRender($ldap['SRC']->getIndex(),get_request('template','REQUEST',false,'none'));
$request['pageSRC']->setDN($request['dnSRC']);
$request['pageSRC']->accept();
$request['templateSRC'] = $request['pageSRC']->getTemplate();
$request['pageDST'] = new PageRender($ldap['DST']->getIndex(),get_request('template','REQUEST',false,'none'));
$request['pageDST']->setDN($request['dnDST']);
$request['pageDST']->accept();
$request['templateDST'] = $request['pageDST']->getTemplate();
# Get a list of all attributes.
$attrs_all = array_unique(array_merge($request['templateSRC']->getAttributeNames(),$request['templateDST']->getAttributeNames()));
$request['pageSRC']->drawTitle(_('Comparing the following DNs'));
echo '
';
echo '
';
echo '';
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$ldap['SRC']->getIndex(),rawurlencode($request['dnSRC']));
printf('%s: %s | ',
_('DN'),
htmlspecialchars($href),$request['dnSRC']);
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$ldap['DST']->getIndex(),rawurlencode($request['dnDST']));
printf('%s: %s | ',
_('DN'),
htmlspecialchars($href),$request['dnDST']);
echo '
';
echo '';
echo '';
echo '';
echo ' | ';
echo '
';
if (! is_array($attrs_all) || ! count($attrs_all)) {
printf('(%s) |
',_('This entry has no attributes'));
print '
';
return;
}
sort($attrs_all);
# Work through each of the attributes.
foreach ($attrs_all as $attr) {
# Has the config.php specified that this attribute is to be hidden or shown?
if ($ldap['SRC']->isAttrHidden($attr) || $ldap['DST']->isAttrHidden($attr))
continue;
$attributeSRC = $request['templateSRC']->getAttribute($attr);
$attributeDST = $request['templateDST']->getAttribute($attr);
# Get the values and see if they are the same.
if ($attributeSRC && $attributeDST && ($attributeSRC->getValues() == $attributeDST->getValues()))
echo '';
else
echo '
';
foreach (array('src','dst') as $side) {
# If we are on the source side, show the attribute name.
switch ($side) {
case 'src':
if ($attributeSRC) {
echo '';
$request['pageSRC']->draw('Name',$attributeSRC);
echo ' | ';
if ($request['pageSRC']->getServerID() == $request['pageDST']->getServerID())
echo ' | ';
else {
echo '';
$request['pageSRC']->draw('Notes',$attributeSRC);
echo ' | ';
}
} else {
echo ' | ';
}
break;
case 'dst':
if ($attributeDST) {
if ($attributeSRC && ($request['pageSRC']->getServerID() == $request['pageDST']->getServerID()))
echo ' | ';
else {
echo '';
$request['pageDST']->draw('Name',$attributeDST);
echo ' | ';
}
echo '';
$request['pageDST']->draw('Notes',$attributeDST);
echo ' | ';
} else {
echo ' | ';
}
break;
}
}
echo '
';
echo "\n\n";
# Get the values and see if they are the same.
if ($attributeSRC && $attributeDST && ($attributeSRC->getValues() == $attributeDST->getValues()))
echo '';
else
echo '
';
foreach (array('src','dst') as $side) {
echo '';
echo '';
switch ($side) {
case 'src':
if ($attributeSRC && count($attributeSRC->getValues()))
$request['pageSRC']->draw('CurrentValues',$attributeSRC);
else
echo ' ';
break;
case 'dst':
if ($attributeDST && count($attributeDST->getValues()))
$request['pageDST']->draw('CurrentValues',$attributeDST);
else
echo ' ';
break;
}
echo ' | ';
echo ' | ';
}
echo '
';
}
echo '';
?>