~ubuntu-branches/debian/jessie/phpldapadmin/jessie

« back to all changes in this revision

Viewing changes to htdocs/compare.php

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-03-16 14:54:15 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090316145415-7dsvj319dd02h83j
Tags: 1.1.0.6-1
* New upstream release. (Closes: #518578)
* debian/rules: removed "-m 644" from the dh_install call. (Closes: #518847)
* debian/postrm: remove config.php at purge time. (Closes: #519086)
* debian/patches/hungarian.dpatch: fixed a hungarian translation.
  (Closes: #505559)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
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 $
3
3
 
4
4
/**
5
5
 * Compare two DNs - the destination DN is editable.
8
8
 
9
9
require_once './common.php';
10
10
 
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');
13
13
 
14
14
$encoded_dn_src = rawurlencode($dn_src);
15
15
$encoded_dn_dst = rawurlencode($dn_dst);
16
16
 
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');
19
19
 
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');
23
23
 
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');
27
27
 
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
 
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');
32
33
 
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'));
253
254
 
254
255
                        if (count($vals) > 1)
255
256
                                for ($i=1; $i<=count($vals); $i++)
256
 
                                        printf('<a href="%s&amp;value_num=%s"><img src="images/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),$i);
 
257
                                        printf('<a href="%s&amp;value_num=%s"><img src="%s/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),IMGDIR,$i);
257
258
                        else
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'));
259
260
 
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'));
262
263
 
263
264
                        echo '</small>';
264
265
                        echo '</td>';
322
323
 
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
 
 
 
326
                                echo enc_type_select_list($enc_type,'enc','userpassword',0);
327
327
                        }
328
328
 
329
329
                        echo '<br />';
383
383
                        # Is this value is a structural objectClass, make it read-only
384
384
                        if (0 == strcasecmp($attr,'objectClass')) {
385
385
 
386
 
                                printf('<a title="%s" href="cmd.php?cmd=schema&amp;server_id=%s&amp;view=objectClasses&amp;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&amp;server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="%s/info.png" /></a>',
 
387
                                        _('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val),IMGDIR);
388
388
 
389
389
                                $schema_object = $ldapserver->getSchemaObjectClass($val);
390
390
 
400
400
                        }
401
401
 
402
402
                        if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
403
 
                                printf('<a title="%s" href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;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&amp;server_id=%s&amp;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);
405
405
 
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);
408
408
 
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);
411
411
 
412
412
                        if ($ldapserver->isMultiLineAttr($attr,$val)) {
413
413
                                if ($side == 'dst')