phpldapadmin/htdocs/compare_form.php

66 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2009-06-30 09:29:51 +00:00
<?php
/**
* Compares two DN entries side by side.
* This is the entry form to determine which DN to compare this DN with.
2009-06-30 09:29:51 +00:00
*
* @package phpLDAPadmin
* @subpackage Page
2009-06-30 09:29:51 +00:00
*/
2009-06-30 09:29:51 +00:00
/**
*/
require './common.php';
2009-06-30 09:29:51 +00:00
# The DN we are working with
$request = array();
$request['dn'] = get_request('dn','GET');
2009-06-30 10:27:56 +00:00
# Check if the entry exists.
if (! $request['dn'] || ! $app['server']->dnExists($request['dn']))
error(sprintf(_('The entry (%s) does not exist.'),$request['dn']),'error','index.php');
$request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none'));
$request['page']->setDN($request['dn']);
$request['page']->accept();
# Render the form
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Compare another DN with'),get_rdn($request['dn'])));
$request['page']->drawSubTitle();
2009-06-30 10:40:33 +00:00
2010-02-24 15:03:10 +00:00
printf('<script type="text/javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo '<div style="text-align: center;">';
printf('%s <b>%s</b> %s<br />',_('Compare'),get_rdn($request['dn']),_('with '));
2010-02-24 15:03:10 +00:00
echo '</div>';
2009-06-30 10:40:33 +00:00
2010-02-24 15:03:10 +00:00
echo '<form action="cmd.php" method="post" id="compare_form">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="compare" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="server_id_src" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dn']));
2010-02-24 15:03:10 +00:00
echo '</div>';
2009-06-30 10:40:33 +00:00
echo "\n";
2010-02-24 15:03:10 +00:00
echo '<table border="0" style="border-spacing: 10px; margin-left: auto; margin-right: auto;">';
2009-06-30 10:40:33 +00:00
echo '<tr>';
printf('<td><acronym title="%s">%s</acronym>:</td>',
_('Compare this DN with another'),_('Destination DN'));
2009-06-30 10:40:33 +00:00
echo '<td>';
echo '<input type="text" name="dn_dst" size="45" value="" />';
2010-02-24 15:03:10 +00:00
draw_chooser_link('compare_form','dn_dst','true','');
2009-06-30 10:40:33 +00:00
echo '</td>';
echo '</tr>';
echo "\n";
printf('<tr><td>%s:</td><td>%s</td></tr>',_('Destination Server'),server_select_list($app['server']->getIndex(),true,'server_id_dst'));
2009-06-30 10:40:33 +00:00
echo "\n";
2010-02-24 15:03:10 +00:00
printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" value="%s" /></td></tr>',_('Compare'));
2009-06-30 10:40:33 +00:00
echo "\n";
2009-06-30 09:29:51 +00:00
2009-06-30 10:40:33 +00:00
echo '</table>';
echo '</form>';
?>