2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.3 2008/01/13 06:33:50 wurley Exp $
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.7 2008/12/12 12:20:22 wurley Exp $
5
5
* Compare two DNs - the destination DN is editable.
9
9
require_once './common.php';
11
$dn_src = isset($_POST['dn_src']) ? $_POST['dn_src'] : null;
12
$dn_dst = isset($_POST['dn_dst']) ? $_POST['dn_dst'] : null;
11
$dn_src = get_request('dn_src');
12
$dn_dst = get_request('dn_dst');
14
14
$encoded_dn_src = rawurlencode($dn_src);
15
15
$encoded_dn_dst = rawurlencode($dn_dst);
17
$server_id_src = (isset($_POST['server_id_src']) ? $_POST['server_id_src'] : '');
18
$server_id_dst = (isset($_POST['server_id_dst']) ? $_POST['server_id_dst'] : '');
17
$server_id_src = get_request('server_id_src');
18
$server_id_dst = get_request('server_id_dst');
20
20
$ldapserver_src = $_SESSION[APPCONFIG]->ldapservers->Instance($server_id_src);
21
21
if (! $ldapserver_src->haveAuthInfo())
22
pla_error(_('Not enough information to login to server. Please check your configuration.'));
22
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
24
24
$ldapserver_dst = $_SESSION[APPCONFIG]->ldapservers->Instance($server_id_dst);
25
25
if (! $ldapserver_src->haveAuthInfo())
26
pla_error(_('Not enough information to login to server. Please check your configuration.'));
26
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
28
28
if (! $ldapserver_src->dnExists($dn_src))
29
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_src)));
29
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($dn_src)),'error','index.php');
30
31
if (! $ldapserver_dst->dnExists($dn_dst))
31
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_dst)));
32
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($dn_dst)),'error','index.php');
33
34
$attrs_src = $ldapserver_src->getDNAttrs($dn_src,false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
34
35
$attrs_dst = $ldapserver_dst->getDNAttrs($dn_dst,false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
254
255
if (count($vals) > 1)
255
256
for ($i=1; $i<=count($vals); $i++)
256
printf('<a href="%s&value_num=%s"><img src="images/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),$i);
257
printf('<a href="%s&value_num=%s"><img src="%s/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),IMGDIR,$i);
258
printf('<a href="%s"><img src="images/save.png" /> %s</a><br />',$href,_('download value'));
259
printf('<a href="%s"><img src="%s/save.png" /> %s</a><br />',$href,IMGDIR,_('download value'));
260
261
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr))
261
printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="images/trash.png" /> %s</a>',$attr,_('delete attribute'));
262
printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="%s/trash.png" /> %s</a>',$attr,IMGDIR,_('delete attribute'));
323
324
if ($side == 'dst') {
324
325
printf('<input style="width: 260px" type="password" name="new_values[userpassword]" value="%s" />',htmlspecialchars($user_password));
325
echo enc_type_select_list($enc_type);
326
echo enc_type_select_list($enc_type,'enc','userpassword',0);
383
383
# Is this value is a structural objectClass, make it read-only
384
384
if (0 == strcasecmp($attr,'objectClass')) {
386
printf('<a title="%s" href="cmd.php?cmd=schema&server_id=%s&view=objectClasses&viewvalue=%s"><img src="images/info.png" /></a>',
387
_('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val));
386
printf('<a title="%s" href="cmd.php?cmd=schema&server_id=%s&view=objectClasses&viewvalue=%s"><img src="%s/info.png" /></a>',
387
_('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val),IMGDIR);
389
389
$schema_object = $ldapserver->getSchemaObjectClass($val);
402
402
if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
403
printf('<a title="%s" href="cmd.php?cmd=template_engine&server_id=%s&dn=%s"><img style="vertical-align: top" src="images/go.png" /></a>',
404
sprintf(_('Go to %s'),htmlspecialchars($val)),$ldapserver->server_id,rawurlencode($val));
403
printf('<a title="%s" href="cmd.php?cmd=template_engine&server_id=%s&dn=%s"><img style="vertical-align: top" src="%s/go.png" /></a>',
404
sprintf(_('Go to %s'),htmlspecialchars($val)),$ldapserver->server_id,rawurlencode($val),IMGDIR);
406
406
elseif (is_mail_string($val))
407
printf('<a href="mailto:%s><img style="vertical-align: center" src="images/mail.png" /></a>',htmlspecialchars($val));
407
printf('<a href="mailto:%s><img style="vertical-align: center" src="%s/mail.png" /></a>',htmlspecialchars($val),IMGDIR);
409
409
elseif (is_url_string($val))
410
printf('<a href="%s" target="new"><img style="vertical-align: center" src="images/dc.png" /></a>',htmlspecialchars($val));
410
printf('<a href="%s" target="new"><img style="vertical-align: center" src="%s/dc.png" /></a>',htmlspecialchars($val),IMGDIR);
412
412
if ($ldapserver->isMultiLineAttr($attr,$val)) {
413
413
if ($side == 'dst')