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

« back to all changes in this revision

Viewing changes to htdocs/rename.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/rename.php,v 1.33.2.1 2007/12/26 09:26:32 wurley Exp $
 
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.33.2.3 2008/12/12 12:20:22 wurley Exp $
3
3
 
4
4
/**
5
5
 * Renames a DN to a different name.
18
18
require './common.php';
19
19
 
20
20
if ($ldapserver->isReadOnly())
21
 
        pla_error(_('You cannot perform updates while server is in read-only mode'));
 
21
        error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
22
22
 
23
23
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_rename'))
24
 
        pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('rename entry')));
 
24
        error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('rename entry')),'error','index.php');
25
25
 
26
 
$dn = ($_POST['dn']);
 
26
$dn = get_request('dn');
27
27
if (! $ldapserver->isBranchRenameEnabled()) {
28
28
        # we search all children, not only the visible children in the tree
29
29
        $children = $ldapserver->getContainerContents($dn);
30
30
        if (count($children) > 0)
31
 
                pla_error(_('You cannot rename an entry which has children entries (eg, the rename operation is not allowed on non-leaf entries)'));
 
31
                error(_('You cannot rename an entry which has children entries (eg, the rename operation is not allowed on non-leaf entries)'),'error','index.php');
32
32
}
33
33
 
34
 
$new_rdn = ($_POST['new_rdn']);
 
34
$new_rdn = get_request('new_rdn');
35
35
$container = get_container($dn);
36
36
$new_dn = sprintf('%s,%s',$new_rdn,$container);
37
37
 
38
38
if ($new_dn == $dn)
39
 
        pla_error(_('You did not change the RDN'));
 
39
        error(_('You did not change the RDN'),'error','index.php');
40
40
 
41
41
$old_dn_attr = explode('=',$dn);
42
42
$old_dn_attr = $old_dn_attr[0];
44
44
$new_dn_value = explode('=',$new_rdn,2);
45
45
 
46
46
if (count($new_dn_value) != 2 || ! isset($new_dn_value[1]))
47
 
        pla_error(_('Invalid RDN value'));
 
47
        error(_('Invalid RDN value'),'error','index.php');
48
48
 
49
49
$new_dn_attr = $new_dn_value[0];
50
50
$new_dn_value = $new_dn_value[1];
58
58
        $success = $ldapserver->rename($dn,$new_rdn,$container,$deleteoldrdn);
59
59
 
60
60
} else {
61
 
        pla_error(_('Could not rename the entry') );
 
61
        error(_('Could not rename the entry'),'error','index.php');
62
62
}
63
63
 
64
64
if ($success) {